ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/rxvtdaemon.C
(Generate patch)

Comparing rxvt-unicode/src/rxvtdaemon.C (file contents):
Revision 1.10 by root, Sun Dec 25 16:19:34 2005 UTC vs.
Revision 1.13 by root, Mon Feb 20 22:42:00 2006 UTC

1/*--------------------------------*-C-*---------------------------------* 1/*----------------------------------------------------------------------*
2 * File: rxvtdaemon.C 2 * File: rxvtdaemon.C
3 *----------------------------------------------------------------------* 3 *----------------------------------------------------------------------*
4 * 4 *
5 * All portions of code are copyright by their respective author/s. 5 * All portions of code are copyright by their respective author/s.
6 * Copyright (c) 2003-2004 Marc Lehmann <pcg@goof.com> 6 * Copyright (c) 2003-2006 Marc Lehmann <pcg@goof.com>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or 10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version. 11 * (at your option) any later version.
56 56
57void rxvt_connection::send (const char *data, int len) 57void rxvt_connection::send (const char *data, int len)
58{ 58{
59 uint8_t s[2]; 59 uint8_t s[2];
60 60
61 if (len > 65535)
62 len = 65535;
63
61 s[0] = len >> 8; s[1] = len; 64 s[0] = len >> 8; s[1] = len;
62 65
63 write (fd, s, 2); 66 write (fd, s, 2);
64 write (fd, data, len); 67 write (fd, data, len);
65} 68}
76 79
77 if (read (fd, s, 2) != 2) 80 if (read (fd, s, 2) != 2)
78 return false; 81 return false;
79 82
80 l = (s[0] << 8) + s[1]; 83 l = (s[0] << 8) + s[1];
81 if (l > 4096) 84 if (l > 65535)
82 return false; 85 return false;
83 86
84 if (len) 87 if (len)
85 *len = l; 88 *len = l;
86 89

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines