libpurple/protocols/mxit/http.c

branch
mxit
changeset 30310
da2adcf3b4a0
parent 29106
51c7b2177e42
child 32154
9491c289412b
child 33744
879db2a9a59c
equal deleted inserted replaced
30309:91757da987a9 30310:da2adcf3b4a0
116 buflen = session->rx_i; 116 buflen = session->rx_i;
117 117
118 /* read bytes from the socket */ 118 /* read bytes from the socket */
119 len = read( session->fd, buf + buflen, sizeof( buf ) - buflen ); 119 len = read( session->fd, buf + buflen, sizeof( buf ) - buflen );
120 if ( len <= 0 ) { 120 if ( len <= 0 ) {
121 /* connection has been terminated, or error occured */ 121 /* connection has been terminated, or error occurred */
122 goto done; 122 goto done;
123 } 123 }
124 124
125 //nextpacket: 125 //nextpacket:
126 126
137 memcpy( session->rx_dbuf, buf, session->rx_i ); 137 memcpy( session->rx_dbuf, buf, session->rx_i );
138 return; 138 return;
139 } 139 }
140 buflen += len; 140 buflen += len;
141 141
142 /* we have the header's end now skip over the http seperator to get the body offset */ 142 /* we have the header's end now skip over the http separator to get the body offset */
143 ch += strlen( HTTP_11_SEPERATOR ); 143 ch += strlen( HTTP_11_SEPERATOR );
144 *(ch - 1) = '\0'; 144 *(ch - 1) = '\0';
145 body = ch; 145 body = ch;
146 146
147 res = buflen - ( ch - buf ); 147 res = buflen - ( ch - buf );
204 /* we are reading the HTTP content (body) */ 204 /* we are reading the HTTP content (body) */
205 205
206 /* read bytes from the socket */ 206 /* read bytes from the socket */
207 len = read( session->fd, &session->rx_dbuf[session->rx_i], session->rx_res ); 207 len = read( session->fd, &session->rx_dbuf[session->rx_i], session->rx_res );
208 if ( len <= 0 ) { 208 if ( len <= 0 ) {
209 /* connection has been terminated, or error occured */ 209 /* connection has been terminated, or error occurred */
210 goto done; 210 goto done;
211 } 211 }
212 212
213 #ifdef DEBUG_HTTP 213 #ifdef DEBUG_HTTP
214 purple_debug_info( MXIT_PLUGIN_ID, "HTTP POST READ 2: (%i)\n", len ); 214 purple_debug_info( MXIT_PLUGIN_ID, "HTTP POST READ 2: (%i)\n", len );

mercurial