cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE-4: With Curl the last two lines are missing

From: <a.j.vandenberg02_at_kpn.com>
Date: Thu, 2 Sep 2004 14:58:14 +0200

Hello,

Still trying to automaticly download from beheer.t-mobile.nl (with https)

Last night after continuesly trying to build curl-7.12.1 (Win32) from source
I succeeded.
After testing a lot of exports I found another logic in the
size-differences.
Every time the actual size of the file is exactly 107 bytes more then the
Content_Length in the header.
So I updated lib/transfer.c and build curl-7.12.1 (Win32) from source again.
-----------------------------------
  char *filesize_extra = NULL; /* To get the extra bytes in Variable
CURL_FILESIZE_EXTRA */
  curl_off_t filesize_extra_num; /* To add extra bytes to Content_Length
*/
-----------------------------------
     filesize_extra = curl_getenv("CURL_FILESIZE_EXTRA"); /* portable
environment reader */
  if(filesize_extra) {
     filesize_extra_num = curlx_strtoofft(filesize_extra, NULL, 10);
     contentlength = contentlength + filesize_extra_num;
     infof(data, "curl_getenv(\"CURL_FILESIZE_EXTRA\")=%s added to
Content-Length from header, now --> %"
                    FORMAT_OFF_T " <--- .!!! \n", filesize_extra,
contentlength);
  }
  else {
     infof(data, "Content-Length from header-file --> %" FORMAT_OFF_T " <---
\n", contentlength);
  }
-----------------------------------
I'm not a real programmer (I know a little about a lot of
computer-languages), but the code works.
Te result is that curl get's the data in two parts, first the
Content_Length+7 and then the last 100 bytes.
-----------------------------------
<= Recv header, 19 bytes (0x13)
0000: Connection: close
<= Recv header, 51 bytes (0x33)
0000: Content-Disposition: anything;filename=export.tsv
== Info: curl_getenv("CURL_FILESIZE_EXTRA")=107 added to Content-Length from
header, now --> 1607 <--- .!!!
<= Recv header, 22 bytes (0x16)
0000: content-length: 1500
<= Recv header, 57 bytes (0x39)
0000: Content-Type: application/download; name="\export.tsv\"
<= Recv header, 40 bytes (0x28)
0000: Expires: Thu, 02 Sep 2004 08:44:08 GMT
<= Recv header, 24 bytes (0x18)
0000: Cache-control: private0000: Cache-control: private
<= Recv data, 1507 bytes (0x5e3)
0000: .<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
0040: "http://www.w3.org/TR/html4/loose.dtd">...."Datum"."Starttijd"."
0080: Soort Gesprek"."Bestemming"."Duur/Volume"."Bedrag"."11-02-2004".
00c0: "15:17"."TEL"."0505019280"."00:00:14 min."."0,71"."13-02-2004"."
0100: 12:32"."TEL"."0505019280"."00:00:33 min."."0,71"."13-02-2004"."1
0140: 3:10"."TEL"."0505019280"."00:00:19 min."."0,71"."17-02-2004"."12
0180: :42"."TEL"."0505019280"."00:00:24 min."."0,71"."19-02-2004"."13:
01c0: 45"."TEL"."0505019280"."00:01:23 min."."1,07"."23-02-2004"."13:2
0200: 7"."TEL"."0505019280"."00:00:55 min."."0,71"."26-02-2004"."09:08
0240: "."TEL"."0505019280"."00:01:36 min."."1,43"."26-02-2004"."10:07"
0280: ."TEL"."0505019280"."00:01:56 min."."1,43"."26-02-2004"."10:13".
02c0: "TEL"."0704182418"."00:02:21 min."."1,79"."26-02-2004"."10:16"."
0300: TEL"."0704182418"."00:05:53 min."."4,29"."26-02-2004"."12:53"."T
0340: EL"."0505019280"."00:00:33 min."."0,71"."26-02-2004"."13:43"."TE
0380: L"."0505019280"."00:00:17 min."."0,71"."26-02-2004"."16:02"."TEL
03c0: "."0505019280"."00:00:42 min."."0,71"."26-02-2004"."16:03"."TEL"
0400: ."0773242200"."00:02:19 min."."1,79"."26-02-2004"."16:07"."TEL".
0440: "0505019280"."00:01:35 min."."1,43"."26-02-2004"."17:04"."TEL"."
0480: 0773242200"."00:00:05 min."."0,71"."27-02-2004"."09:22"."TEL"."0
04c0: 773242200"."00:00:33 min."."0,71"."27-02-2004"."13:32"."TEL"."07
0500: 73242200"."00:00:20 min."."0,71"."03-03-2004"."13:29"."TEL"."050
0540: 5019280"."00:00:12 min."."0,71"."03-03-2004"."14:31"."TEL"."0505
0580: 019280"."00:00:55 min."."0,71"."03-03-2004"."14:37"."TEL"."05050
05c0: 19280"."00:00:17 min."."0,71"."03-0
<= Recv data, 100 bytes (0x64)
0000: 3-2004"."15:19"."TEL"."0165518270"."00:00:20 min."."0,71".""."".
0040: ""."Totaal"."00:23:42 min."."23,88".
== Info: Closing connection #0

So Daniel,
Thank you very much for all your support.

I'm a happy man because my wife is happy end therefore her boss is happy.

It gives me so much confidence, that my next move is to try it on a Unix
Host.

Greetings,
Andre van den Berg
Received on 2004-09-02