Lines Matching refs:psnd

137   struct postponed_data * const psnd = &(conn->postponed[sockindex]);  in Curl_recv_has_postponed_data()  local
138 return psnd->buffer && psnd->allocated_size && in Curl_recv_has_postponed_data()
139 psnd->recv_size > psnd->recv_processed; in Curl_recv_has_postponed_data()
145 struct postponed_data * const psnd = &(conn->postponed[num]); in pre_receive_plain() local
146 size_t bytestorecv = psnd->allocated_size - psnd->recv_size; in pre_receive_plain()
154 (!psnd->buffer || bytestorecv)) { in pre_receive_plain()
159 if(!psnd->buffer) { in pre_receive_plain()
161 psnd->allocated_size = 2 * conn->data->set.buffer_size; in pre_receive_plain()
162 psnd->buffer = malloc(psnd->allocated_size); in pre_receive_plain()
163 psnd->recv_size = 0; in pre_receive_plain()
164 psnd->recv_processed = 0; in pre_receive_plain()
166 psnd->bindsock = sockfd; /* Used only for DEBUGASSERT */ in pre_receive_plain()
168 bytestorecv = psnd->allocated_size; in pre_receive_plain()
170 if(psnd->buffer) { in pre_receive_plain()
172 DEBUGASSERT(psnd->bindsock == sockfd); in pre_receive_plain()
173 recvedbytes = sread(sockfd, psnd->buffer + psnd->recv_size, in pre_receive_plain()
176 psnd->recv_size += recvedbytes; in pre_receive_plain()
179 psnd->allocated_size = 0; in pre_receive_plain()
187 struct postponed_data * const psnd = &(conn->postponed[num]); in get_pre_recved() local
189 if(!psnd->buffer) in get_pre_recved()
192 DEBUGASSERT(psnd->allocated_size > 0); in get_pre_recved()
193 DEBUGASSERT(psnd->recv_size <= psnd->allocated_size); in get_pre_recved()
194 DEBUGASSERT(psnd->recv_processed <= psnd->recv_size); in get_pre_recved()
197 if(psnd->recv_size > psnd->recv_processed) { in get_pre_recved()
198 DEBUGASSERT(psnd->bindsock == conn->sock[num]); in get_pre_recved()
199 copysize = CURLMIN(len, psnd->recv_size - psnd->recv_processed); in get_pre_recved()
200 memcpy(buf, psnd->buffer + psnd->recv_processed, copysize); in get_pre_recved()
201 psnd->recv_processed += copysize; in get_pre_recved()
207 if(psnd->recv_processed == psnd->recv_size) { in get_pre_recved()
208 free(psnd->buffer); in get_pre_recved()
209 psnd->buffer = NULL; in get_pre_recved()
210 psnd->allocated_size = 0; in get_pre_recved()
211 psnd->recv_size = 0; in get_pre_recved()
212 psnd->recv_processed = 0; in get_pre_recved()
214 psnd->bindsock = CURL_SOCKET_BAD; in get_pre_recved()