Lines Matching refs:psnd
128 struct postponed_data * const psnd = &(conn->postponed[num]);
129 size_t bytestorecv = psnd->allocated_size - psnd->recv_size;
137 (!psnd->buffer || bytestorecv)) {
142 if(!psnd->buffer) {
144 psnd->allocated_size = 2 * BUFSIZE;
145 psnd->buffer = malloc(psnd->allocated_size);
146 psnd->recv_size = 0;
147 psnd->recv_processed = 0;
149 psnd->bindsock = sockfd; /* Used only for DEBUGASSERT */
151 bytestorecv = psnd->allocated_size;
153 if(psnd->buffer) {
155 DEBUGASSERT(psnd->bindsock == sockfd);
156 recvedbytes = sread(sockfd, psnd->buffer + psnd->recv_size,
159 psnd->recv_size += recvedbytes;
162 psnd->allocated_size = 0;
170 struct postponed_data * const psnd = &(conn->postponed[num]);
172 if(!psnd->buffer)
175 DEBUGASSERT(psnd->allocated_size > 0);
176 DEBUGASSERT(psnd->recv_size <= psnd->allocated_size);
177 DEBUGASSERT(psnd->recv_processed <= psnd->recv_size);
180 if(psnd->recv_size > psnd->recv_processed) {
181 DEBUGASSERT(psnd->bindsock == conn->sock[num]);
182 copysize = CURLMIN(len, psnd->recv_size - psnd->recv_processed);
183 memcpy(buf, psnd->buffer + psnd->recv_processed, copysize);
184 psnd->recv_processed += copysize;
190 if(psnd->recv_processed == psnd->recv_size) {
191 free(psnd->buffer);
192 psnd->buffer = NULL;
193 psnd->allocated_size = 0;
194 psnd->recv_size = 0;
195 psnd->recv_processed = 0;
197 psnd->bindsock = CURL_SOCKET_BAD;