Lines Matching refs:oci

230     ConnectionInputPtr oci = oc->input;  in ReadRequestFromClient()  local
241 if (!oci) { in ReadRequestFromClient()
242 if ((oci = FreeInputs)) { in ReadRequestFromClient()
243 FreeInputs = oci->next; in ReadRequestFromClient()
245 else if (!(oci = AllocateInputBuffer())) { in ReadRequestFromClient()
249 oc->input = oci; in ReadRequestFromClient()
262 oci->bufptr += oci->lenLastReq; in ReadRequestFromClient()
266 gotnow = oci->bufcnt + oci->buffer - oci->bufptr; in ReadRequestFromClient()
268 if (oci->ignoreBytes > 0) { in ReadRequestFromClient()
269 if (oci->ignoreBytes > oci->size) in ReadRequestFromClient()
270 needed = oci->size; in ReadRequestFromClient()
272 needed = oci->ignoreBytes; in ReadRequestFromClient()
285 request = (xReq *) oci->bufptr; in ReadRequestFromClient()
308 oci->lenLastReq = 0; in ReadRequestFromClient()
315 oci->ignoreBytes = needed - gotnow; in ReadRequestFromClient()
316 oci->lenLastReq = gotnow; in ReadRequestFromClient()
319 if ((gotnow == 0) || ((oci->bufptr - oci->buffer + needed) > oci->size)) { in ReadRequestFromClient()
322 if ((gotnow > 0) && (oci->bufptr != oci->buffer)) in ReadRequestFromClient()
324 memmove(oci->buffer, oci->bufptr, gotnow); in ReadRequestFromClient()
325 if (needed > oci->size) { in ReadRequestFromClient()
329 ibuf = (char *) realloc(oci->buffer, needed); in ReadRequestFromClient()
334 oci->size = needed; in ReadRequestFromClient()
335 oci->buffer = ibuf; in ReadRequestFromClient()
337 oci->bufptr = oci->buffer; in ReadRequestFromClient()
338 oci->bufcnt = gotnow; in ReadRequestFromClient()
352 result = _XSERVTransRead(oc->trans_conn, oci->buffer + oci->bufcnt, in ReadRequestFromClient()
353 oci->size - oci->bufcnt); in ReadRequestFromClient()
368 oci->bufcnt += result; in ReadRequestFromClient()
371 if ((oci->size > BUFWATERMARK) && in ReadRequestFromClient()
372 (oci->bufcnt < BUFSIZE) && (needed < BUFSIZE)) { in ReadRequestFromClient()
375 ibuf = (char *) realloc(oci->buffer, BUFSIZE); in ReadRequestFromClient()
377 oci->size = BUFSIZE; in ReadRequestFromClient()
378 oci->buffer = ibuf; in ReadRequestFromClient()
379 oci->bufptr = ibuf + oci->bufcnt - gotnow; in ReadRequestFromClient()
384 request = (xReq *) oci->bufptr; in ReadRequestFromClient()
411 if (oci->ignoreBytes > 0) { in ReadRequestFromClient()
412 assert(needed == oci->ignoreBytes || needed == oci->size); in ReadRequestFromClient()
418 oci->ignoreBytes -= gotnow; in ReadRequestFromClient()
419 oci->bufptr += gotnow; in ReadRequestFromClient()
423 oci->ignoreBytes -= needed; in ReadRequestFromClient()
424 oci->bufptr += needed; in ReadRequestFromClient()
430 oci->lenLastReq = needed; in ReadRequestFromClient()
449 request = (xReq *) oci->bufptr; in ReadRequestFromClient()
450 oci->bufptr += (sizeof(xBigReq) - sizeof(xReq)); in ReadRequestFromClient()
451 *(xReq *) oci->bufptr = *request; in ReadRequestFromClient()
452 oci->lenLastReq -= (sizeof(xBigReq) - sizeof(xReq)); in ReadRequestFromClient()
455 client->requestBuffer = (void *) oci->bufptr; in ReadRequestFromClient()
507 ConnectionInputPtr oci = oc->input; in InsertFakeRequest() local
512 if (!oci) { in InsertFakeRequest()
513 if ((oci = FreeInputs)) in InsertFakeRequest()
514 FreeInputs = oci->next; in InsertFakeRequest()
515 else if (!(oci = AllocateInputBuffer())) in InsertFakeRequest()
517 oc->input = oci; in InsertFakeRequest()
519 oci->bufptr += oci->lenLastReq; in InsertFakeRequest()
520 oci->lenLastReq = 0; in InsertFakeRequest()
521 gotnow = oci->bufcnt + oci->buffer - oci->bufptr; in InsertFakeRequest()
522 if ((gotnow + count) > oci->size) { in InsertFakeRequest()
525 ibuf = (char *) realloc(oci->buffer, gotnow + count); in InsertFakeRequest()
528 oci->size = gotnow + count; in InsertFakeRequest()
529 oci->buffer = ibuf; in InsertFakeRequest()
530 oci->bufptr = ibuf + oci->bufcnt - gotnow; in InsertFakeRequest()
532 moveup = count - (oci->bufptr - oci->buffer); in InsertFakeRequest()
535 memmove(oci->bufptr + moveup, oci->bufptr, gotnow); in InsertFakeRequest()
536 oci->bufptr += moveup; in InsertFakeRequest()
537 oci->bufcnt += moveup; in InsertFakeRequest()
539 memmove(oci->bufptr - count, data, count); in InsertFakeRequest()
540 oci->bufptr -= count; in InsertFakeRequest()
543 (gotnow >= (int) (get_req_len((xReq *) oci->bufptr, client) << 2))) in InsertFakeRequest()
565 register ConnectionInputPtr oci = oc->input; in ResetCurrentRequest() local
571 oci->lenLastReq = 0; in ResetCurrentRequest()
572 gotnow = oci->bufcnt + oci->buffer - oci->bufptr; in ResetCurrentRequest()
577 request = (xReq *) oci->bufptr; in ResetCurrentRequest()
580 oci->bufptr -= sizeof(xBigReq) - sizeof(xReq); in ResetCurrentRequest()
581 *(xReq *) oci->bufptr = *request; in ResetCurrentRequest()
582 ((xBigReq *) oci->bufptr)->length = client->req_len; in ResetCurrentRequest()
584 swapl(&((xBigReq *) oci->bufptr)->length); in ResetCurrentRequest()
978 ConnectionInputPtr oci; in AllocateInputBuffer() local
980 oci = malloc(sizeof(ConnectionInput)); in AllocateInputBuffer()
981 if (!oci) in AllocateInputBuffer()
983 oci->buffer = malloc(BUFSIZE); in AllocateInputBuffer()
984 if (!oci->buffer) { in AllocateInputBuffer()
985 free(oci); in AllocateInputBuffer()
988 oci->size = BUFSIZE; in AllocateInputBuffer()
989 oci->bufptr = oci->buffer; in AllocateInputBuffer()
990 oci->bufcnt = 0; in AllocateInputBuffer()
991 oci->lenLastReq = 0; in AllocateInputBuffer()
992 oci->ignoreBytes = 0; in AllocateInputBuffer()
993 return oci; in AllocateInputBuffer()
1017 ConnectionInputPtr oci; in FreeOsBuffers() local
1022 if ((oci = oc->input)) { in FreeOsBuffers()
1024 free(oci->buffer); in FreeOsBuffers()
1025 free(oci); in FreeOsBuffers()
1028 FreeInputs = oci; in FreeOsBuffers()
1029 oci->next = (ConnectionInputPtr) NULL; in FreeOsBuffers()
1030 oci->bufptr = oci->buffer; in FreeOsBuffers()
1031 oci->bufcnt = 0; in FreeOsBuffers()
1032 oci->lenLastReq = 0; in FreeOsBuffers()
1033 oci->ignoreBytes = 0; in FreeOsBuffers()
1052 ConnectionInputPtr oci; in ResetOsBuffers() local
1055 while ((oci = FreeInputs)) { in ResetOsBuffers()
1056 FreeInputs = oci->next; in ResetOsBuffers()
1057 free(oci->buffer); in ResetOsBuffers()
1058 free(oci); in ResetOsBuffers()