crossroads

Git mirror of https://crossroads.e-tunity.com/
git clone git://git.finwo.net/app/crossroads
Log | Files | Refs

httpwrite.c (690B)


      1 /*************************************************************************
      2  * This file is part of Crosroads 1.23, a load balancer and fail over
      3  * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL.
      4  * Visit http://crossroads.e-tunity.com for information.
      5  *************************************************************************/
      6 #include "crossroads.h"
      7 
      8 int http_write (int sock, CopyDirection dir, unsigned char const *buf,
      9 		unsigned buflen) {
     10     int nwritten, totwritten = 0;
     11 
     12     while (totwritten < buflen) {
     13 	nwritten = net_write (sock, buf + totwritten, buflen - totwritten,
     14 			      dir == dir_client_to_server);
     15 	totwritten += nwritten;
     16     }
     17     return (0);
     18 }