Develop and Download Open Source Software

Browse Subversion Repository

Diff of /tags/REL-2.2/ftp_get_buffer.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 30 by hirohitohigashi, Sat Feb 28 13:03:02 2009 UTC revision 34 by hirohitohigashi, Sun Mar 1 12:43:14 2009 UTC
# Line 41  Line 41 
41   *@param        fname   サーバ上のファイル名   *@param        fname   サーバ上のファイル名
42   *@param        buf     バッファへのポインタ   *@param        buf     バッファへのポインタ
43   *@param        bufsiz  バッファサイズ   *@param        bufsiz  バッファサイズ
44   *@retval       int     エラーコード   *@retval       int     取得したバイト数 マイナス値ならエラーコード
45   *@note   *@note
46   */   */
47  int ftp_get_buffer( LIBOFTP *ftp, const char *fname, char *buf, int bufsiz )  int ftp_get_buffer( LIBOFTP *ftp, const char *fname, char *buf, int bufsiz )
48  {  {
49      int data_socket;      int data_socket;
50      char *p = buf;      char *p = buf;
51      int n, res;      int res;
52    
53      /*      /*
54       * 受信準備       * 受信準備
# Line 66  int ftp_get_buffer( LIBOFTP *ftp, const Line 66  int ftp_get_buffer( LIBOFTP *ftp, const
66       * タイムアウトが意図通りに働くように、分割してrecvする。       * タイムアウトが意図通りに働くように、分割してrecvする。
67       */       */
68      while( 1 ) {      while( 1 ) {
69            int n;
70          int len = bufsiz;          int len = bufsiz;
71          if( len > TRANSFER_SEGMENT_SIZE ) {          if( len > TRANSFER_SEGMENT_SIZE ) {
72              len = TRANSFER_SEGMENT_SIZE;              len = TRANSFER_SEGMENT_SIZE;
# Line 104  int ftp_get_buffer( LIBOFTP *ftp, const Line 105  int ftp_get_buffer( LIBOFTP *ftp, const
105          return LIBOFTP_ERROR_BUFFER;          return LIBOFTP_ERROR_BUFFER;
106      }      }
107    
108      return LIBOFTP_NOERROR;      return p - buf;             /* return with transfered bytes */
109  }  }

Legend:
Removed from v.30  
changed lines
  Added in v.34

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26