summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/CMakeLists.txt2
-rw-r--r--tests/FILEFORMAT348
-rw-r--r--tests/Makefile.am75
-rw-r--r--tests/Makefile.in631
-rw-r--r--tests/README160
-rw-r--r--tests/certs/EdelCurlRoot-ca.cacert85
-rw-r--r--tests/certs/EdelCurlRoot-ca.cnf11
-rw-r--r--tests/certs/EdelCurlRoot-ca.crt85
-rw-r--r--tests/certs/EdelCurlRoot-ca.csr17
-rw-r--r--tests/certs/EdelCurlRoot-ca.derbin0 -> 916 bytes
-rw-r--r--tests/certs/EdelCurlRoot-ca.key27
-rw-r--r--tests/certs/EdelCurlRoot-ca.prm18
-rw-r--r--tests/certs/Server-localhost-sv.crl12
-rw-r--r--tests/certs/Server-localhost-sv.crt81
-rw-r--r--tests/certs/Server-localhost-sv.csr11
-rw-r--r--tests/certs/Server-localhost-sv.derbin0 -> 837 bytes
-rw-r--r--tests/certs/Server-localhost-sv.dhp5
-rw-r--r--tests/certs/Server-localhost-sv.key15
-rw-r--r--tests/certs/Server-localhost-sv.p12bin0 -> 2958 bytes
-rw-r--r--tests/certs/Server-localhost-sv.pem126
-rw-r--r--tests/certs/Server-localhost-sv.prm25
-rw-r--r--tests/certs/Server-localhost.nn-sv.crl13
-rw-r--r--tests/certs/Server-localhost.nn-sv.crt81
-rw-r--r--tests/certs/Server-localhost.nn-sv.csr11
-rw-r--r--tests/certs/Server-localhost.nn-sv.derbin0 -> 843 bytes
-rw-r--r--tests/certs/Server-localhost.nn-sv.dhp5
-rw-r--r--tests/certs/Server-localhost.nn-sv.key15
-rw-r--r--tests/certs/Server-localhost.nn-sv.pem126
-rw-r--r--tests/certs/Server-localhost.nn-sv.prm25
-rw-r--r--tests/certs/Server-localhost0h-sv.crl14
-rw-r--r--tests/certs/Server-localhost0h-sv.crt81
-rw-r--r--tests/certs/Server-localhost0h-sv.csr11
-rw-r--r--tests/certs/Server-localhost0h-sv.derbin0 -> 839 bytes
-rw-r--r--tests/certs/Server-localhost0h-sv.dhp5
-rw-r--r--tests/certs/Server-localhost0h-sv.key15
-rw-r--r--tests/certs/Server-localhost0h-sv.p12bin0 -> 2970 bytes
-rw-r--r--tests/certs/Server-localhost0h-sv.pem127
-rw-r--r--tests/certs/Server-localhost0h-sv.prm26
-rwxr-xr-xtests/certs/scripts/genroot.sh66
-rwxr-xr-xtests/certs/scripts/genserv.sh112
-rw-r--r--tests/data/DISABLED5
-rw-r--r--tests/data/Makefile.am92
-rw-r--r--tests/data/Makefile.in495
-rw-r--r--tests/data/test155
-rw-r--r--tests/data/test1067
-rw-r--r--tests/data/test10056
-rw-r--r--tests/data/test100042
-rw-r--r--tests/data/test1001104
-rw-r--r--tests/data/test1002114
-rw-r--r--tests/data/test100348
-rw-r--r--tests/data/test100459
-rw-r--r--tests/data/test100548
-rw-r--r--tests/data/test100649
-rw-r--r--tests/data/test100739
-rw-r--r--tests/data/test1008126
-rw-r--r--tests/data/test100944
-rw-r--r--tests/data/test10158
-rw-r--r--tests/data/test101056
-rw-r--r--tests/data/test101176
-rw-r--r--tests/data/test101279
-rw-r--r--tests/data/test101337
-rw-r--r--tests/data/test101437
-rw-r--r--tests/data/test101553
-rw-r--r--tests/data/test101639
-rw-r--r--tests/data/test101740
-rw-r--r--tests/data/test101839
-rw-r--r--tests/data/test101942
-rw-r--r--tests/data/test10252
-rw-r--r--tests/data/test102042
-rw-r--r--tests/data/test1021139
-rw-r--r--tests/data/test102237
-rw-r--r--tests/data/test102337
-rw-r--r--tests/data/test1024103
-rw-r--r--tests/data/test1025105
-rw-r--r--tests/data/test102639
-rw-r--r--tests/data/test102739
-rw-r--r--tests/data/test102894
-rw-r--r--tests/data/test102958
-rw-r--r--tests/data/test10354
-rw-r--r--tests/data/test1030109
-rw-r--r--tests/data/test103176
-rw-r--r--tests/data/test103256
-rw-r--r--tests/data/test103360
-rw-r--r--tests/data/test103462
-rw-r--r--tests/data/test103559
-rw-r--r--tests/data/test103661
-rw-r--r--tests/data/test103754
-rw-r--r--tests/data/test103853
-rw-r--r--tests/data/test103953
-rw-r--r--tests/data/test10443
-rw-r--r--tests/data/test104079
-rw-r--r--tests/data/test104178
-rw-r--r--tests/data/test104294
-rw-r--r--tests/data/test104384
-rw-r--r--tests/data/test104458
-rw-r--r--tests/data/test104552
-rw-r--r--tests/data/test104660
-rw-r--r--tests/data/test104758
-rw-r--r--tests/data/test104866
-rw-r--r--tests/data/test104944
-rw-r--r--tests/data/test10553
-rw-r--r--tests/data/test105066
-rw-r--r--tests/data/test1051118
-rw-r--r--tests/data/test1052111
-rw-r--r--tests/data/test1053129
-rw-r--r--tests/data/test105480
-rw-r--r--tests/data/test1055100
-rw-r--r--tests/data/test105681
-rw-r--r--tests/data/test105752
-rw-r--r--tests/data/test105853
-rw-r--r--tests/data/test105958
-rw-r--r--tests/data/test10651
-rw-r--r--tests/data/test1060902
-rw-r--r--tests/data/test1061907
-rw-r--r--tests/data/test106249
-rw-r--r--tests/data/test106347
-rw-r--r--tests/data/test106479
-rw-r--r--tests/data/test106578
-rw-r--r--tests/data/test106682
-rw-r--r--tests/data/test106778
-rw-r--r--tests/data/test106857
-rw-r--r--tests/data/test106936
-rw-r--r--tests/data/test10751
-rw-r--r--tests/data/test107065
-rw-r--r--tests/data/test1071113
-rw-r--r--tests/data/test107278
-rw-r--r--tests/data/test107372
-rw-r--r--tests/data/test107476
-rw-r--r--tests/data/test107594
-rw-r--r--tests/data/test107679
-rw-r--r--tests/data/test107775
-rw-r--r--tests/data/test107886
-rw-r--r--tests/data/test107975
-rw-r--r--tests/data/test10856
-rw-r--r--tests/data/test108069
-rw-r--r--tests/data/test108177
-rw-r--r--tests/data/test108255
-rw-r--r--tests/data/test108359
-rw-r--r--tests/data/test108441
-rw-r--r--tests/data/test108548
-rw-r--r--tests/data/test1086109
-rw-r--r--tests/data/test1087110
-rw-r--r--tests/data/test1088112
-rw-r--r--tests/data/test108991
-rw-r--r--tests/data/test10948
-rw-r--r--tests/data/test109098
-rw-r--r--tests/data/test109146
-rw-r--r--tests/data/test109256
-rw-r--r--tests/data/test109344
-rw-r--r--tests/data/test109450
-rw-r--r--tests/data/test109583
-rw-r--r--tests/data/test109650
-rw-r--r--tests/data/test109779
-rw-r--r--tests/data/test109873
-rw-r--r--tests/data/test109945
-rw-r--r--tests/data/test1176
-rw-r--r--tests/data/test11052
-rw-r--r--tests/data/test1100116
-rw-r--r--tests/data/test110154
-rw-r--r--tests/data/test110251
-rw-r--r--tests/data/test110348
-rw-r--r--tests/data/test110485
-rw-r--r--tests/data/test110563
-rw-r--r--tests/data/test110657
-rw-r--r--tests/data/test110753
-rw-r--r--tests/data/test110845
-rw-r--r--tests/data/test110946
-rw-r--r--tests/data/test11145
-rw-r--r--tests/data/test111047
-rw-r--r--tests/data/test111147
-rw-r--r--tests/data/test1112114
-rw-r--r--tests/data/test111398
-rw-r--r--tests/data/test1114136
-rw-r--r--tests/data/test111555
-rw-r--r--tests/data/test111677
-rw-r--r--tests/data/test111787
-rw-r--r--tests/data/test111855
-rw-r--r--tests/data/test111924
-rw-r--r--tests/data/test11249
-rw-r--r--tests/data/test112044
-rw-r--r--tests/data/test11337
-rw-r--r--tests/data/test11438
-rw-r--r--tests/data/test11544
-rw-r--r--tests/data/test11652
-rw-r--r--tests/data/test11744
-rw-r--r--tests/data/test11848
-rw-r--r--tests/data/test11950
-rw-r--r--tests/data/test1256
-rw-r--r--tests/data/test12053
-rw-r--r--tests/data/test120039
-rw-r--r--tests/data/test120139
-rw-r--r--tests/data/test120240
-rw-r--r--tests/data/test120343
-rw-r--r--tests/data/test12151
-rw-r--r--tests/data/test12245
-rw-r--r--tests/data/test12340
-rw-r--r--tests/data/test12447
-rw-r--r--tests/data/test12541
-rw-r--r--tests/data/test12648
-rw-r--r--tests/data/test12746
-rw-r--r--tests/data/test12857
-rw-r--r--tests/data/test12952
-rw-r--r--tests/data/test1344
-rw-r--r--tests/data/test13065
-rw-r--r--tests/data/test13166
-rw-r--r--tests/data/test13265
-rw-r--r--tests/data/test13365
-rw-r--r--tests/data/test13465
-rw-r--r--tests/data/test13554
-rw-r--r--tests/data/test13642
-rw-r--r--tests/data/test13747
-rw-r--r--tests/data/test13849
-rw-r--r--tests/data/test13947
-rw-r--r--tests/data/test1444
-rw-r--r--tests/data/test14042
-rw-r--r--tests/data/test14152
-rw-r--r--tests/data/test142190
-rw-r--r--tests/data/test14344
-rw-r--r--tests/data/test14449
-rw-r--r--tests/data/test14551
-rw-r--r--tests/data/test14655
-rw-r--r--tests/data/test14749
-rw-r--r--tests/data/test14842
-rw-r--r--tests/data/test14947
-rw-r--r--tests/data/test1557
-rw-r--r--tests/data/test15094
-rw-r--r--tests/data/test15141
-rw-r--r--tests/data/test15244
-rw-r--r--tests/data/test153133
-rw-r--r--tests/data/test154108
-rw-r--r--tests/data/test155131
-rw-r--r--tests/data/test15652
-rw-r--r--tests/data/test15739
-rw-r--r--tests/data/test15850
-rw-r--r--tests/data/test15993
-rw-r--r--tests/data/test1652
-rw-r--r--tests/data/test16066
-rw-r--r--tests/data/test16141
-rw-r--r--tests/data/test16260
-rw-r--r--tests/data/test16373
-rw-r--r--tests/data/test16461
-rw-r--r--tests/data/test16558
-rw-r--r--tests/data/test16654
-rw-r--r--tests/data/test16779
-rw-r--r--tests/data/test16899
-rw-r--r--tests/data/test169127
-rw-r--r--tests/data/test1754
-rw-r--r--tests/data/test17051
-rw-r--r--tests/data/test17158
-rw-r--r--tests/data/test17256
-rw-r--r--tests/data/test17380
-rw-r--r--tests/data/test17445
-rw-r--r--tests/data/test17586
-rw-r--r--tests/data/test17679
-rw-r--r--tests/data/test17754
-rw-r--r--tests/data/test17843
-rw-r--r--tests/data/test17957
-rw-r--r--tests/data/test1890
-rw-r--r--tests/data/test18059
-rw-r--r--tests/data/test18160
-rw-r--r--tests/data/test18237
-rw-r--r--tests/data/test18356
-rw-r--r--tests/data/test18475
-rw-r--r--tests/data/test18575
-rw-r--r--tests/data/test18656
-rw-r--r--tests/data/test18777
-rw-r--r--tests/data/test18878
-rw-r--r--tests/data/test18969
-rw-r--r--tests/data/test1937
-rw-r--r--tests/data/test19038
-rw-r--r--tests/data/test19135
-rw-r--r--tests/data/test19252
-rw-r--r--tests/data/test19382
-rw-r--r--tests/data/test19457
-rw-r--r--tests/data/test19532
-rw-r--r--tests/data/test19635
-rw-r--r--tests/data/test19769
-rw-r--r--tests/data/test19864
-rw-r--r--tests/data/test19952
-rw-r--r--tests/data/test253
-rw-r--r--tests/data/test2038
-rw-r--r--tests/data/test20041
-rw-r--r--tests/data/test200073
-rw-r--r--tests/data/test2001109
-rw-r--r--tests/data/test2002125
-rw-r--r--tests/data/test2003162
-rw-r--r--tests/data/test200472
-rw-r--r--tests/data/test20127
-rw-r--r--tests/data/test20231
-rw-r--r--tests/data/test20336
-rw-r--r--tests/data/test20434
-rw-r--r--tests/data/test20531
-rw-r--r--tests/data/test206100
-rw-r--r--tests/data/test20758
-rw-r--r--tests/data/test20875
-rw-r--r--tests/data/test209119
-rw-r--r--tests/data/test2133
-rw-r--r--tests/data/test21046
-rw-r--r--tests/data/test21148
-rw-r--r--tests/data/test21257
-rw-r--r--tests/data/test213122
-rw-r--r--tests/data/test21444
-rw-r--r--tests/data/test21552
-rw-r--r--tests/data/test21639
-rw-r--r--tests/data/test21760
-rw-r--r--tests/data/test21852
-rw-r--r--tests/data/test2246
-rw-r--r--tests/data/test22068
-rw-r--r--tests/data/test22171
-rw-r--r--tests/data/test222199
-rw-r--r--tests/data/test22392
-rw-r--r--tests/data/test224104
-rw-r--r--tests/data/test22528
-rw-r--r--tests/data/test22629
-rw-r--r--tests/data/test22758
-rw-r--r--tests/data/test22852
-rw-r--r--tests/data/test22941
-rw-r--r--tests/data/test2333
-rw-r--r--tests/data/test23132
-rw-r--r--tests/data/test23394
-rw-r--r--tests/data/test23497
-rw-r--r--tests/data/test23542
-rw-r--r--tests/data/test23647
-rw-r--r--tests/data/test23742
-rw-r--r--tests/data/test23841
-rw-r--r--tests/data/test239100
-rw-r--r--tests/data/test2447
-rw-r--r--tests/data/test24058
-rw-r--r--tests/data/test24156
-rw-r--r--tests/data/test24254
-rw-r--r--tests/data/test243129
-rw-r--r--tests/data/test24587
-rw-r--r--tests/data/test24697
-rw-r--r--tests/data/test24741
-rw-r--r--tests/data/test24850
-rw-r--r--tests/data/test24947
-rw-r--r--tests/data/test25116
-rw-r--r--tests/data/test25052
-rw-r--r--tests/data/test25154
-rw-r--r--tests/data/test25259
-rw-r--r--tests/data/test25362
-rw-r--r--tests/data/test25460
-rw-r--r--tests/data/test25563
-rw-r--r--tests/data/test25664
-rw-r--r--tests/data/test257115
-rw-r--r--tests/data/test258134
-rw-r--r--tests/data/test259132
-rw-r--r--tests/data/test2645
-rw-r--r--tests/data/test26055
-rw-r--r--tests/data/test26148
-rw-r--r--tests/data/test262bin0 -> 1137 bytes
-rw-r--r--tests/data/test26354
-rw-r--r--tests/data/test26449
-rw-r--r--tests/data/test265125
-rw-r--r--tests/data/test26678
-rw-r--r--tests/data/test267109
-rw-r--r--tests/data/test26857
-rw-r--r--tests/data/test26953
-rw-r--r--tests/data/test2756
-rw-r--r--tests/data/test27050
-rw-r--r--tests/data/test27143
-rw-r--r--tests/data/test27240
-rw-r--r--tests/data/test27383
-rw-r--r--tests/data/test27452
-rw-r--r--tests/data/test27578
-rw-r--r--tests/data/test27676
-rw-r--r--tests/data/test27759
-rw-r--r--tests/data/test27849
-rw-r--r--tests/data/test27950
-rw-r--r--tests/data/test2875
-rw-r--r--tests/data/test28063
-rw-r--r--tests/data/test28165
-rw-r--r--tests/data/test28245
-rw-r--r--tests/data/test28336
-rw-r--r--tests/data/test28467
-rw-r--r--tests/data/test28544
-rw-r--r--tests/data/test28692
-rw-r--r--tests/data/test28754
-rw-r--r--tests/data/test28842
-rw-r--r--tests/data/test28930
-rw-r--r--tests/data/test2952
-rw-r--r--tests/data/test29043
-rw-r--r--tests/data/test29147
-rw-r--r--tests/data/test29256
-rw-r--r--tests/data/test29360
-rw-r--r--tests/data/test29464
-rw-r--r--tests/data/test29545
-rw-r--r--tests/data/test29648
-rw-r--r--tests/data/test29746
-rw-r--r--tests/data/test29845
-rw-r--r--tests/data/test29953
-rw-r--r--tests/data/test360
-rw-r--r--tests/data/test3043
-rw-r--r--tests/data/test30052
-rw-r--r--tests/data/test30157
-rw-r--r--tests/data/test30240
-rw-r--r--tests/data/test30355
-rw-r--r--tests/data/test30472
-rw-r--r--tests/data/test30535
-rw-r--r--tests/data/test30665
-rw-r--r--tests/data/test30756
-rw-r--r--tests/data/test30834
-rw-r--r--tests/data/test30986
-rw-r--r--tests/data/test3178
-rw-r--r--tests/data/test31057
-rw-r--r--tests/data/test31143
-rw-r--r--tests/data/test31243
-rw-r--r--tests/data/test31339
-rw-r--r--tests/data/test3256
-rw-r--r--tests/data/test3364
-rw-r--r--tests/data/test3466
-rw-r--r--tests/data/test35bin0 -> 810 bytes
-rw-r--r--tests/data/test35057
-rw-r--r--tests/data/test35156
-rw-r--r--tests/data/test35257
-rw-r--r--tests/data/test35356
-rw-r--r--tests/data/test35450
-rw-r--r--tests/data/test3666
-rw-r--r--tests/data/test3747
-rw-r--r--tests/data/test3861
-rw-r--r--tests/data/test3991
-rw-r--r--tests/data/test451
-rw-r--r--tests/data/test4074
-rw-r--r--tests/data/test40061
-rw-r--r--tests/data/test40156
-rw-r--r--tests/data/test40235
-rw-r--r--tests/data/test40364
-rw-r--r--tests/data/test40431
-rw-r--r--tests/data/test40534
-rw-r--r--tests/data/test40666
-rw-r--r--tests/data/test40759
-rw-r--r--tests/data/test40861
-rw-r--r--tests/data/test40956
-rw-r--r--tests/data/test4132
-rw-r--r--tests/data/test4274
-rw-r--r--tests/data/test4379
-rw-r--r--tests/data/test4472
-rw-r--r--tests/data/test4576
-rw-r--r--tests/data/test4689
-rw-r--r--tests/data/test4749
-rw-r--r--tests/data/test4847
-rw-r--r--tests/data/test4974
-rw-r--r--tests/data/test550
-rw-r--r--tests/data/test5074
-rw-r--r--tests/data/test50058
-rw-r--r--tests/data/test50140
-rw-r--r--tests/data/test50247
-rw-r--r--tests/data/test50376
-rw-r--r--tests/data/test50443
-rw-r--r--tests/data/test50560
-rw-r--r--tests/data/test506181
-rw-r--r--tests/data/test50737
-rw-r--r--tests/data/test50851
-rw-r--r--tests/data/test5174
-rw-r--r--tests/data/test51057
-rw-r--r--tests/data/test51144
-rw-r--r--tests/data/test51246
-rw-r--r--tests/data/test51342
-rw-r--r--tests/data/test51451
-rw-r--r--tests/data/test51548
-rw-r--r--tests/data/test51647
-rw-r--r--tests/data/test517117
-rw-r--r--tests/data/test51860
-rw-r--r--tests/data/test51971
-rw-r--r--tests/data/test5274
-rw-r--r--tests/data/test52047
-rw-r--r--tests/data/test52160
-rw-r--r--tests/data/test52260
-rw-r--r--tests/data/test52364
-rw-r--r--tests/data/test52446
-rw-r--r--tests/data/test52559
-rw-r--r--tests/data/test52663
-rw-r--r--tests/data/test52763
-rw-r--r--tests/data/test52865
-rw-r--r--tests/data/test52959
-rw-r--r--tests/data/test5354
-rw-r--r--tests/data/test53083
-rw-r--r--tests/data/test53159
-rw-r--r--tests/data/test53263
-rw-r--r--tests/data/test53355
-rw-r--r--tests/data/test53453
-rw-r--r--tests/data/test53569
-rw-r--r--tests/data/test53665
-rw-r--r--tests/data/test53757
-rw-r--r--tests/data/test53846
-rw-r--r--tests/data/test53963
-rw-r--r--tests/data/test5445
-rw-r--r--tests/data/test54096
-rw-r--r--tests/data/test54151
-rw-r--r--tests/data/test54257
-rw-r--r--tests/data/test54335
-rw-r--r--tests/data/test54449
-rw-r--r--tests/data/test545bin0 -> 748 bytes
-rw-r--r--tests/data/test54670
-rw-r--r--tests/data/test547133
-rw-r--r--tests/data/test548133
-rw-r--r--tests/data/test54965
-rw-r--r--tests/data/test5566
-rw-r--r--tests/data/test55065
-rw-r--r--tests/data/test55198
-rw-r--r--tests/data/test552bin0 -> 143212 bytes
-rw-r--r--tests/data/test55367
-rw-r--r--tests/data/test55468
-rw-r--r--tests/data/test555142
-rw-r--r--tests/data/test55650
-rw-r--r--tests/data/test55739
-rw-r--r--tests/data/test55844
-rw-r--r--tests/data/test55944
-rw-r--r--tests/data/test5661
-rw-r--r--tests/data/test56056
-rw-r--r--tests/data/test56166
-rw-r--r--tests/data/test56253
-rw-r--r--tests/data/test56357
-rw-r--r--tests/data/test56466
-rw-r--r--tests/data/test565105
-rw-r--r--tests/data/test56657
-rw-r--r--tests/data/test56750
-rw-r--r--tests/data/test568117
-rw-r--r--tests/data/test569110
-rw-r--r--tests/data/test5748
-rw-r--r--tests/data/test57077
-rw-r--r--tests/data/test571108
-rw-r--r--tests/data/test572121
-rw-r--r--tests/data/test57356
-rw-r--r--tests/data/test57498
-rw-r--r--tests/data/test575121
-rw-r--r--tests/data/test576192
-rw-r--r--tests/data/test57743
-rw-r--r--tests/data/test57852
-rw-r--r--tests/data/test57985
-rw-r--r--tests/data/test5851
-rw-r--r--tests/data/test5947
-rw-r--r--tests/data/test649
-rw-r--r--tests/data/test6057
-rw-r--r--tests/data/test60042
-rw-r--r--tests/data/test60142
-rw-r--r--tests/data/test60243
-rw-r--r--tests/data/test60343
-rw-r--r--tests/data/test60430
-rw-r--r--tests/data/test60533
-rw-r--r--tests/data/test60633
-rw-r--r--tests/data/test60733
-rw-r--r--tests/data/test60849
-rw-r--r--tests/data/test60945
-rw-r--r--tests/data/test6171
-rw-r--r--tests/data/test61047
-rw-r--r--tests/data/test61147
-rw-r--r--tests/data/test61247
-rw-r--r--tests/data/test61348
-rw-r--r--tests/data/test61449
-rw-r--r--tests/data/test61544
-rw-r--r--tests/data/test61639
-rw-r--r--tests/data/test61739
-rw-r--r--tests/data/test61839
-rw-r--r--tests/data/test61939
-rw-r--r--tests/data/test6260
-rw-r--r--tests/data/test62038
-rw-r--r--tests/data/test62138
-rw-r--r--tests/data/test62243
-rw-r--r--tests/data/test62341
-rw-r--r--tests/data/test62447
-rw-r--r--tests/data/test62547
-rw-r--r--tests/data/test62642
-rw-r--r--tests/data/test62746
-rw-r--r--tests/data/test62833
-rw-r--r--tests/data/test62933
-rw-r--r--tests/data/test6352
-rw-r--r--tests/data/test63034
-rw-r--r--tests/data/test63134
-rw-r--r--tests/data/test63234
-rw-r--r--tests/data/test63342
-rw-r--r--tests/data/test63443
-rw-r--r--tests/data/test63542
-rw-r--r--tests/data/test63643
-rw-r--r--tests/data/test63744
-rw-r--r--tests/data/test6483
-rw-r--r--tests/data/test6583
-rw-r--r--tests/data/test6641
-rw-r--r--tests/data/test67100
-rw-r--r--tests/data/test6899
-rw-r--r--tests/data/test69121
-rw-r--r--tests/data/test762
-rw-r--r--tests/data/test7087
-rw-r--r--tests/data/test70057
-rw-r--r--tests/data/test70157
-rw-r--r--tests/data/test70239
-rw-r--r--tests/data/test70339
-rw-r--r--tests/data/test70436
-rw-r--r--tests/data/test70536
-rw-r--r--tests/data/test70659
-rw-r--r--tests/data/test70759
-rw-r--r--tests/data/test7179
-rw-r--r--tests/data/test7286
-rw-r--r--tests/data/test7355
-rw-r--r--tests/data/test7474
-rw-r--r--tests/data/test7549
-rw-r--r--tests/data/test7639
-rw-r--r--tests/data/test7755
-rw-r--r--tests/data/test7867
-rw-r--r--tests/data/test7955
-rw-r--r--tests/data/test863
-rw-r--r--tests/data/test8076
-rw-r--r--tests/data/test80047
-rw-r--r--tests/data/test80147
-rw-r--r--tests/data/test80253
-rw-r--r--tests/data/test80364
-rw-r--r--tests/data/test80459
-rw-r--r--tests/data/test80554
-rw-r--r--tests/data/test80655
-rw-r--r--tests/data/test80759
-rw-r--r--tests/data/test81101
-rw-r--r--tests/data/test8256
-rw-r--r--tests/data/test8372
-rw-r--r--tests/data/test8454
-rw-r--r--tests/data/test8558
-rw-r--r--tests/data/test8696
-rw-r--r--tests/data/test8736
-rw-r--r--tests/data/test88101
-rw-r--r--tests/data/test89145
-rw-r--r--tests/data/test973
-rw-r--r--tests/data/test90191
-rw-r--r--tests/data/test91122
-rw-r--r--tests/data/test9255
-rw-r--r--tests/data/test9350
-rw-r--r--tests/data/test9458
-rw-r--r--tests/data/test9574
-rw-r--r--tests/data/test9752
-rw-r--r--tests/data/test9855
-rw-r--r--tests/data/test9969
-rw-r--r--tests/directories.pm266
-rw-r--r--tests/ftp.pm254
-rwxr-xr-xtests/ftpserver.pl1574
-rw-r--r--tests/getpart.pm224
-rwxr-xr-xtests/httpserver.pl118
-rw-r--r--tests/libtest/Makefile.am83
-rw-r--r--tests/libtest/Makefile.in1720
-rw-r--r--tests/libtest/Makefile.inc166
-rw-r--r--tests/libtest/chkhostname.c26
-rw-r--r--tests/libtest/first.c98
-rw-r--r--tests/libtest/lib500.c53
-rw-r--r--tests/libtest/lib501.c43
-rw-r--r--tests/libtest/lib502.c94
-rw-r--r--tests/libtest/lib503.c152
-rw-r--r--tests/libtest/lib504.c161
-rw-r--r--tests/libtest/lib505.c151
-rw-r--r--tests/libtest/lib506.c268
-rw-r--r--tests/libtest/lib507.c141
-rw-r--r--tests/libtest/lib508.c95
-rw-r--r--tests/libtest/lib510.c118
-rw-r--r--tests/libtest/lib511.c43
-rw-r--r--tests/libtest/lib512.c65
-rw-r--r--tests/libtest/lib513.c70
-rw-r--r--tests/libtest/lib514.c66
-rw-r--r--tests/libtest/lib515.c47
-rw-r--r--tests/libtest/lib516.c46
-rw-r--r--tests/libtest/lib517.c116
-rw-r--r--tests/libtest/lib518.c509
-rw-r--r--tests/libtest/lib519.c50
-rw-r--r--tests/libtest/lib520.c42
-rw-r--r--tests/libtest/lib521.c44
-rw-r--r--tests/libtest/lib523.c45
-rw-r--r--tests/libtest/lib524.c43
-rw-r--r--tests/libtest/lib525.c211
-rw-r--r--tests/libtest/lib526.c236
-rw-r--r--tests/libtest/lib530.c211
-rw-r--r--tests/libtest/lib533.c166
-rw-r--r--tests/libtest/lib536.c140
-rw-r--r--tests/libtest/lib537.c512
-rw-r--r--tests/libtest/lib539.c80
-rw-r--r--tests/libtest/lib540.c178
-rw-r--r--tests/libtest/lib541.c118
-rw-r--r--tests/libtest/lib542.c73
-rw-r--r--tests/libtest/lib543.c42
-rw-r--r--tests/libtest/lib544.c66
-rw-r--r--tests/libtest/lib547.c116
-rw-r--r--tests/libtest/lib549.c52
-rw-r--r--tests/libtest/lib552.c205
-rw-r--r--tests/libtest/lib553.c100
-rw-r--r--tests/libtest/lib554.c150
-rw-r--r--tests/libtest/lib555.c157
-rw-r--r--tests/libtest/lib556.c91
-rw-r--r--tests/libtest/lib557.c1388
-rw-r--r--tests/libtest/lib558.c188
-rw-r--r--tests/libtest/lib560.c105
-rw-r--r--tests/libtest/lib562.c74
-rw-r--r--tests/libtest/lib564.c143
-rw-r--r--tests/libtest/lib566.c55
-rw-r--r--tests/libtest/lib567.c56
-rw-r--r--tests/libtest/lib568.c163
-rw-r--r--tests/libtest/lib569.c117
-rw-r--r--tests/libtest/lib570.c105
-rw-r--r--tests/libtest/lib571.c200
-rw-r--r--tests/libtest/lib572.c169
-rw-r--r--tests/libtest/lib573.c102
-rw-r--r--tests/libtest/lib574.c56
-rw-r--r--tests/libtest/lib575.c109
-rw-r--r--tests/libtest/lib576.c111
-rw-r--r--tests/libtest/lib577.c255
-rw-r--r--tests/libtest/lib578.c90
-rw-r--r--tests/libtest/lib579.c149
-rw-r--r--tests/libtest/sethostname.c29
-rw-r--r--tests/libtest/sethostname.h32
-rw-r--r--tests/libtest/test.h59
-rwxr-xr-xtests/libtest/test1013.pl49
-rwxr-xr-xtests/libtest/test1022.pl45
-rwxr-xr-xtests/libtest/test307.pl19
-rwxr-xr-xtests/libtest/test610.pl33
-rwxr-xr-xtests/libtest/test613.pl105
-rwxr-xr-xtests/libtest/test75.pl13
-rw-r--r--tests/libtest/testutil.c135
-rw-r--r--tests/libtest/testutil.h49
-rwxr-xr-xtests/memanalyze.pl356
-rwxr-xr-xtests/rtspserver.pl108
-rw-r--r--tests/runtests.1107
-rw-r--r--tests/runtests.html87
-rw-r--r--tests/runtests.pdfbin0 -> 7204 bytes
-rwxr-xr-xtests/runtests.pl4138
-rwxr-xr-xtests/runtests.pl.orig4138
-rwxr-xr-xtests/secureserver.pl298
-rw-r--r--tests/server/Makefile.am57
-rw-r--r--tests/server/Makefile.in1696
-rw-r--r--tests/server/Makefile.inc65
-rw-r--r--tests/server/getpart.c422
-rw-r--r--tests/server/getpart.h33
-rw-r--r--tests/server/resolve.c164
-rw-r--r--tests/server/rtspd.c1469
-rw-r--r--tests/server/server_sockaddr.h33
-rw-r--r--tests/server/sockfilt.c1042
-rw-r--r--tests/server/sws.c1456
-rw-r--r--tests/server/testpart.c54
-rw-r--r--tests/server/tftp.h57
-rw-r--r--tests/server/tftpd.c1300
-rw-r--r--tests/server/util.c283
-rw-r--r--tests/server/util.h64
-rw-r--r--tests/serverhelp.pm237
-rw-r--r--tests/sshhelp.pm388
-rwxr-xr-xtests/sshserver.pl1042
-rw-r--r--tests/stunnel.pem142
-rw-r--r--tests/symbol-scan.pl162
-rw-r--r--tests/testcurl.1124
-rw-r--r--tests/testcurl.html113
-rw-r--r--tests/testcurl.pdfbin0 -> 7203 bytes
-rwxr-xr-xtests/testcurl.pl741
-rwxr-xr-xtests/tftpserver.pl109
-rw-r--r--tests/valgrind.pm110
745 files changed, 75979 insertions, 0 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
new file mode 100644
index 000000000..04ab06ed6
--- /dev/null
+++ b/tests/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_subdirectory(libtest)
+add_subdirectory(server)
diff --git a/tests/FILEFORMAT b/tests/FILEFORMAT
new file mode 100644
index 000000000..6a61dd000
--- /dev/null
+++ b/tests/FILEFORMAT
@@ -0,0 +1,348 @@
+ The test suite's file format is very simple and extensible, closely
+resembling XML. All data for a single test case resides in a single
+ASCII file. Labels mark the beginning and the end of all sections, and each
+label must be written in its own line. Comments are either XML-style
+(enclosed with <!-- and -->) or C-style (beginning with #) and must appear
+on their own lines and not alongside actual test data. Most test data files
+are syntactically valid XML, although a few files are not (lack of
+support for character entities and the preservation of CR/LF characters at
+the end of lines are the biggest differences).
+
+ The file begins with a 'testcase' tag, which encompasses the remainder of
+the file.
+
+<testcase>
+
+ Each file is split up in three main sections: reply, client and verify. The
+reply section is used for the server to know what to send as a reply for the
+requests curl sends, the client section defines how the client should behave
+while the verify section defines how to verify that the data stored after a
+command has been run ended up correctly.
+
+ Each main section has a number of available subsections that can be
+specified, that will be checked/used if specified. This document includes all
+the subsections currently supported.
+
+Main sections are 'info', 'reply', 'client' and 'verify'.
+
+<info>
+<keywords>
+A newline-separated list of keywords describing what this test case uses and
+tests. Try to use an already used keyword. These keywords will be used for
+statistical/informational purposes and for choosing or skipping classes
+of tests. "Keywords" must begin with an alphabetic character, "-", "["
+or "{" and may actually consist of multiple words separated by spaces
+which are treated together as a single identifier.
+</keywords>
+</info>
+
+<reply>
+<data [nocheck="yes"] [sendzero="yes"] [base64="yes"]>
+data to be sent to the client on its request and later verified that it arrived
+safely. Set nocheck="yes" to prevent the test script from verifying the arrival
+of this data.
+
+If the data contains 'swsclose' anywhere within the start and end tag, and
+this is a HTTP test, then the connection will be closed by the server after
+this response is sent. If not, the connection will be kept persistent.
+
+If the data contains 'swsbounce' anywhere within the start and end tag, the
+HTTP server will detect if this is a second request using the same test and
+part number and will then increase the part number with one. This is useful
+for auth tests and similar.
+
+'sendzero' set to yes means that the (FTP) server will "send" the data even if
+the size is zero bytes. Used to verify curl's behaviour on zero bytes
+transfers.
+
+'base64' set to yes means that the data provided in the test-file is a chunk
+of data encoded with base64. It is the only way a test case can contain binary
+data. (This attribute can in fact be used on any section, but it doesn't make
+much sense for other sections than "data").
+</data>
+<dataNUM>
+Send back this contents instead of the <data> one. The num is set by:
+A) The test number in the request line is >10000 and this is the remainder
+of [test case number]%10000.
+B) The request was HTTP and included digest details, which adds 1000 to NUM
+C) If a HTTP request is NTLM type-1, it adds 1001 to num
+D) If a HTTP request is NTLM type-3, it adds 1002 to num
+E) If a HTTP request is Basic and num is already >=1000, it adds 1 to num
+
+Dynamically changing num in this way allows the test harness to be used to
+test authentication negotiation where several different requests must be sent
+to complete a transfer. The response to each request is found in its own data
+section. Validating the entire negotiation sequence can be done by
+specifying a datacheck section.
+</dataNUM>
+<datacheck [nonewline="yes"]>
+if the data is sent but this is what should be checked afterwards. If
+'nonewline' is set, we will cut off the trailing newline of this given data
+before comparing with the one actually received by the client
+</datacheck>
+<size>
+number to return on a ftp SIZE command (set to -1 to make this command fail)
+</size>
+<mdtm>
+what to send back if the client sends a (FTP) MDTM command, set to -1 to
+have it return that the file doesn't exist
+</mdtm>
+<postcmd>
+special purpose server-command to control its behavior *after* the
+reply is sent
+For HTTP/HTTPS, these are supported:
+
+wait [secs]
+ - Pause for the given time
+</postcmd>
+<servercmd>
+Special-commands for the server.
+For FTP, these are supported:
+
+REPLY [command] [return value] [response string]
+ - Changes how the server responds to the [command]. [response string] is
+ evaluated as a perl string, so it can contain embedded \r\n, for example.
+COUNT [command] [num]
+ - Do the REPLY change for [command] only [num] times and then go back to the
+ built-in approach
+DELAY [command] [secs]
+ - Delay responding to this command for the given time
+RETRWEIRDO
+ - Enable the "weirdo" RETR case when multiple response lines appear at once
+ when a file is transfered
+RETRNOSIZE
+ - Make sure the RETR response doesn't contain the size of the file
+NOSAVE
+ - Don't actually save what is received
+SLOWDOWN
+ - Send FTP responses with 0.01 sec delay between each byte
+PASVBADIP
+ - makes PASV send back an illegal IP in its 227 response
+
+For HTTP/HTTPS:
+auth_required if this is set and a POST/PUT is made without auth, the
+ server will NOT wait for the full request body to get sent
+idle do nothing after receiving the request, just "sit idle"
+stream continuously send data to the client, never-ending
+writedelay: [secs] delay this amount between reply packets
+pipe: [num] tell the server to expect this many HTTP requests before
+ sending back anything, to allow pipelining tests
+skip: [num] instructs the server to ignore reading this many bytes from a PUT
+ or POST request
+
+rtp: part [num] channel [num] size [num]
+ stream a fake RTP packet for the given part on a chosen channel
+ with the given payload size
+</servercmd>
+</reply>
+
+<client>
+
+<server>
+What server(s) this test case requires/uses:
+
+file
+ftp
+ftp-ipv6
+ftps
+http
+http-ipv6
+https
+none
+scp
+sftp
+socks4
+socks5
+rtsp
+rtsp-ipv6
+imap
+pop3
+smtp
+
+Give only one per line. This subsection is mandatory.
+</server>
+
+<features>
+A list of features that MUST be present in the client/library for this test to
+be able to run (if these features are not present, the test will be
+SKIPPED). Features testable here are:
+
+crypto
+getrlimit
+GnuTLS
+idn
+ipv6
+large_file
+libz
+netrc_debug
+NSS
+NTLM
+OpenSSL
+SSL
+socks
+
+as well as each protocol that curl supports. A protocol only needs to be
+specified if it is different from the server (useful when the server
+is 'none').
+</features>
+
+<killserver>
+Using the same syntax as in <server> but when mentioned here these servers
+are explicitly KILLED when this test case is completed. Only use this if there
+is no other alternatives. Using this of course requires subsequent tests to
+restart servers.
+</killserver>
+
+<precheck>
+A command line that if set gets run by the test script before the test. If an
+output is displayed by the command or if the return code is non-zero, the test
+will be skipped and the (single-line) output will be displayed as reason for
+not running the test. Variables are substituted as in the <command> section.
+</precheck>
+
+<postcheck>
+A command line that if set gets run by the test script after the test. If
+the command exists with a non-zero status code, the test will be considered
+to have failed. Variables are substituted as in the <command> section.
+</postcheck>
+
+<tool>
+Name of tool to use instead of "curl". This tool must be built and exist
+in the libtest/ directory.
+</tool>
+
+<name>
+test case description
+</name>
+
+<setenv>
+variable1=contents1
+variable2=contents2
+
+Set the given environment variables to the specified value before the actual
+command is run. They are cleared again after the command has been run.
+Variables are first substituted as in the <command> section.
+</setenv>
+
+<command [option="no-output"] [timeout="secs"] [delay="secs"] [type="perl"]>
+command line to run, there's a bunch of %variables that get replaced
+accordingly.
+
+Note that the URL that gets passed to the server actually controls what data
+that is returned. The last slash in the URL must be followed by a number. That
+number (N) will be used by the test-server to load test case N and return the
+data that is defined within the <reply><data></data></reply> section.
+
+If a CONNECT is used to the server (to emulate HTTPS etc over proxy), the port
+number given in the CONNECT request will be used to identify which test that
+is being run, if the proxy host name is said to start with 'test'.
+
+Set type="perl" to write the test case as a perl script. It implies that
+there's no memory debugging and valgrind gets shut off for this test.
+
+Set option="no-output" to prevent the test script to slap on the --output
+argument that directs the output to a file. The --output is also not added if
+the verify/stdout section is used.
+
+Set timeout="secs" to override default server logs advisor read lock timeout.
+This timeout is used by the test harness, once that the command has completed
+execution, to wait for the test server to write out server side log files and
+remove the lock that advised not to read them. The "secs" parameter is the not
+negative integer number of seconds for the timeout. This 'timeout' attribute
+is documented for completeness sake, but is deep test harness stuff and only
+needed for very singular and specific test cases. Avoid using it.
+
+Set delay="secs" to introduce a time delay once that the command has completed
+execution and before the <postcheck> section runs. The "secs" parameter is the
+not negative integer number of seconds for the delay. This 'delay' attribute
+is intended for very specific test cases, and normally not needed.
+
+Available substitute variables include:
+%CLIENTIP - IPv4 address of the client running curl
+%CLIENT6IP - IPv6 address of the client running curl
+%HOSTIP - IPv4 address of the host running this test
+%HOSTPORT - Port number of the HTTP server
+%HOST6IP - IPv6 address of the host running this test
+%HOST6PORT - IPv6 port number of the HTTP server
+%HTTPSPORT - Port number of the HTTPS server
+%FTPPORT - Port number of the FTP server
+%FTP6PORT - IPv6 port number of the FTP server
+%FTPSPORT - Port number of the FTPS server
+%FTP2PORT - Port number of the FTP server 2
+%FTPTIME2 - Timeout in seconds that should be just sufficient to receive
+ a response from the test FTP server
+%TFTPPORT - Port number of the TFTP server
+%TFTP6PORT - IPv6 port number of the TFTP server
+%SSHPORT - Port number of the SCP/SFTP server
+%SOCKSPORT - Port number of the SOCKS4/5 server
+%RTSPPORT - Port number of the RTSP server
+%RTSP6PORT - IPv6 port number of the RTSP server
+%SRCDIR - Full path to the source dir
+%PWD - Current directory
+%CURL - Path to the curl executable
+%USER - Login ID of the user running the test
+</command>
+
+<file name="log/filename">
+This creates the named file with this content before the test case is run,
+which is useful if the test case needs a file to act on.
+Variables are substituted on the contents of the file as in the <command>
+section.
+</file>
+
+<stdin>
+Pass this given data on stdin to the tool.
+</stdin>
+
+</client>
+
+<verify>
+<errorcode>
+numerical error code curl is supposed to return. Specify a list of accepted
+error codes by separating multiple numbers with comma. See test 237 for an
+example.
+</errorcode>
+<strip>
+One regex per line that is removed from the protocol dumps before the
+comparison is made. This is very useful to remove dependencies on dynamically
+changing protocol data such as port numbers or user-agent strings.
+</strip>
+<strippart>
+One perl op per line that operates on the protocol dump. This is pretty
+advanced. Example: "s/^EPRT .*/EPRT stripped/"
+</strippart>
+<protocol [nonewline="yes"]>
+the protocol dump curl should transmit, if 'nonewline' is set, we will cut
+off the trailing newline of this given data before comparing with the one
+actually sent by the client
+Variables are substituted as in the <command> section.
+</protocol>
+<stdout [mode="text"] [nonewline="yes"]>
+This verifies that this data was passed to stdout. Variables are
+substituted as in the <command> section.
+
+Use the mode="text" attribute if the output is in text mode on platforms that
+have a text/binary difference.
+
+If 'nonewline' is set, we will cut off the trailing newline of this given data
+before comparing with the one actually received by the client
+</stdout>
+<file name="log/filename" [mode="text"]>
+The file's contents must be identical to this after the test is complete.
+Use the mode="text" attribute if the output is in text mode on platforms that
+have a text/binary difference.
+Variables are substituted as in the <command> section.
+</file>
+<stripfile>
+One perl op per line that operates on the file before being compared. This is
+pretty advanced. Example: "s/^EPRT .*/EPRT stripped/"
+</stripfile>
+<upload>
+the contents of the upload data curl should have sent
+</upload>
+<valgrind>
+disable - disables the valgrind log check for this test
+</valgrind>
+</verify>
+
+</testcase>
diff --git a/tests/Makefile.am b/tests/Makefile.am
new file mode 100644
index 000000000..78450b100
--- /dev/null
+++ b/tests/Makefile.am
@@ -0,0 +1,75 @@
+#***************************************************************************
+# _ _ ____ _
+# Project ___| | | | _ \| |
+# / __| | | | |_) | |
+# | (__| |_| | _ <| |___
+# \___|\___/|_| \_\_____|
+#
+# Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+#
+# This software is licensed as described in the file COPYING, which
+# you should have received as part of this distribution. The terms
+# are also available at http://curl.haxx.se/docs/copyright.html.
+#
+# You may opt to use, copy, modify, merge, publish, distribute and/or sell
+# copies of the Software, and permit persons to whom the Software is
+# furnished to do so, under the terms of the COPYING file.
+#
+# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+# KIND, either express or implied.
+#
+###########################################################################
+
+HTMLPAGES = testcurl.html runtests.html
+PDFPAGES = testcurl.pdf runtests.pdf
+
+EXTRA_DIST = ftpserver.pl httpserver.pl secureserver.pl runtests.pl getpart.pm \
+ FILEFORMAT README stunnel.pem memanalyze.pl testcurl.pl valgrind.pm ftp.pm \
+ sshserver.pl sshhelp.pm testcurl.1 runtests.1 $(HTMLPAGES) $(PDFPAGES) \
+ CMakeLists.txt certs/scripts/*.sh certs/Server* certs/EdelCurlRoot* \
+ serverhelp.pm tftpserver.pl rtspserver.pl directories.pm symbol-scan.pl
+
+SUBDIRS = data server libtest
+
+PERLFLAGS = -I$(srcdir)
+
+CLEANFILES = .http.pid .https.pid .ftp.pid .ftps.pid
+
+MAN2HTML= roffit < $< >$@
+
+curl:
+ @cd $(top_builddir) && $(MAKE)
+
+if CROSSCOMPILING
+TEST = @echo "NOTICE: we can't run the tests when cross-compiling!"
+TEST_Q =
+TEST_F =
+TEST_T =
+else # if not cross-compiling:
+TEST = srcdir=$(srcdir) $(PERL) $(PERLFLAGS) $(srcdir)/runtests.pl
+TEST_Q = -a -s
+TEST_F = -a -p -r
+TEST_T = -a -t
+endif
+
+test: all
+ $(TEST)
+
+quiet-test: all
+ $(TEST) $(TEST_Q)
+
+full-test: all
+ $(TEST) $(TEST_F)
+
+torture-test: all
+ $(TEST) $(TEST_T)
+
+.1.html:
+ $(MAN2HTML)
+
+.1.pdf:
+ @(foo=`echo $@ | sed -e 's/\.[0-9]$$//g'`; \
+ groff -Tps -man $< >$$foo.ps; \
+ ps2pdf $$foo.ps $@; \
+ rm $$foo.ps; \
+ echo "converted $< to $@")
diff --git a/tests/Makefile.in b/tests/Makefile.in
new file mode 100644
index 000000000..b37dd4175
--- /dev/null
+++ b/tests/Makefile.in
@@ -0,0 +1,631 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+#***************************************************************************
+# _ _ ____ _
+# Project ___| | | | _ \| |
+# / __| | | | |_) | |
+# | (__| |_| | _ <| |___
+# \___|\___/|_| \_\_____|
+#
+# Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+#
+# This software is licensed as described in the file COPYING, which
+# you should have received as part of this distribution. The terms
+# are also available at http://curl.haxx.se/docs/copyright.html.
+#
+# You may opt to use, copy, modify, merge, publish, distribute and/or sell
+# copies of the Software, and permit persons to whom the Software is
+# furnished to do so, under the terms of the COPYING file.
+#
+# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+# KIND, either express or implied.
+#
+###########################################################################
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = tests
+DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/curl-compilers.m4 \
+ $(top_srcdir)/m4/curl-confopts.m4 \
+ $(top_srcdir)/m4/curl-functions.m4 \
+ $(top_srcdir)/m4/curl-override.m4 \
+ $(top_srcdir)/m4/curl-reentrant.m4 \
+ $(top_srcdir)/m4/curl-system.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/lib/curl_config.h \
+ $(top_builddir)/src/curl_config.h \
+ $(top_builddir)/include/curl/curlbuild.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-exec-recursive install-info-recursive \
+ install-recursive installcheck-recursive installdirs-recursive \
+ pdf-recursive ps-recursive uninstall-info-recursive \
+ uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_LIBHOSTNAME_FALSE = @BUILD_LIBHOSTNAME_FALSE@
+BUILD_LIBHOSTNAME_TRUE = @BUILD_LIBHOSTNAME_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONFIGURE_OPTIONS = @CONFIGURE_OPTIONS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CROSSCOMPILING_FALSE = @CROSSCOMPILING_FALSE@
+CROSSCOMPILING_TRUE = @CROSSCOMPILING_TRUE@
+CURLDEBUG_FALSE = @CURLDEBUG_FALSE@
+CURLDEBUG_TRUE = @CURLDEBUG_TRUE@
+CURL_CA_BUNDLE = @CURL_CA_BUNDLE@
+CURL_CFLAG_EXTRAS = @CURL_CFLAG_EXTRAS@
+CURL_DISABLE_DICT = @CURL_DISABLE_DICT@
+CURL_DISABLE_FILE = @CURL_DISABLE_FILE@
+CURL_DISABLE_FTP = @CURL_DISABLE_FTP@
+CURL_DISABLE_GOPHER = @CURL_DISABLE_GOPHER@
+CURL_DISABLE_HTTP = @CURL_DISABLE_HTTP@
+CURL_DISABLE_IMAP = @CURL_DISABLE_IMAP@
+CURL_DISABLE_LDAP = @CURL_DISABLE_LDAP@
+CURL_DISABLE_LDAPS = @CURL_DISABLE_LDAPS@
+CURL_DISABLE_POP3 = @CURL_DISABLE_POP3@
+CURL_DISABLE_PROXY = @CURL_DISABLE_PROXY@
+CURL_DISABLE_RTSP = @CURL_DISABLE_RTSP@
+CURL_DISABLE_SMTP = @CURL_DISABLE_SMTP@
+CURL_DISABLE_TELNET = @CURL_DISABLE_TELNET@
+CURL_DISABLE_TFTP = @CURL_DISABLE_TFTP@
+CURL_LIBS = @CURL_LIBS@
+CURL_NETWORK_LIBS = @CURL_NETWORK_LIBS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_SHARED = @ENABLE_SHARED@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+HAVE_LDAP_SSL = @HAVE_LDAP_SSL@
+HAVE_LIBZ = @HAVE_LIBZ@
+HAVE_LIBZ_FALSE = @HAVE_LIBZ_FALSE@
+HAVE_LIBZ_TRUE = @HAVE_LIBZ_TRUE@
+HAVE_PK11_CREATEGENERICOBJECT = @HAVE_PK11_CREATEGENERICOBJECT@
+IDN_ENABLED = @IDN_ENABLED@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+IPV6_ENABLED = @IPV6_ENABLED@
+KRB4_ENABLED = @KRB4_ENABLED@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBCURL_LIBS = @LIBCURL_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+MANOPT = @MANOPT@
+MIMPURE_FALSE = @MIMPURE_FALSE@
+MIMPURE_TRUE = @MIMPURE_TRUE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NO_UNDEFINED_FALSE = @NO_UNDEFINED_FALSE@
+NO_UNDEFINED_TRUE = @NO_UNDEFINED_TRUE@
+NROFF = @NROFF@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH = @PATH@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+PKGADD_NAME = @PKGADD_NAME@
+PKGADD_PKG = @PKGADD_PKG@
+PKGADD_VENDOR = @PKGADD_VENDOR@
+PKGCONFIG = @PKGCONFIG@
+RANDOM_FILE = @RANDOM_FILE@
+RANLIB = @RANLIB@
+REQUIRE_LIB_DEPS = @REQUIRE_LIB_DEPS@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SONAME_BUMP_FALSE = @SONAME_BUMP_FALSE@
+SONAME_BUMP_TRUE = @SONAME_BUMP_TRUE@
+SSL_ENABLED = @SSL_ENABLED@
+STATICLIB_FALSE = @STATICLIB_FALSE@
+STATICLIB_TRUE = @STATICLIB_TRUE@
+STRIP = @STRIP@
+SUPPORT_FEATURES = @SUPPORT_FEATURES@
+SUPPORT_PROTOCOLS = @SUPPORT_PROTOCOLS@
+TEST_SERVER_LIBS = @TEST_SERVER_LIBS@
+USE_ARES = @USE_ARES@
+USE_EMBEDDED_ARES_FALSE = @USE_EMBEDDED_ARES_FALSE@
+USE_EMBEDDED_ARES_TRUE = @USE_EMBEDDED_ARES_TRUE@
+USE_GNUTLS = @USE_GNUTLS@
+USE_LIBRTMP = @USE_LIBRTMP@
+USE_LIBSSH2 = @USE_LIBSSH2@
+USE_MANUAL_FALSE = @USE_MANUAL_FALSE@
+USE_MANUAL_TRUE = @USE_MANUAL_TRUE@
+USE_NSS = @USE_NSS@
+USE_OPENLDAP = @USE_OPENLDAP@
+USE_POLARSSL = @USE_POLARSSL@
+USE_SSLEAY = @USE_SSLEAY@
+USE_WINDOWS_SSPI = @USE_WINDOWS_SSPI@
+VERSION = @VERSION@
+VERSIONNUM = @VERSIONNUM@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+libext = @libext@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+subdirs = @subdirs@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+HTMLPAGES = testcurl.html runtests.html
+PDFPAGES = testcurl.pdf runtests.pdf
+EXTRA_DIST = ftpserver.pl httpserver.pl secureserver.pl runtests.pl getpart.pm \
+ FILEFORMAT README stunnel.pem memanalyze.pl testcurl.pl valgrind.pm ftp.pm \
+ sshserver.pl sshhelp.pm testcurl.1 runtests.1 $(HTMLPAGES) $(PDFPAGES) \
+ CMakeLists.txt certs/scripts/*.sh certs/Server* certs/EdelCurlRoot* \
+ serverhelp.pm tftpserver.pl rtspserver.pl directories.pm symbol-scan.pl
+
+SUBDIRS = data server libtest
+PERLFLAGS = -I$(srcdir)
+CLEANFILES = .http.pid .https.pid .ftp.pid .ftps.pid
+MAN2HTML = roffit < $< >$@
+@CROSSCOMPILING_FALSE@TEST = srcdir=$(srcdir) $(PERL) $(PERLFLAGS) $(srcdir)/runtests.pl
+@CROSSCOMPILING_TRUE@TEST = @echo "NOTICE: we can't run the tests when cross-compiling!"
+@CROSSCOMPILING_FALSE@TEST_Q = -a -s
+@CROSSCOMPILING_TRUE@TEST_Q =
+@CROSSCOMPILING_FALSE@TEST_F = -a -p -r
+@CROSSCOMPILING_TRUE@TEST_F =
+@CROSSCOMPILING_FALSE@TEST_T = -a -t
+@CROSSCOMPILING_TRUE@TEST_T =
+all: all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .1 .html .pdf
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu tests/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ $(mkdir_p) $(distdir)/certs $(distdir)/certs/scripts
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(mkdir_p) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+ distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+ clean clean-generic clean-libtool clean-recursive ctags \
+ ctags-recursive distclean distclean-generic distclean-libtool \
+ distclean-recursive distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-exec install-exec-am install-info \
+ install-info-am install-man install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic maintainer-clean-recursive \
+ mostlyclean mostlyclean-generic mostlyclean-libtool \
+ mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+ uninstall uninstall-am uninstall-info-am
+
+
+curl:
+ @cd $(top_builddir) && $(MAKE)
+
+test: all
+ $(TEST)
+
+quiet-test: all
+ $(TEST) $(TEST_Q)
+
+full-test: all
+ $(TEST) $(TEST_F)
+
+torture-test: all
+ $(TEST) $(TEST_T)
+
+.1.html:
+ $(MAN2HTML)
+
+.1.pdf:
+ @(foo=`echo $@ | sed -e 's/\.[0-9]$$//g'`; \
+ groff -Tps -man $< >$$foo.ps; \
+ ps2pdf $$foo.ps $@; \
+ rm $$foo.ps; \
+ echo "converted $< to $@")
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/tests/README b/tests/README
new file mode 100644
index 000000000..be22778cd
--- /dev/null
+++ b/tests/README
@@ -0,0 +1,160 @@
+ _ _ ____ _
+ ___| | | | _ \| |
+ / __| | | | |_) | |
+ | (__| |_| | _ <| |___
+ \___|\___/|_| \_\_____|
+
+The cURL Test Suite
+
+Requires:
+ perl (and a unix-style shell)
+ diff (when a test fails, a diff is shown)
+ stunnel (for HTTPS and FTPS tests)
+ OpenSSH or SunSSH (for SCP, SFTP and SOCKS4/5 tests)
+
+Ports used by default:
+
+ - TCP/8990 for HTTP
+ - TCP/8991 for HTTPS
+ - TCP/8992 for FTP
+ - TCP/8993 for FTPS
+ - TCP/8994 for HTTP IPv6
+ - TCP/8995 for FTP (2)
+ - TCP/8996 for FTP IPv6
+ - UDP/8997 for TFTP
+ - UDP/8998 for TFTP IPv6
+ - TCP/8999 for SCP/SFTP
+ - TCP/9000 for SOCKS
+ - TCP/9001 for POP3
+ - TCP/9002 for IMAP
+ - TCP/9003 for SMTP
+
+ The test suite runs simple FTP, POP3, IMAP, SMTP, HTTP and TFTP stand-alone
+ servers on these ports to which it makes requests. For SSL tests, it runs
+ stunnel to handle encryption to the regular servers. For SSH, it runs a
+ standard OpenSSH server. For SOCKS4/5 tests SSH is used to perform the SOCKS
+ functionality and requires a SSH client and server.
+
+ The base port number shown above can be changed using runtests' -b option
+ to allow running more than one instance of the test suite simultaneously
+ on one machine.
+
+Run:
+ 'make test'. This builds the test suite support code and invokes the
+ 'runtests.pl' perl script to run all the tests. Edit the top variables
+ of that script in case you have some specific needs, or run the script
+ manually (after the support code has been built).
+
+ The script breaks on the first test that doesn't do OK. Use -a to prevent
+ the script from abort on the first error. Run the script with -v for more
+ verbose output. Use -d to run the test servers with debug output enabled as
+ well. Specifying -k keeps all the log files generated by the test intact.
+
+ Use -s for shorter output, or pass test numbers to run specific tests only
+ (like "./runtests.pl 3 4" to test 3 and 4 only). It also supports test case
+ ranges with 'to', as in "./runtests 3 to 9" which runs the seven tests from
+ 3 to 9. Any test numbers starting with ! are disabled, as are any test
+ numbers found in the file data/DISABLED (one per line).
+
+Shell startup scripts:
+ Tests which use the ssh test server, SCP/SFTP/SOCKS tests, might be badly
+ influenced by the output of system wide or user specific shell startup
+ scripts, .bashrc, .profile, /etc/csh.cshrc, .login, /etc/bashrc, etc. which
+ output text messages or escape sequences on user login. When these shell
+ startup messages or escape sequences are output they might corrupt the
+ expected stream of data which flows to the sftp-server or from the ssh
+ client which can result in bad test behaviour or even prevent the test
+ server from running.
+
+ If the test suite ssh or sftp server fails to start up and logs the message
+ 'Received message too long' then you are certainly suffering the unwanted
+ output of a shell startup script. Locate, cleanup or adjust the shell
+ script.
+
+Memory:
+ The test script will check that all allocated memory is freed properly IF
+ curl has been built with the CURLDEBUG define set. The script will
+ automatically detect if that is the case, and it will use the ../memanalyze
+ script to analyze the memory debugging output.
+
+ The -t option will enable torture testing mode, which runs each test
+ many times but causes a different memory allocation to fail on each
+ successive run. This tests the out of memory error handling code to
+ ensure that memory leaks do not occur even in those situations.
+
+Debug:
+ If a test case fails, you can conveniently get the script to invoke the
+ debugger (gdb) for you with the server running and the exact same command
+ line parameters that failed. Just invoke 'runtests.pl <test number> -g' and
+ then just type 'run' in the debugger to perform the command through the
+ debugger.
+
+ If a test case causes a core dump, analyze it by running gdb like:
+
+ # gdb ../curl/src core
+
+ ... and get a stack trace with the gdb command:
+
+ (gdb) where
+
+Logs:
+ All logs are generated in the logs/ subdirectory (it is emptied first
+ in the runtests.pl script). Use runtests.pl -k to keep the temporary files
+ after the test run.
+
+Data:
+ All test cases are put in the data/ subdirectory. Each test is stored in the
+ file named according to the test number.
+
+ See FILEFORMAT for the description of the test case files.
+
+Code coverage:
+ gcc provides a tool that can determine the code coverage figures for
+ the test suite. To use it, configure curl with
+ CFLAGS='-fprofile-arcs -ftest-coverage -g -O0'. Make sure you run the normal
+ and torture tests to get more full coverage, i.e. do:
+
+ make test
+ make test-torture
+
+ The graphical tool ggcov can be used to browse the source and create
+ coverage reports on *NIX hosts:
+
+ ggcov -r lib src
+
+ The text mode tool gcov may also be used, but it doesn't handle object files
+ in more than one directory very well.
+
+Remote testing:
+ The runtests.pl script provides some hooks to allow curl to be tested on a
+ machine where perl can not be run. The test framework in this case runs on
+ a workstation where perl is available, while curl itself is run on a remote
+ system using ssh or some other remote execution method. See the comments at
+ the beginning of runtests.pl for details.
+
+TEST CASE NUMBERS
+
+ So far, we've used this system:
+
+ 1 - 99 HTTP
+ 100 - 199 FTP*
+ 200 - 299 FILE*
+ 300 - 399 HTTPS
+ 400 - 499 FTPS
+ 500 - 599 libcurl source code tests, not using the curl command tool
+ 600 - 699 SCP/SFTP
+ 700 - 799 SOCKS4 (even numbers) and SOCK5 (odd numbers)
+ 800 - 899 POP3, IMAP, SMTP
+ 1000 - 1999 miscellaneous*
+ 2000 - x multiple sequential protocols per test case*
+
+ Since 30-apr-2003, there's nothing in the system that requires us to keep
+ within these number series, and those sections marked with * actually
+ contain tests for a variety of protocols. Each test case now specifies
+ its own server requirements, independent of test number.
+
+TODO:
+
+ * Add tests for TELNET, LDAP, DICT...
+ * SOCKS4/5 test deficiencies - no proxy authentication tests as SSH (the
+ test mechanism) doesn't support them
diff --git a/tests/certs/EdelCurlRoot-ca.cacert b/tests/certs/EdelCurlRoot-ca.cacert
new file mode 100644
index 000000000..8bcbc180b
--- /dev/null
+++ b/tests/certs/EdelCurlRoot-ca.cacert
@@ -0,0 +1,85 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number:
+ 0b:98:94:f5:ab:a6
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer:
+ countryName = NN
+ organizationName = Edel Curl Arctic Illudium Research Cloud
+ commonName = Nothern Nowhere Trust Anchor
+ Validity
+ Not Before: May 27 21:36:46 2010 GMT
+ Not After : Oct 30 21:36:46 2026 GMT
+ Subject:
+ countryName = NN
+ organizationName = Edel Curl Arctic Illudium Research Cloud
+ commonName = Nothern Nowhere Trust Anchor
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ Public-Key: (2048 bit)
+ Modulus:
+ 00:c1:a9:0a:ef:76:06:7d:fe:78:3a:f1:0e:40:6d:
+ c2:5b:ae:8f:8d:7f:f0:d5:89:9e:42:2a:f0:17:94:
+ d9:2e:67:c7:2d:01:1c:95:a3:b1:a6:86:d4:12:3c:
+ 47:3a:70:e6:7b:1f:11:06:d3:73:ae:df:ca:24:19:
+ 03:e4:62:0a:eb:67:d4:dc:ef:9d:2d:e0:82:77:fe:
+ 2a:30:5a:fb:57:e5:b8:4f:36:52:4c:2f:57:ad:12:
+ 6a:94:3e:e4:48:a7:ad:a5:c0:3a:d0:4e:00:99:88:
+ 8f:bd:4a:70:be:3b:5b:6b:ff:5e:6f:29:6d:0c:a7:
+ 55:4a:e2:43:e7:49:0f:99:54:59:68:81:34:d8:a9:
+ fb:c8:0d:14:5a:40:cb:70:1e:f5:3b:c0:42:39:06:
+ f9:63:ad:d9:29:14:53:af:42:10:1d:18:95:b6:15:
+ 8a:d8:41:d8:37:31:0a:97:5a:1b:10:90:ac:1d:ff:
+ 6e:71:33:6b:7e:88:18:20:ed:be:35:ff:e7:69:48:
+ 05:c0:78:2e:04:46:f4:c2:8d:4d:70:6e:42:fa:93:
+ eb:ce:12:3b:d1:f5:ce:3f:29:5c:8c:bd:59:83:e4:
+ a1:c1:3c:8e:3e:38:55:f3:99:18:b0:df:f6:74:c9:
+ 8e:28:f4:38:0d:45:20:d6:db:c0:73:a2:e6:8c:6e:
+ 98:9f
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Basic Constraints: critical
+ CA:TRUE
+ X509v3 Key Usage: critical
+ Certificate Sign, CRL Sign
+ X509v3 Subject Key Identifier:
+ AD:3E:E2:39:07:B8:5C:AA:26:90:94:4C:26:69:21:83:E2:4E:36:94
+ Signature Algorithm: sha1WithRSAEncryption
+ 86:1f:9d:dd:45:11:c8:6b:f1:97:1a:f0:25:b2:0c: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vdWQx
+JTAjBgNVBAMMHE5vdGhlcm4gTm93aGVyZSBUcnVzdCBBbmNob3IwggEiMA0GCSqG
+SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDBqQrvdgZ9/ng68Q5AbcJbro+Nf/DViZ5C
+KvAXlNkuZ8ctARyVo7GmhtQSPEc6cOZ7HxEG03Ou38okGQPkYgrrZ9Tc750t4IJ3
+/iowWvtX5bhPNlJML1etEmqUPuRIp62lwDrQTgCZiI+9SnC+O1tr/15vKW0Mp1VK
+4kPnSQ+ZVFlogTTYqfvIDRRaQMtwHvU7wEI5BvljrdkpFFOvQhAdGJW2FYrYQdg3
+MQqXWhsQkKwd/25xM2t+iBgg7b41/+dpSAXAeC4ERvTCjU1wbkL6k+vOEjvR9c4/
+KVyMvVmD5KHBPI4+OFXzmRiw3/Z0yY4o9DgNRSDW28BzouaMbpifAgMBAAGjQjBA
+MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBStPuI5
+B7hcqiaQlEwmaSGD4k42lDANBgkqhkiG9w0BAQUFAAOCAQEAhh+d3UURyGvxlxrw
+JbIM9x9YxGqlVgcyyy16jK5HHn3nc2w7lh51tOWJBad+tlJWWuJrOOQYPGRvvr3T
+AXa0g396HpzLQBua3UPLmtuK+HZQq62Ff886b0viJ7CMqQrg2EUABV4pq6CKeOUJ
+iUiKDUJJHq3ChS8pna8uyO+53HQz6+lF6aKzALp2C3RZyaiWTPPNmzRaSoeyalJ0
+W77zgfgy0B/JzJ+Kautu820sVCCG9odiwO1VA52XqVquOaB+5KaV6SYZkeYPthj3
+SWynzv3BBML5JydMWem/evZloNmgcaZUxm+aXSMZV0lZLAaRPiibwW/yLZokpwva
+zczzvA==
+-----END CERTIFICATE-----
diff --git a/tests/certs/EdelCurlRoot-ca.cnf b/tests/certs/EdelCurlRoot-ca.cnf
new file mode 100644
index 000000000..ba998817e
--- /dev/null
+++ b/tests/certs/EdelCurlRoot-ca.cnf
@@ -0,0 +1,11 @@
+[ ca ]
+default_ca = EdelCurlRoot
+
+[ EdelCurlRoot ]
+database = EdelCurlRoot-ca.db
+certificate = EdelCurlRoot-ca.crt
+private_key = EdelCurlRoot-ca.key
+crlnumber = EdelCurlRoot-ca.cnt
+default_md = sha1
+default_days = 365
+default_crl_days = 30
diff --git a/tests/certs/EdelCurlRoot-ca.crt b/tests/certs/EdelCurlRoot-ca.crt
new file mode 100644
index 000000000..8bcbc180b
--- /dev/null
+++ b/tests/certs/EdelCurlRoot-ca.crt
@@ -0,0 +1,85 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number:
+ 0b:98:94:f5:ab:a6
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer:
+ countryName = NN
+ organizationName = Edel Curl Arctic Illudium Research Cloud
+ commonName = Nothern Nowhere Trust Anchor
+ Validity
+ Not Before: May 27 21:36:46 2010 GMT
+ Not After : Oct 30 21:36:46 2026 GMT
+ Subject:
+ countryName = NN
+ organizationName = Edel Curl Arctic Illudium Research Cloud
+ commonName = Nothern Nowhere Trust Anchor
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ Public-Key: (2048 bit)
+ Modulus:
+ 00:c1:a9:0a:ef:76:06:7d:fe:78:3a:f1:0e:40:6d:
+ c2:5b:ae:8f:8d:7f:f0:d5:89:9e:42:2a:f0:17:94:
+ d9:2e:67:c7:2d:01:1c:95:a3:b1:a6:86:d4:12:3c:
+ 47:3a:70:e6:7b:1f:11:06:d3:73:ae:df:ca:24:19:
+ 03:e4:62:0a:eb:67:d4:dc:ef:9d:2d:e0:82:77:fe:
+ 2a:30:5a:fb:57:e5:b8:4f:36:52:4c:2f:57:ad:12:
+ 6a:94:3e:e4:48:a7:ad:a5:c0:3a:d0:4e:00:99:88:
+ 8f:bd:4a:70:be:3b:5b:6b:ff:5e:6f:29:6d:0c:a7:
+ 55:4a:e2:43:e7:49:0f:99:54:59:68:81:34:d8:a9:
+ fb:c8:0d:14:5a:40:cb:70:1e:f5:3b:c0:42:39:06:
+ f9:63:ad:d9:29:14:53:af:42:10:1d:18:95:b6:15:
+ 8a:d8:41:d8:37:31:0a:97:5a:1b:10:90:ac:1d:ff:
+ 6e:71:33:6b:7e:88:18:20:ed:be:35:ff:e7:69:48:
+ 05:c0:78:2e:04:46:f4:c2:8d:4d:70:6e:42:fa:93:
+ eb:ce:12:3b:d1:f5:ce:3f:29:5c:8c:bd:59:83:e4:
+ a1:c1:3c:8e:3e:38:55:f3:99:18:b0:df:f6:74:c9:
+ 8e:28:f4:38:0d:45:20:d6:db:c0:73:a2:e6:8c:6e:
+ 98:9f
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Basic Constraints: critical
+ CA:TRUE
+ X509v3 Key Usage: critical
+ Certificate Sign, CRL Sign
+ X509v3 Subject Key Identifier:
+ AD:3E:E2:39:07:B8:5C:AA:26:90:94:4C:26:69:21:83:E2:4E:36:94
+ Signature Algorithm: sha1WithRSAEncryption
+ 86:1f:9d:dd:45:11:c8:6b:f1:97:1a:f0:25:b2:0c:f7:1f:58:
+ c4:6a:a5:56:07:32:cb:2d:7a:8c:ae:47:1e:7d:e7:73:6c:3b:
+ 96:1e:75:b4:e5:89:05:a7:7e:b6:52:56:5a:e2:6b:38:e4:18:
+ 3c:64:6f:be:bd:d3:01:76:b4:83:7f:7a:1e:9c:cb:40:1b:9a:
+ dd:43:cb:9a:db:8a:f8:76:50:ab:ad:85:7f:cf:3a:6f:4b:e2:
+ 27:b0:8c:a9:0a:e0:d8:45:00:05:5e:29:ab:a0:8a:78:e5:09:
+ 89:48:8a:0d:42:49:1e:ad:c2:85:2f:29:9d:af:2e:c8:ef:b9:
+ dc:74:33:eb:e9:45:e9:a2:b3:00:ba:76:0b:74:59:c9:a8:96:
+ 4c:f3:cd:9b:34:5a:4a:87:b2:6a:52:74:5b:be:f3:81:f8:32:
+ d0:1f:c9:cc:9f:8a:6a:eb:6e:f3:6d:2c:54:20:86:f6:87:62:
+ c0:ed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MBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBStPuI5
+B7hcqiaQlEwmaSGD4k42lDANBgkqhkiG9w0BAQUFAAOCAQEAhh+d3UURyGvxlxrw
+JbIM9x9YxGqlVgcyyy16jK5HHn3nc2w7lh51tOWJBad+tlJWWuJrOOQYPGRvvr3T
+AXa0g396HpzLQBua3UPLmtuK+HZQq62Ff886b0viJ7CMqQrg2EUABV4pq6CKeOUJ
+iUiKDUJJHq3ChS8pna8uyO+53HQz6+lF6aKzALp2C3RZyaiWTPPNmzRaSoeyalJ0
+W77zgfgy0B/JzJ+Kautu820sVCCG9odiwO1VA52XqVquOaB+5KaV6SYZkeYPthj3
+SWynzv3BBML5JydMWem/evZloNmgcaZUxm+aXSMZV0lZLAaRPiibwW/yLZokpwva
+zczzvA==
+-----END CERTIFICATE-----
diff --git a/tests/certs/EdelCurlRoot-ca.csr b/tests/certs/EdelCurlRoot-ca.csr
new file mode 100644
index 000000000..2df94f575
--- /dev/null
+++ b/tests/certs/EdelCurlRoot-ca.csr
@@ -0,0 +1,17 @@
+-----BEGIN CERTIFICATE REQUEST-----
+MIICrDCCAZQCAQAwZzELMAkGA1UEBhMCTk4xMTAvBgNVBAoMKEVkZWwgQ3VybCBB
+cmN0aWMgSWxsdWRpdW0gUmVzZWFyY2ggQ2xvdWQxJTAjBgNVBAMMHE5vdGhlcm4g
+Tm93aGVyZSBUcnVzdCBBbmNob3IwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK
+AoIBAQDBqQrvdgZ9/ng68Q5AbcJbro+Nf/DViZ5CKvAXlNkuZ8ctARyVo7GmhtQS
+PEc6cOZ7HxEG03Ou38okGQPkYgrrZ9Tc750t4IJ3/iowWvtX5bhPNlJML1etEmqU
+PuRIp62lwDrQTgCZiI+9SnC+O1tr/15vKW0Mp1VK4kPnSQ+ZVFlogTTYqfvIDRRa
+QMtwHvU7wEI5BvljrdkpFFOvQhAdGJW2FYrYQdg3MQqXWhsQkKwd/25xM2t+iBgg
+7b41/+dpSAXAeC4ERvTCjU1wbkL6k+vOEjvR9c4/KVyMvVmD5KHBPI4+OFXzmRiw
+3/Z0yY4o9DgNRSDW28BzouaMbpifAgMBAAGgADANBgkqhkiG9w0BAQsFAAOCAQEA
+eFMy55kFke/e9mrGloRUh1o8dxmzSiVwVCw5DTZQzTFNAMSOZXIId8k2IeHSUd84
+ZyJ1UNyJn2EFcwgaYaMtvZ8xMWR2W0C7lBvOOcjvWmiGze9F2Z5XMQzL8cjkK4jW
+RKIq9b0W6TC8lLO5F2eJpW6BoTQ8cBCDiVIDlCm7xZxPRjHowuyM0Tpewq2PltC1
+p8DbQipZWl5LPaHBSZSmIuUgOBU9porH/Vn0oWXxYfts59103VJY5YKkdz0PiqqA
+5kWYCMFDZyL+nZ2aIol4r8nXkN9MuPOU12aHqPGcDlaGS2i5zfm2Ywsg110k+NCk
+AmqhjnrQjvJhif3rGO4+qw==
+-----END CERTIFICATE REQUEST-----
diff --git a/tests/certs/EdelCurlRoot-ca.der b/tests/certs/EdelCurlRoot-ca.der
new file mode 100644
index 000000000..1eaf42453
--- /dev/null
+++ b/tests/certs/EdelCurlRoot-ca.der
Binary files differ
diff --git a/tests/certs/EdelCurlRoot-ca.key b/tests/certs/EdelCurlRoot-ca.key
new file mode 100644
index 000000000..9a1303af8
--- /dev/null
+++ b/tests/certs/EdelCurlRoot-ca.key
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEowIBAAKCAQEAwakK73YGff54OvEOQG3CW66PjX/w1YmeQirwF5TZLmfHLQEc
+laOxpobUEjxHOnDmex8RBtNzrt/KJBkD5GIK62fU3O+dLeCCd/4qMFr7V+W4TzZS
+TC9XrRJqlD7kSKetpcA60E4AmYiPvUpwvjtba/9ebyltDKdVSuJD50kPmVRZaIE0
+2Kn7yA0UWkDLcB71O8BCOQb5Y63ZKRRTr0IQHRiVthWK2EHYNzEKl1obEJCsHf9u
+cTNrfogYIO2+Nf/naUgFwH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ZQReyx7gJxsSD75rh4GSYRXW/RrpJAkcjlrU1PdH9Nyz2be8Y
+vYgr1IGjx0gkfrmvs24yxF75ySOBqTCTmfLJpIJZPuBLCAzvWtiIrvtNSx1U82MT
+nVfBHQKBgDJZQmr5lqdo5Zv/VP+w+VtxeX2oCgw7Mn56TW4IzDEL6ly+sKNNs+Ji
+pp/c2XYw24o7318yV70oWVWscay1SOjK7RdoCat590iuTGMSYyY8pMkgK+QuDqDe
+1Hhyb0iPorMS5wZXx/TROS4+4GOIHLAtZOZ8B+20tczp7HGqUIK1
+-----END RSA PRIVATE KEY-----
diff --git a/tests/certs/EdelCurlRoot-ca.prm b/tests/certs/EdelCurlRoot-ca.prm
new file mode 100644
index 000000000..4c53ef515
--- /dev/null
+++ b/tests/certs/EdelCurlRoot-ca.prm
@@ -0,0 +1,18 @@
+extensions = x509v3
+[ req ]
+default_bits = 2048
+distinguished_name = req_DN
+default_md = sha256
+string_mask = utf8only
+[ req_DN ]
+countryName = "Country Name"
+countryName_value = NN
+organizationName = "Organization Name"
+organizationName_value = Edel Curl Arctic Illudium Research Cloud
+commonName = "Common Name"
+commonName_value = Nothern Nowhere Trust Anchor
+[ x509v3 ]
+basicConstraints = critical,CA:true
+keyUsage = critical,keyCertSign,cRLSign
+subjectKeyIdentifier = hash
+
diff --git a/tests/certs/Server-localhost-sv.crl b/tests/certs/Server-localhost-sv.crl
new file mode 100644
index 000000000..804655d00
--- /dev/null
+++ b/tests/certs/Server-localhost-sv.crl
@@ -0,0 +1,12 @@
+-----BEGIN X509 CRL-----
+MIIB2zCBxAIBATANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJOTjExMC8GA1UE
+CgwoRWRlbCBDdXJsIEFyY3RpYyBJbGx1ZGl1bSBSZXNlYXJjaCBDbG91ZDElMCMG
+A1UEAwwcTm90aGVybiBOb3doZXJlIFRydXN0IEFuY2hvchcNMTAwNTI3MjEzNzEx
+WhcNMTAwNjI2MjEzNzExWjAZMBcCBguYlPl8ahcNMTAwNTI3MjEzNzExWqAOMAww
+CgYDVR0UBAMCAQEwDQYJKoZIhvcNAQEFBQADggEBAFuPZJ/cNNCeAzkSxVvPPPRX
+Wsv9T6Dt61C5Fmq9eSNN2kRf7/dq5A5nqTIlHbXXiLdj3UqNhUHXe2oA1UpbdHz9
+0JlfwWm1Y/gMr1fh1n0oFebEtCuOgDRpd07Uiz8AqOUBykDNDUlMvVwR9raHL8hj
+NRwzugsfIxl0CvLLqrBpUWMxW3qemk4cWW39yrDdZgKo6eOZAOR3FQYlLIrw6Jcr
+Kmm0PjdcJIfRgJvNysgyx1dIIKe7QXvFTR/QzdHWIWTkiYIW7wUKSzSICvDCr094
+eo3nr3n9BtOqT61Z1m6FGCP6Mm0wFl6xLTCNd6ygfFo7pcAdWlUsdBgKzics0Kc=
+-----END X509 CRL-----
diff --git a/tests/certs/Server-localhost-sv.crt b/tests/certs/Server-localhost-sv.crt
new file mode 100644
index 000000000..9a3d94498
--- /dev/null
+++ b/tests/certs/Server-localhost-sv.crt
@@ -0,0 +1,81 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number:
+ 0b:98:94:f9:7c:6a
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer:
+ countryName = NN
+ organizationName = Edel Curl Arctic Illudium Research Cloud
+ commonName = Nothern Nowhere Trust Anchor
+ Validity
+ Not Before: May 27 21:37:11 2010 GMT
+ Not After : Aug 13 21:37:11 2018 GMT
+ Subject:
+ countryName = NN
+ organizationName = Edel Curl Arctic Illudium Research Cloud
+ commonName = localhost
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ Public-Key: (1024 bit)
+ Modulus:
+ 00:b0:27:79:26:2c:b9:e4:d1:81:0a:09:d2:76:fe:
+ 9a:e1:05:68:01:b3:72:77:97:38:e4:60:1c:71:9d:
+ 99:f7:26:7b:21:b5:6d:aa:9f:14:76:07:6c:a4:2a:
+ 2d:7d:ee:f6:6f:8a:58:c4:93:de:fe:a1:25:0f:ff:
+ 57:49:c0:d9:94:d9:07:79:bf:8c:6d:fa:f1:18:82:
+ 67:a0:3f:d7:31:03:82:ec:b9:39:69:07:ec:ec:93:
+ 17:5b:1a:72:91:93:b2:6b:98:66:63:fe:61:29:e7:
+ ad:86:0e:04:ba:bf:8b:55:57:61:a5:4a:f6:ca:e7:
+ c6:d1:b8:65:42:ab:67:64:17
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Subject Alternative Name:
+ DNS:localhost
+ X509v3 Key Usage:
+ Key Encipherment
+ X509v3 Extended Key Usage:
+ TLS Web Server Authentication
+ X509v3 Subject Key Identifier:
+ BC:69:86:84:70:3A:AD:DE:08:2A:70:C6:3B:47:8C:11:3F:E0:9A:6D
+ X509v3 Authority Key Identifier:
+ keyid:AD:3E:E2:39:07:B8:5C:AA:26:90:94:4C:26:69:21:83:E2:4E:36:94
+
+ X509v3 Basic Constraints: critical
+ CA:FALSE
+ Signature Algorithm: sha1WithRSAEncryption
+ 7b:f0:b0:a0:d9:d0:91:38:9b:fe:cf:78:c8:d6:30:5d:87:9d:
+ b3:b9:6e:8b:5a:73:74:93:cb:30:49:d1:00:79:9d:5a:c2:71:
+ a3:93:5f:de:d3:5a:0c:fb:6d:41:83:89:1b:4f:0d:1c:65:0c:
+ 1a:0c:0f:96:79:62:90:e1:74:04:dd:c6:d8:cf:0f:5f:0f:28:
+ 87:d7:86:56:90:b4:d0:88:80:f1:a7:cd:fd:0b:13:58:bb:6d:
+ e6:ab:44:f6:9b:d6:cc:c7:db:3d:3a:90:c4:20:72:f4:38:38:
+ c0:ef:80:1d:60:3f:4e:30:40:11:56:29:70:aa:17:91:90:5f:
+ 70:0b:89:51:af:17:a8:ed:20:4e:76:bb:cf:a8:88:9a:25:0f:
+ 3a:96:26:17:50:2a:af:f3:8b:21:9c:cf:ff:f9:20:fc:fe:c0:
+ 37:95:c7:cd:0d:7a:53:d9:26:12:38:2c:f6:03:95:1b:da:d0:
+ 08:f7:32:91:07:a7:35:0c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Z1awnGjk1/e01oM
++21Bg4kbTw0cZQwaDA+WeWKQ4XQE3cbYzw9fDyiH14ZWkLTQiIDxp839CxNYu23m
+q0T2m9bMx9s9OpDEIHL0ODjA74AdYD9OMEARVilwqheRkF9wC4lRrxeo7SBOdrvP
+qIiaJQ86liYXUCqv84shnM//+SD8/sA3lcfNDXpT2SYSOCz2A5Ub2tAI9zKRB6c1
+DBQARMdD+yMuFETm7qnJIDcJuK4hT0u3hk3jQYQVThopAAOokpk8depDD+Mr9xex
+G4eABNOnc7FehTh9iQEWGfbE4Rt1
+-----END CERTIFICATE-----
diff --git a/tests/certs/Server-localhost-sv.csr b/tests/certs/Server-localhost-sv.csr
new file mode 100644
index 000000000..a8773f556
--- /dev/null
+++ b/tests/certs/Server-localhost-sv.csr
@@ -0,0 +1,11 @@
+-----BEGIN CERTIFICATE REQUEST-----
+MIIBkzCB/QIBADBUMQswCQYDVQQGEwJOTjExMC8GA1UECgwoRWRlbCBDdXJsIEFy
+Y3RpYyBJbGx1ZGl1bSBSZXNlYXJjaCBDbG91ZDESMBAGA1UEAwwJbG9jYWxob3N0
+MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwJ3kmLLnk0YEKCdJ2/prhBWgB
+s3J3lzjkYBxxnZn3JnshtW2qnxR2B2ykKi197vZviljEk97+oSUP/1dJwNmU2Qd5
+v4xt+vEYgmegP9cxA4LsuTlpB+zskxdbGnKRk7JrmGZj/mEp562GDgS6v4tVV2Gl
+SvbK58bRuGVCq2dkFwIDAQABoAAwDQYJKoZIhvcNAQELBQADgYEAlIivGkhU8iph
+eZQAaiwakIwPx1TPA3+Dl4tbStTr3Ludd8rjZMGPRXKU+wjvfhCmDlyk90yOun2C
+lPIT8W/ibXNgRF1vz+eFofjM0hZtNPOX4G18wwD5y0OTr7obyqJPKAZsJZh6L3YE
+aARr27RCoFv92hFwVr181wAU+bVCekA=
+-----END CERTIFICATE REQUEST-----
diff --git a/tests/certs/Server-localhost-sv.der b/tests/certs/Server-localhost-sv.der
new file mode 100644
index 000000000..766cf539c
--- /dev/null
+++ b/tests/certs/Server-localhost-sv.der
Binary files differ
diff --git a/tests/certs/Server-localhost-sv.dhp b/tests/certs/Server-localhost-sv.dhp
new file mode 100644
index 000000000..b61c28b8c
--- /dev/null
+++ b/tests/certs/Server-localhost-sv.dhp
@@ -0,0 +1,5 @@
+-----BEGIN DH PARAMETERS-----
+MIGHAoGBAP5mA7oYimErFUulbvNC8V0HwyB62NCj6TZb6YXJwElCksQc8RyHnkrY
+9Wx2+lduFqHjUWalgVF7Gma7CfR/pt+fiU6Jn2vWR2v7KT6hYeRKsJrONJlth+NK
+V7/d4zyvleJ/VSp0TuuSxmMMQ6hG3i5YhSGXyCh4h0pl4Wu/hdVTAgEC
+-----END DH PARAMETERS-----
diff --git a/tests/certs/Server-localhost-sv.key b/tests/certs/Server-localhost-sv.key
new file mode 100644
index 000000000..8ade26aab
--- /dev/null
+++ b/tests/certs/Server-localhost-sv.key
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXQIBAAKBgQCwJ3kmLLnk0YEKCdJ2/prhBWgBs3J3lzjkYBxxnZn3JnshtW2q
+nxR2B2ykKi197vZviljEk97+oSUP/1dJwNmU2Qd5v4xt+vEYgmegP9cxA4LsuTlp
+B+zskxdbGnKRk7JrmGZj/mEp562GDgS6v4tVV2GlSvbK58bRuGVCq2dkFwIDAQAB
+AoGBAKa0JHWZHC9MiSa71t5f4qiTGjOJ5AkDJocR4bkv4dZAJ4TmEqvGsnFkY08U
+z0p/i95Q+eLG4eDtFYsHJU8Z343odktK99BUJzkDzqWT9RMzJ5Ykx6LbldJyW5NN
+IwvhDuW3rq8fbCMr+NGe9chc1Rg2lrfeEJDwjki/drBQs7zpAkEA3R6QEcuST7Gq
+JzjfU9uLD2tHLYZFNzS4dm4PvwC2aK7OdEOm7VkXFwUyP97QjwPV7fabrQ2QjwGg
+ek+nVEdH9QJBAMvxFickez9eqgiMfZbfY8t5I+Dxz69ZVGsPvl/6xhiUvgxjREM7
+EnScf86HwlBnteoUtMptAKu7Dbq5inPbkFsCQCV8FuRNZGJKNhQsGf/3Sd21S/21
+s2omb9bz1YuFrWaVq74d8eBup/FpGhmlxilYdx2+Hqn5kLYNiozxj+ZDpzkCQQC8
+7VJAYKNsSR3rXXra0Yd5b3e1Y02qe26g36zU7VOmYeTNRQhv38FxFamwgkOYiPsV
+Jql0/RWqAVburAN+4OARAkB9FwUtKyhs7FM4N9bXi+c8m42hkBv+dSim534tPijS
+UCcCONLEQTv4yjlCOwTKMVDoajkWH1A2e7psTmIR+zwc
+-----END RSA PRIVATE KEY-----
diff --git a/tests/certs/Server-localhost-sv.p12 b/tests/certs/Server-localhost-sv.p12
new file mode 100644
index 000000000..d7b8441a4
--- /dev/null
+++ b/tests/certs/Server-localhost-sv.p12
Binary files differ
diff --git a/tests/certs/Server-localhost-sv.pem b/tests/certs/Server-localhost-sv.pem
new file mode 100644
index 000000000..86b48b343
--- /dev/null
+++ b/tests/certs/Server-localhost-sv.pem
@@ -0,0 +1,126 @@
+extensions = x509v3
+[ x509v3 ]
+subjectAltName = DNS:localhost
+keyUsage = keyEncipherment
+extendedKeyUsage = serverAuth
+subjectKeyIdentifier = hash
+authorityKeyIdentifier = keyid
+basicConstraints = critical,CA:false
+[ req ]
+default_bits = 1024
+distinguished_name = req_DN
+default_md = sha256
+string_mask = utf8only
+[ req_DN ]
+countryName = "Country Name is Northern Nowhere"
+countryName_value = NN
+organizationName = "Organization Name"
+organizationName_value = Edel Curl Arctic Illudium Research Cloud
+commonName = "Common Name"
+commonName_value = localhost
+
+[something]
+# The key
+# the certficate
+# some dhparam
+-----BEGIN RSA PRIVATE KEY-----
+MIICXQIBAAKBgQCwJ3kmLLnk0YEKCdJ2/prhBWgBs3J3lzjkYBxxnZn3JnshtW2q
+nxR2B2ykKi197vZviljEk97+oSUP/1dJwNmU2Qd5v4xt+vEYgmegP9cxA4LsuTlp
+B+zskxdbGnKRk7JrmGZj/mEp562GDgS6v4tVV2GlSvbK58bRuGVCq2dkFwIDAQAB
+AoGBAKa0JHWZHC9MiSa71t5f4qiTGjOJ5AkDJocR4bkv4dZAJ4TmEqvGsnFkY08U
+z0p/i95Q+eLG4eDtFYsHJU8Z343odktK99BUJzkDzqWT9RMzJ5Ykx6LbldJyW5NN
+IwvhDuW3rq8fbCMr+NGe9chc1Rg2lrfeEJDwjki/drBQs7zpAkEA3R6QEcuST7Gq
+JzjfU9uLD2tHLYZFNzS4dm4PvwC2aK7OdEOm7VkXFwUyP97QjwPV7fabrQ2QjwGg
+ek+nVEdH9QJBAMvxFickez9eqgiMfZbfY8t5I+Dxz69ZVGsPvl/6xhiUvgxjREM7
+EnScf86HwlBnteoUtMptAKu7Dbq5inPbkFsCQCV8FuRNZGJKNhQsGf/3Sd21S/21
+s2omb9bz1YuFrWaVq74d8eBup/FpGhmlxilYdx2+Hqn5kLYNiozxj+ZDpzkCQQC8
+7VJAYKNsSR3rXXra0Yd5b3e1Y02qe26g36zU7VOmYeTNRQhv38FxFamwgkOYiPsV
+Jql0/RWqAVburAN+4OARAkB9FwUtKyhs7FM4N9bXi+c8m42hkBv+dSim534tPijS
+UCcCONLEQTv4yjlCOwTKMVDoajkWH1A2e7psTmIR+zwc
+-----END RSA PRIVATE KEY-----
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number:
+ 0b:98:94:f9:7c:6a
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer:
+ countryName = NN
+ organizationName = Edel Curl Arctic Illudium Research Cloud
+ commonName = Nothern Nowhere Trust Anchor
+ Validity
+ Not Before: May 27 21:37:11 2010 GMT
+ Not After : Aug 13 21:37:11 2018 GMT
+ Subject:
+ countryName = NN
+ organizationName = Edel Curl Arctic Illudium Research Cloud
+ commonName = localhost
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ Public-Key: (1024 bit)
+ Modulus:
+ 00:b0:27:79:26:2c:b9:e4:d1:81:0a:09:d2:76:fe:
+ 9a:e1:05:68:01:b3:72:77:97:38:e4:60:1c:71:9d:
+ 99:f7:26:7b:21:b5:6d:aa:9f:14:76:07:6c:a4:2a:
+ 2d:7d:ee:f6:6f:8a:58:c4:93:de:fe:a1:25:0f:ff:
+ 57:49:c0:d9:94:d9:07:79:bf:8c:6d:fa:f1:18:82:
+ 67:a0:3f:d7:31:03:82:ec:b9:39:69:07:ec:ec:93:
+ 17:5b:1a:72:91:93:b2:6b:98:66:63:fe:61:29:e7:
+ ad:86:0e:04:ba:bf:8b:55:57:61:a5:4a:f6:ca:e7:
+ c6:d1:b8:65:42:ab:67:64:17
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Subject Alternative Name:
+ DNS:localhost
+ X509v3 Key Usage:
+ Key Encipherment
+ X509v3 Extended Key Usage:
+ TLS Web Server Authentication
+ X509v3 Subject Key Identifier:
+ BC:69:86:84:70:3A:AD:DE:08:2A:70:C6:3B:47:8C:11:3F:E0:9A:6D
+ X509v3 Authority Key Identifier:
+ keyid:AD:3E:E2:39:07:B8:5C:AA:26:90:94:4C:26:69:21:83:E2:4E:36:94
+
+ X509v3 Basic Constraints: critical
+ CA:FALSE
+ Signature Algorithm: sha1WithRSAEncryption
+ 7b:f0:b0:a0:d9:d0:91:38:9b:fe:cf:78:c8:d6:30:5d:87:9d:
+ b3:b9:6e:8b:5a:73:74:93:cb:30:49:d1:00:79:9d:5a:c2:71:
+ a3:93:5f:de:d3:5a:0c:fb:6d:41:83:89:1b:4f:0d:1c:65:0c:
+ 1a:0c:0f:96:79:62:90:e1:74:04:dd:c6:d8:cf:0f:5f:0f:28:
+ 87:d7:86:56:90:b4:d0:88:80:f1:a7:cd:fd:0b:13:58:bb:6d:
+ e6:ab:44:f6:9b:d6:cc:c7:db:3d:3a:90:c4:20:72:f4:38:38:
+ c0:ef:80:1d:60:3f:4e:30:40:11:56:29:70:aa:17:91:90:5f:
+ 70:0b:89:51:af:17:a8:ed:20:4e:76:bb:cf:a8:88:9a:25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NVHSMEGDAWgBSt
+PuI5B7hcqiaQlEwmaSGD4k42lDAMBgNVHRMBAf8EAjAAMA0GCSqGSIb3DQEBBQUA
+A4IBAQB78LCg2dCROJv+z3jI1jBdh52zuW6LWnN0k8swSdEAeZ1awnGjk1/e01oM
++21Bg4kbTw0cZQwaDA+WeWKQ4XQE3cbYzw9fDyiH14ZWkLTQiIDxp839CxNYu23m
+q0T2m9bMx9s9OpDEIHL0ODjA74AdYD9OMEARVilwqheRkF9wC4lRrxeo7SBOdrvP
+qIiaJQ86liYXUCqv84shnM//+SD8/sA3lcfNDXpT2SYSOCz2A5Ub2tAI9zKRB6c1
+DBQARMdD+yMuFETm7qnJIDcJuK4hT0u3hk3jQYQVThopAAOokpk8depDD+Mr9xex
+G4eABNOnc7FehTh9iQEWGfbE4Rt1
+-----END CERTIFICATE-----
+-----BEGIN DH PARAMETERS-----
+MIGHAoGBAP5mA7oYimErFUulbvNC8V0HwyB62NCj6TZb6YXJwElCksQc8RyHnkrY
+9Wx2+lduFqHjUWalgVF7Gma7CfR/pt+fiU6Jn2vWR2v7KT6hYeRKsJrONJlth+NK
+V7/d4zyvleJ/VSp0TuuSxmMMQ6hG3i5YhSGXyCh4h0pl4Wu/hdVTAgEC
+-----END DH PARAMETERS-----
diff --git a/tests/certs/Server-localhost-sv.prm b/tests/certs/Server-localhost-sv.prm
new file mode 100644
index 000000000..6351025dd
--- /dev/null
+++ b/tests/certs/Server-localhost-sv.prm
@@ -0,0 +1,25 @@
+extensions = x509v3
+[ x509v3 ]
+subjectAltName = DNS:localhost
+keyUsage = keyEncipherment
+extendedKeyUsage = serverAuth
+subjectKeyIdentifier = hash
+authorityKeyIdentifier = keyid
+basicConstraints = critical,CA:false
+[ req ]
+default_bits = 1024
+distinguished_name = req_DN
+default_md = sha256
+string_mask = utf8only
+[ req_DN ]
+countryName = "Country Name is Northern Nowhere"
+countryName_value = NN
+organizationName = "Organization Name"
+organizationName_value = Edel Curl Arctic Illudium Research Cloud
+commonName = "Common Name"
+commonName_value = localhost
+
+[something]
+# The key
+# the certficate
+# some dhparam
diff --git a/tests/certs/Server-localhost.nn-sv.crl b/tests/certs/Server-localhost.nn-sv.crl
new file mode 100644
index 000000000..db408315d
--- /dev/null
+++ b/tests/certs/Server-localhost.nn-sv.crl
@@ -0,0 +1,13 @@
+-----BEGIN X509 CRL-----
+MIIB9DCB3QIBATANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJOTjExMC8GA1UE
+CgwoRWRlbCBDdXJsIEFyY3RpYyBJbGx1ZGl1bSBSZXNlYXJjaCBDbG91ZDElMCMG
+A1UEAwwcTm90aGVybiBOb3doZXJlIFRydXN0IEFuY2hvchcNMTAwNTI3MjEzNzI0
+WhcNMTAwNjI2MjEzNzI0WjAyMBcCBguYlPl8ahcNMTAwNTI3MjEzNzExWjAXAgYL
+mJT7eF8XDTEwMDUyNzIxMzcyNFqgDjAMMAoGA1UdFAQDAgEBMA0GCSqGSIb3DQEB
+BQUAA4IBAQCo8mBpkZqiYWJMkJsZ1qqqOqVRne4iWhPOJSDGDgxoCTA4RgN1sQUv
+/MxO2LgSEyo9GopCpgWlhig+wzQmYCUf7HDw8sLzClUG4XUKRSW2Uq6q5BF5fwIu
+vHksi/RIPdcMx/+3dGIFeoccZZd5o7xgryGySAN6wHy6lY7LeeW7acpaDU43D7yi
+wQipBczrlH/jJDy6ja5FFBrAvvyRc4zC2X1/Rh3f0vNqnX9PLC524HxRmasCKYM8
+vgcPbvJ7Z/HRGOYRu9vTp5X0+lPPj24WE8vX3AZdjyI6qpinHzrsYen/qs6c0v3k
+FKYuzuVlUAy+5aZDhx+GHr+KW+y2T/ol
+-----END X509 CRL-----
diff --git a/tests/certs/Server-localhost.nn-sv.crt b/tests/certs/Server-localhost.nn-sv.crt
new file mode 100644
index 000000000..722aeeb11
--- /dev/null
+++ b/tests/certs/Server-localhost.nn-sv.crt
@@ -0,0 +1,81 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number:
+ 0b:98:94:fb:78:5f
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer:
+ countryName = NN
+ organizationName = Edel Curl Arctic Illudium Research Cloud
+ commonName = Nothern Nowhere Trust Anchor
+ Validity
+ Not Before: May 27 21:37:24 2010 GMT
+ Not After : Aug 13 21:37:24 2018 GMT
+ Subject:
+ countryName = NN
+ organizationName = Edel Curl Arctic Illudium Research Cloud
+ commonName = localhost.nn
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ Public-Key: (1024 bit)
+ Modulus:
+ 00:d3:d4:4e:db:63:5c:3f:3a:3a:5e:38:09:94:e6:
+ 4d:70:9d:0d:af:49:e6:82:5d:07:b7:f5:cd:a0:df:
+ af:71:f1:cf:bf:d5:9a:bd:af:7c:78:5d:55:3f:14:
+ bd:bb:2c:0e:73:9d:d6:82:9a:d5:e6:f6:21:5d:08:
+ 92:a2:71:5f:80:5f:5c:ce:f0:c2:37:37:79:0f:4d:
+ 3d:d4:f2:80:6d:47:36:45:d1:d2:8b:7a:2e:12:71:
+ 4b:47:86:f5:8c:99:af:e7:0e:cf:b5:c9:4d:7a:75:
+ f7:b2:74:0c:41:e3:ab:bb:2c:9d:6f:54:08:13:5a:
+ 3a:ef:7c:27:f7:3f:0b:0b:71
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Subject Alternative Name:
+ DNS:localhost.nn
+ X509v3 Key Usage:
+ Key Encipherment
+ X509v3 Extended Key Usage:
+ TLS Web Server Authentication
+ X509v3 Subject Key Identifier:
+ 81:26:F9:75:CC:9C:2D:3C:36:64:68:41:F7:07:3C:66:86:E5:4A:C1
+ X509v3 Authority Key Identifier:
+ keyid:AD:3E:E2:39:07:B8:5C:AA:26:90:94:4C:26:69:21:83:E2:4E:36:94
+
+ X509v3 Basic Constraints: critical
+ CA:FALSE
+ Signature Algorithm: sha1WithRSAEncryption
+ 65:05:8c:48:14:58:8c:1a:d4:95:67:1c:29:52:ed:5a:6e:14:
+ 41:bc:2b:16:20:c4:89:3a:6e:cb:c1:ff:ab:61:79:5f:ce:27:
+ 93:3c:ff:29:7a:25:68:00:27:04:f3:68:17:30:f0:fd:ff:09:
+ 0e:15:2a:25:b1:45:18:93:ab:12:8e:0c:13:11:9a:b8:a4:75:
+ d0:17:1b:ca:f2:66:6b:73:15:dd:8b:bb:34:d6:70:dc:34:1b:
+ e7:7a:30:ea:50:50:2f:88:67:b3:f8:b3:55:62:44:7e:3e:df:
+ 59:4f:a8:57:83:40:9f:bf:52:bf:fd:2c:18:6e:bd:0c:41:b7:
+ 78:1c:9b:fa:c4:ff:c3:2b:46:a4:8f:0c:19:a7:3d:75:81:29:
+ 6b:cf:07:f0:1d:65:d4:0e:19:51:87:92:a8:3d:7e:80:04:84:
+ ad:5e:4e:b6:ef:9a:02:c3:84:95:ec:c3:e8:a1:69:1f:42:cb:
+ da:63:1a:35:6f:d0:ba:62:9e:73:36:63:58:0f:cc:25:c8:59:
+ 73:df:3b:c2:b9:5a:da:3d:e1:3f:0a:1f:0f:41:c4:88:2d:92:
+ 06:88:d4:54:81:e1:12:57:53:ab:6b:f8:c8:90:3e:30:4c:f5:
+ 72:cf:f0:d4:18:70:c1:78:85:30:9c:fe:94:f4:1b:c2:6c:14:
+ 49:7a:0e:27
+-----BEGIN CERTIFICATE-----
+MIIDRzCCAi+gAwIBAgIGC5iU+3hfMA0GCSqGSIb3DQEBBQUAMGcxCzAJBgNVBAYT
+Ak5OMTEwLwYDVQQKDChFZGVsIEN1cmwgQXJjdGljIElsbHVkaXVtIFJlc2VhcmNo
+IENsb3VkMSUwIwYDVQQDDBxOb3RoZXJuIE5vd2hlcmUgVHJ1c3QgQW5jaG9yMB4X
+DTEwMDUyNzIxMzcyNFoXDTE4MDgxMzIxMzcyNFowVzELMAkGA1UEBhMCTk4xMTAv
+BgNVBAoMKEVkZWwgQ3VybCBBcmN0aWMgSWxsdWRpdW0gUmVzZWFyY2ggQ2xvdWQx
+FTATBgNVBAMMDGxvY2FsaG9zdC5ubjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkC
+gYEA09RO22NcPzo6XjgJlOZNcJ0Nr0nmgl0Ht/XNoN+vcfHPv9Wava98eF1VPxS9
+uywOc53WgprV5vYhXQiSonFfgF9czvDCNzd5D0091PKAbUc2RdHSi3ouEnFLR4b1
+jJmv5w7PtclNenX3snQMQeOruyydb1QIE1o673wn9z8LC3ECAwEAAaOBjDCBiTAX
+BgNVHREEEDAOggxsb2NhbGhvc3Qubm4wCwYDVR0PBAQDAgUgMBMGA1UdJQQMMAoG
+CCsGAQUFBwMBMB0GA1UdDgQWBBSBJvl1zJwtPDZkaEH3BzxmhuVKwTAfBgNVHSME
+GDAWgBStPuI5B7hcqiaQlEwmaSGD4k42lDAMBgNVHRMBAf8EAjAAMA0GCSqGSIb3
+DQEBBQUAA4IBAQBlBYxIFFiMGtSVZxwpUu1abhRBvCsWIMSJOm7Lwf+rYXlfzieT
+PP8peiVoACcE82gXMPD9/wkOFSolsUUYk6sSjgwTEZq4pHXQFxvK8mZrcxXdi7s0
+1nDcNBvnejDqUFAviGez+LNVYkR+Pt9ZT6hXg0Cfv1K//SwYbr0MQbd4HJv6xP/D
+K0akjwwZpz11gSlrzwfwHWXUDhlRh5KoPX6ABIStXk6275oCw4SV7MPooWkfQsva
+Yxo1b9C6Yp5zNmNYD8wlyFlz3zvCuVraPeE/Ch8PQcSILZIGiNRUgeESV1Ora/jI
+kD4wTPVyz/DUGHDBeIUwnP6U9BvCbBRJeg4n
+-----END CERTIFICATE-----
diff --git a/tests/certs/Server-localhost.nn-sv.csr b/tests/certs/Server-localhost.nn-sv.csr
new file mode 100644
index 000000000..642434347
--- /dev/null
+++ b/tests/certs/Server-localhost.nn-sv.csr
@@ -0,0 +1,11 @@
+-----BEGIN CERTIFICATE REQUEST-----
+MIIBlzCCAQACAQAwVzELMAkGA1UEBhMCTk4xMTAvBgNVBAoMKEVkZWwgQ3VybCBB
+cmN0aWMgSWxsdWRpdW0gUmVzZWFyY2ggQ2xvdWQxFTATBgNVBAMMDGxvY2FsaG9z
+dC5ubjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA09RO22NcPzo6XjgJlOZN
+cJ0Nr0nmgl0Ht/XNoN+vcfHPv9Wava98eF1VPxS9uywOc53WgprV5vYhXQiSonFf
+gF9czvDCNzd5D0091PKAbUc2RdHSi3ouEnFLR4b1jJmv5w7PtclNenX3snQMQeOr
+uyydb1QIE1o673wn9z8LC3ECAwEAAaAAMA0GCSqGSIb3DQEBCwUAA4GBAM5PenDC
+AtDhzdVKrX6DcJINWck5XFEnvWQksSYU7iDeiQVycQxR+LYKGZiy04u+9C+MN7eq
+JmHAIi+88r7/ZaGJLujqSUOJn8ocZ+vwhJOwh2XBhhLaCjIW/H05g0aNlk80Ye6m
+OA9DCIZUINF0lDQaJCpKXxwNVcz4Rifp5/9T
+-----END CERTIFICATE REQUEST-----
diff --git a/tests/certs/Server-localhost.nn-sv.der b/tests/certs/Server-localhost.nn-sv.der
new file mode 100644
index 000000000..08cf02f40
--- /dev/null
+++ b/tests/certs/Server-localhost.nn-sv.der
Binary files differ
diff --git a/tests/certs/Server-localhost.nn-sv.dhp b/tests/certs/Server-localhost.nn-sv.dhp
new file mode 100644
index 000000000..5d54840bb
--- /dev/null
+++ b/tests/certs/Server-localhost.nn-sv.dhp
@@ -0,0 +1,5 @@
+-----BEGIN DH PARAMETERS-----
+MIGHAoGBAPrtEVPhZfEczB9JnWXbln79YnTh/V6ehXMWe414wyn/VT1ow25sLEev
+H2+eT84aDp5e+TfBSFjA6or96/lyQvsgAE+cE6f6uuw9ApVG2MK+BCn4snxHBb6G
+LFQf+9qHZ4BEkpBL60p1fkGu8BM1wXGXEaeYhgGumNA9fm5YJrl7AgEC
+-----END DH PARAMETERS-----
diff --git a/tests/certs/Server-localhost.nn-sv.key b/tests/certs/Server-localhost.nn-sv.key
new file mode 100644
index 000000000..bf1cc7ec3
--- /dev/null
+++ b/tests/certs/Server-localhost.nn-sv.key
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXgIBAAKBgQDT1E7bY1w/OjpeOAmU5k1wnQ2vSeaCXQe39c2g369x8c+/1Zq9
+r3x4XVU/FL27LA5zndaCmtXm9iFdCJKicV+AX1zO8MI3N3kPTT3U8oBtRzZF0dKL
+ei4ScUtHhvWMma/nDs+1yU16dfeydAxB46u7LJ1vVAgTWjrvfCf3PwsLcQIDAQAB
+AoGBALr1HQxAq8AaMj3KE5rZkOudkeBtxwaz+QYB6hTcl8pnc8aKTmKwKZlKNtzP
+/4zdG3wriJII+lU4UsX7tP+uNGxKxALrDQRuBPyi8XQfUT1nJth6qkp8g3V/ixfE
+Yah3od9dL3+xsOH28RKKUC5kjmnNupO9KQZ6/CyYfUHAEG+pAkEA+PP+7FIvpPQ+
+7bbG4IIqn7QKVxGbtaFY8pdLnsUkrnIqwEIbZoU12iEKm5qMoXNv30GknXrvxU53
+tdIZU5Z28wJBANnTTMb/jac+Q1SaqmWQnrpcmvuPZ/8xRM6xeSJh+MDpK768WpYe
+nivHvinQjQZBQmNM3IPYbJ33nTAdJylmFQsCQQCn4crATPAKOheRsJdO4RijWAM9
+EgfCJUtZVMPPDr0c0qqXujzGFwDo1y1TH5bEbZc8pATBmhzFHpRFzaf8oVQXAkAX
+Hch5GefDhuUIVn2c17MwneFIrxhfSbA+qzDqyDDo8BXXYQ/P/KHWjZUNxPciYcyU
+0zRXvaERRpTk5UMhrpavAkEAy4ZyhH1UViuWsmTQaRjc5mDs8aXkd2y85A7jnfWA
+8r7CL+sOe4TU1/CVyJf2FJaqHfD/GG6fqqeFoHuaqwTyiw==
+-----END RSA PRIVATE KEY-----
diff --git a/tests/certs/Server-localhost.nn-sv.pem b/tests/certs/Server-localhost.nn-sv.pem
new file mode 100644
index 000000000..b5c253120
--- /dev/null
+++ b/tests/certs/Server-localhost.nn-sv.pem
@@ -0,0 +1,126 @@
+extensions = x509v3
+[ x509v3 ]
+subjectAltName = DNS:localhost.nn
+keyUsage = keyEncipherment
+extendedKeyUsage = serverAuth
+subjectKeyIdentifier = hash
+authorityKeyIdentifier = keyid
+basicConstraints = critical,CA:false
+[ req ]
+default_bits = 1024
+distinguished_name = req_DN
+default_md = sha256
+string_mask = utf8only
+[ req_DN ]
+countryName = "Country Name is Northern Nowhere"
+countryName_value = NN
+organizationName = "Organization Name"
+organizationName_value = Edel Curl Arctic Illudium Research Cloud
+commonName = "Common Name"
+commonName_value = localhost.nn
+
+[something]
+# The key
+# the certficate
+# some dhparam
+-----BEGIN RSA PRIVATE KEY-----
+MIICXgIBAAKBgQDT1E7bY1w/OjpeOAmU5k1wnQ2vSeaCXQe39c2g369x8c+/1Zq9
+r3x4XVU/FL27LA5zndaCmtXm9iFdCJKicV+AX1zO8MI3N3kPTT3U8oBtRzZF0dKL
+ei4ScUtHhvWMma/nDs+1yU16dfeydAxB46u7LJ1vVAgTWjrvfCf3PwsLcQIDAQAB
+AoGBALr1HQxAq8AaMj3KE5rZkOudkeBtxwaz+QYB6hTcl8pnc8aKTmKwKZlKNtzP
+/4zdG3wriJII+lU4UsX7tP+uNGxKxALrDQRuBPyi8XQfUT1nJth6qkp8g3V/ixfE
+Yah3od9dL3+xsOH28RKKUC5kjmnNupO9KQZ6/CyYfUHAEG+pAkEA+PP+7FIvpPQ+
+7bbG4IIqn7QKVxGbtaFY8pdLnsUkrnIqwEIbZoU12iEKm5qMoXNv30GknXrvxU53
+tdIZU5Z28wJBANnTTMb/jac+Q1SaqmWQnrpcmvuPZ/8xRM6xeSJh+MDpK768WpYe
+nivHvinQjQZBQmNM3IPYbJ33nTAdJylmFQsCQQCn4crATPAKOheRsJdO4RijWAM9
+EgfCJUtZVMPPDr0c0qqXujzGFwDo1y1TH5bEbZc8pATBmhzFHpRFzaf8oVQXAkAX
+Hch5GefDhuUIVn2c17MwneFIrxhfSbA+qzDqyDDo8BXXYQ/P/KHWjZUNxPciYcyU
+0zRXvaERRpTk5UMhrpavAkEAy4ZyhH1UViuWsmTQaRjc5mDs8aXkd2y85A7jnfWA
+8r7CL+sOe4TU1/CVyJf2FJaqHfD/GG6fqqeFoHuaqwTyiw==
+-----END RSA PRIVATE KEY-----
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number:
+ 0b:98:94:fb:78:5f
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer:
+ countryName = NN
+ organizationName = Edel Curl Arctic Illudium Research Cloud
+ commonName = Nothern Nowhere Trust Anchor
+ Validity
+ Not Before: May 27 21:37:24 2010 GMT
+ Not After : Aug 13 21:37:24 2018 GMT
+ Subject:
+ countryName = NN
+ organizationName = Edel Curl Arctic Illudium Research Cloud
+ commonName = localhost.nn
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ Public-Key: (1024 bit)
+ Modulus:
+ 00:d3:d4:4e:db:63:5c:3f:3a:3a:5e:38:09:94:e6:
+ 4d:70:9d:0d:af:49:e6:82:5d:07:b7:f5:cd:a0:df:
+ af:71:f1:cf:bf:d5:9a:bd:af:7c:78:5d:55:3f:14:
+ bd:bb:2c:0e:73:9d:d6:82:9a:d5:e6:f6:21:5d:08:
+ 92:a2:71:5f:80:5f:5c:ce:f0:c2:37:37:79:0f:4d:
+ 3d:d4:f2:80:6d:47:36:45:d1:d2:8b:7a:2e:12:71:
+ 4b:47:86:f5:8c:99:af:e7:0e:cf:b5:c9:4d:7a:75:
+ f7:b2:74:0c:41:e3:ab:bb:2c:9d:6f:54:08:13:5a:
+ 3a:ef:7c:27:f7:3f:0b:0b:71
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Subject Alternative Name:
+ DNS:localhost.nn
+ X509v3 Key Usage:
+ Key Encipherment
+ X509v3 Extended Key Usage:
+ TLS Web Server Authentication
+ X509v3 Subject Key Identifier:
+ 81:26:F9:75:CC:9C:2D:3C:36:64:68:41:F7:07:3C:66:86:E5:4A:C1
+ X509v3 Authority Key Identifier:
+ keyid:AD:3E:E2:39:07:B8:5C:AA:26:90:94:4C:26:69:21:83:E2:4E:36:94
+
+ X509v3 Basic Constraints: critical
+ CA:FALSE
+ Signature Algorithm: sha1WithRSAEncryption
+ 65:05:8c:48:14:58:8c:1a:d4:95:67:1c:29:52:ed:5a:6e:14:
+ 41:bc:2b:16:20:c4:89:3a:6e:cb:c1:ff:ab:61:79:5f:ce:27:
+ 93:3c:ff:29:7a:25:68:00:27:04:f3:68:17:30:f0:fd:ff:09:
+ 0e:15:2a:25:b1:45:18:93:ab:12:8e:0c:13:11:9a:b8:a4:75:
+ d0:17:1b:ca:f2:66:6b:73:15:dd:8b:bb:34:d6:70:dc:34:1b:
+ e7:7a:30:ea:50:50:2f:88:67:b3:f8:b3:55:62:44:7e:3e:df:
+ 59:4f:a8:57:83:40:9f:bf:52:bf:fd:2c:18:6e:bd:0c:41:b7:
+ 78:1c:9b:fa:c4:ff:c3:2b:46:a4:8f:0c:19:a7:3d:75:81:29:
+ 6b:cf:07:f0:1d:65:d4:0e:19:51:87:92:a8:3d:7e:80:04:84:
+ ad:5e:4e:b6:ef:9a:02:c3:84:95:ec:c3:e8:a1:69:1f:42:cb:
+ da:63:1a:35:6f:d0:ba:62:9e:73:36:63:58:0f:cc:25:c8:59:
+ 73:df:3b:c2:b9:5a:da:3d:e1:3f:0a:1f:0f:41:c4:88:2d:92:
+ 06:88:d4:54:81:e1:12:57:53:ab:6b:f8:c8:90:3e:30:4c:f5:
+ 72:cf:f0:d4:18:70:c1:78:85:30:9c:fe:94:f4:1b:c2:6c:14:
+ 49:7a:0e:27
+-----BEGIN CERTIFICATE-----
+MIIDRzCCAi+gAwIBAgIGC5iU+3hfMA0GCSqGSIb3DQEBBQUAMGcxCzAJBgNVBAYT
+Ak5OMTEwLwYDVQQKDChFZGVsIEN1cmwgQXJjdGljIElsbHVkaXVtIFJlc2VhcmNo
+IENsb3VkMSUwIwYDVQQDDBxOb3RoZXJuIE5vd2hlcmUgVHJ1c3QgQW5jaG9yMB4X
+DTEwMDUyNzIxMzcyNFoXDTE4MDgxMzIxMzc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w9ApVG2MK+BCn4snxHBb6G
+LFQf+9qHZ4BEkpBL60p1fkGu8BM1wXGXEaeYhgGumNA9fm5YJrl7AgEC
+-----END DH PARAMETERS-----
diff --git a/tests/certs/Server-localhost.nn-sv.prm b/tests/certs/Server-localhost.nn-sv.prm
new file mode 100644
index 000000000..e515ea15b
--- /dev/null
+++ b/tests/certs/Server-localhost.nn-sv.prm
@@ -0,0 +1,25 @@
+extensions = x509v3
+[ x509v3 ]
+subjectAltName = DNS:localhost.nn
+keyUsage = keyEncipherment
+extendedKeyUsage = serverAuth
+subjectKeyIdentifier = hash
+authorityKeyIdentifier = keyid
+basicConstraints = critical,CA:false
+[ req ]
+default_bits = 1024
+distinguished_name = req_DN
+default_md = sha256
+string_mask = utf8only
+[ req_DN ]
+countryName = "Country Name is Northern Nowhere"
+countryName_value = NN
+organizationName = "Organization Name"
+organizationName_value = Edel Curl Arctic Illudium Research Cloud
+commonName = "Common Name"
+commonName_value = localhost.nn
+
+[something]
+# The key
+# the certficate
+# some dhparam
diff --git a/tests/certs/Server-localhost0h-sv.crl b/tests/certs/Server-localhost0h-sv.crl
new file mode 100644
index 000000000..87a185900
--- /dev/null
+++ b/tests/certs/Server-localhost0h-sv.crl
@@ -0,0 +1,14 @@
+-----BEGIN X509 CRL-----
+MIICDTCB9gIBATANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJOTjExMC8GA1UE
+CgwoRWRlbCBDdXJsIEFyY3RpYyBJbGx1ZGl1bSBSZXNlYXJjaCBDbG91ZDElMCMG
+A1UEAwwcTm90aGVybiBOb3doZXJlIFRydXN0IEFuY2hvchcNMTAwNTI3MjEzNzU0
+WhcNMTAwNjI2MjEzNzU0WjBLMBcCBguYlPl8ahcNMTAwNTI3MjEzNzExWjAXAgYL
+mJT7eF8XDTEwMDUyNzIxMzcyNFowFwIGC5iVAAx+Fw0xMDA1MjcyMTM3NTRaoA4w
+DDAKBgNVHRQEAwIBATANBgkqhkiG9w0BAQUFAAOCAQEAWBL4VhArwJkUv91oyMIo
+xyyRmVl+1oY5IjEpLGd+mNIgqXuljQmbp8cS8A+jWinJPOWZqvsHa+mLCl4OuwhP
+JbAtIQ22OQRaVqWRuguG2T1sh3Dd7a1GcupIGKc/zgnY45D4pY4UNZv+KmY3bF0S
+83zn6YoQtBTzF9y2Nq5R0UTdxl6+j5swpo1ttvQPz40yqIlmjmW/llkaD4UBaegl
+zSxmnR5xCjAR7nYm+HyWW9SLSWGptUOd32B9TPJPLDhJa9lfBb8H9l5k7kx9ECJG
+LyujleeXIucfqOgE2cB0zCjExqrGWRp8ZgEWfpdSkDEpXBCDo88TA3dIr2f3Zxwp
+QA==
+-----END X509 CRL-----
diff --git a/tests/certs/Server-localhost0h-sv.crt b/tests/certs/Server-localhost0h-sv.crt
new file mode 100644
index 000000000..0dcb5df23
--- /dev/null
+++ b/tests/certs/Server-localhost0h-sv.crt
@@ -0,0 +1,81 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number:
+ 0b:98:95:00:0c:7e
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer:
+ countryName = NN
+ organizationName = Edel Curl Arctic Illudium Research Cloud
+ commonName = Nothern Nowhere Trust Anchor
+ Validity
+ Not Before: May 27 21:37:54 2010 GMT
+ Not After : Aug 13 21:37:54 2018 GMT
+ Subject:
+ countryName = NN
+ organizationName = Edel Curl Arctic Illudium Research Cloud
+ commonName = localhost
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ Public-Key: (1024 bit)
+ Modulus:
+ 00:cc:a9:91:2b:22:e8:90:2b:e5:4c:dc:ae:6d:da:
+ 4c:f3:32:cc:a5:68:67:5a:3b:b9:86:a3:95:88:3e:
+ e8:63:c3:ed:00:60:19:03:2b:5d:5b:56:8a:da:21:
+ 5e:71:5c:d1:e3:de:51:18:c1:17:14:b1:33:90:00:
+ 5c:9a:e5:73:0b:a8:88:9c:d0:0b:54:bc:ea:3a:39:
+ dd:f6:65:81:4b:29:99:4c:71:d3:f7:69:7f:80:e8:
+ e8:6d:61:41:83:87:eb:ac:2c:bd:0f:eb:1b:fd:a2:
+ 37:97:6d:31:56:ba:4b:51:dd:b1:01:eb:89:f8:25:
+ de:5b:a3:e5:b2:3f:4c:77:53
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Subject Alternative Name:
+ DNS:localhost
+ X509v3 Key Usage:
+ Key Encipherment
+ X509v3 Extended Key Usage:
+ TLS Web Server Authentication
+ X509v3 Subject Key Identifier:
+ 3B:2B:84:0D:23:3C:46:F9:9B:E5:C2:FA:B7:30:E7:AC:E3:ED:09:C3
+ X509v3 Authority Key Identifier:
+ keyid:AD:3E:E2:39:07:B8:5C:AA:26:90:94:4C:26:69:21:83:E2:4E:36:94
+
+ X509v3 Basic Constraints: critical
+ CA:FALSE
+ Signature Algorithm: sha1WithRSAEncryption
+ a2:fa:61:4e:c0:10:1f:f8:38:2c:fd:a6:74:85:df:8e:ee:41:
+ 90:a1:d7:c9:32:65:5d:61:d5:13:51:3b:11:1c:7b:01:06:70:
+ 9f:93:52:54:15:bd:93:3a:f8:40:e3:e2:ab:01:96:fb:73:c5:
+ 42:2c:ad:ce:e8:52:57:db:b6:15:90:75:e3:e5:75:99:b0:83:
+ ed:b0:fc:f2:d0:d9:3d:68:1c:d9:b4:cd:a1:a9:40:19:44:46:
+ 14:8b:11:6e:2e:1c:65:85:73:45:f0:8b:4f:ea:01:2d:61:0f:
+ ae:0d:70:0c:d3:3c:1c:1f:24:66:a3:0b:62:d1:87:1e:8e:96:
+ f6:43:cf:1c:24:e7:94:d0:7e:b0:ee:1b:6f:14:1f:04:35:e8:
+ fc:3c:c8:9e:e3:6e:0e:4c:7d:a9:23:97:2d:6e:b1:4d:e3:05:
+ 1b:ce:86:2f:2f:b3:c9:60:47:58:ac:ea:4c:cb:c2:7b:0f:08:
+ b8:a7:90:e7:22:32:70:f6:09:3e:f9:54:94:b0:37:50:22:60:
+ 49:1c:84:9e:1a:22:0c:3e:a9:16:7c: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LQ2T1oHNm0zaGpQBlE
+RhSLEW4uHGWFc0Xwi0/qAS1hD64NcAzTPBwfJGajC2LRhx6OlvZDzxwk55TQfrDu
+G28UHwQ16Pw8yJ7jbg5Mfakjly1usU3jBRvOhi8vs8lgR1is6kzLwnsPCLinkOci
+MnD2CT75VJSwN1AiYEkchJ4aIgw+qRZ8XrFQE2uCFNOKPU3tGMpAWda5cp9k5Qvn
+prjuKbVq7IKylFY244ezB6ppuCzvDBQ=
+-----END CERTIFICATE-----
diff --git a/tests/certs/Server-localhost0h-sv.csr b/tests/certs/Server-localhost0h-sv.csr
new file mode 100644
index 000000000..edf776f3f
--- /dev/null
+++ b/tests/certs/Server-localhost0h-sv.csr
@@ -0,0 +1,11 @@
+-----BEGIN CERTIFICATE REQUEST-----
+MIIBkzCB/QIBADBUMQswCQYDVQQGEwJOTjExMC8GA1UECgwoRWRlbCBDdXJsIEFy
+Y3RpYyBJbGx1ZGl1bSBSZXNlYXJjaCBDbG91ZDESMBAGA1UEAwwJbG9jYWxob3N0
+MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDMqZErIuiQK+VM3K5t2kzzMsyl
+aGdaO7mGo5WIPuhjw+0AYBkDK11bVoraIV5xXNHj3lEYwRcUsTOQAFya5XMLqIic
+0AtUvOo6Od32ZYFLKZlMcdP3aX+A6OhtYUGDh+usLL0P6xv9ojeXbTFWuktR3bEB
+64n4Jd5bo+WyP0x3UwIDAQABoAAwDQYJKoZIhvcNAQELBQADgYEAPor+2apn3kPJ
+ZdjyyT/iXETRTrN87PuBaujcV+oVeVSWW+YgGUzDHi+RkEKTxWdz3leW2goE41X9
+2D/n66ASQGs1x8wXwIMIX83MjkWtjqdfcrJVi1l6T7NjzZt6EyJdvreRntCUu8zc
+J5tK3rl/tIeudKUE2COc0Ngu9JUB1j8=
+-----END CERTIFICATE REQUEST-----
diff --git a/tests/certs/Server-localhost0h-sv.der b/tests/certs/Server-localhost0h-sv.der
new file mode 100644
index 000000000..14be0ba63
--- /dev/null
+++ b/tests/certs/Server-localhost0h-sv.der
Binary files differ
diff --git a/tests/certs/Server-localhost0h-sv.dhp b/tests/certs/Server-localhost0h-sv.dhp
new file mode 100644
index 000000000..99e6107e8
--- /dev/null
+++ b/tests/certs/Server-localhost0h-sv.dhp
@@ -0,0 +1,5 @@
+-----BEGIN DH PARAMETERS-----
+MIGHAoGBAL/3hRxvWX+Mdyu/aBPU1JeeA5sg4nXtA7B24eCql9Tq53Lks1/HJ5B+
+xSapGAFd+22xhBsNkJihf74oiPEVr9nNoLjFV/DZe259+JYgs+pBTFN+Cp13ALUi
+CeZxX2mlxlstD1SBRTKgxA/j4ttR1Chn8knn+RVdFE9YFKCYPyLrAgEC
+-----END DH PARAMETERS-----
diff --git a/tests/certs/Server-localhost0h-sv.key b/tests/certs/Server-localhost0h-sv.key
new file mode 100644
index 000000000..95c4666ad
--- /dev/null
+++ b/tests/certs/Server-localhost0h-sv.key
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXAIBAAKBgQDMqZErIuiQK+VM3K5t2kzzMsylaGdaO7mGo5WIPuhjw+0AYBkD
+K11bVoraIV5xXNHj3lEYwRcUsTOQAFya5XMLqIic0AtUvOo6Od32ZYFLKZlMcdP3
+aX+A6OhtYUGDh+usLL0P6xv9ojeXbTFWuktR3bEB64n4Jd5bo+WyP0x3UwIDAQAB
+AoGAGT+OBilPUYHoztumtSyqM5J/xqQjo/EcSSzjJKTGHJCuK06vp0FxSfRaOuDE
++u09g4QIsyoXA9l8h/ZTdlR6Jax5nc+iRFs/21isrgKAsZYj4DghjgXJ9LWGHXnb
+7xstVFkFBGnOaeY7dVr54907TYUQwtJg4fk7Vror05gb1qECQQDykAxr2D/CxLk9
+RjWDi/P6JnfF0ZxZzCe0yATvuZ89+rpWQ5uxEJDq5FqwW4QXX+0G2aWDv64YExPS
+JmWQTlojAkEA2AAHDv2KBWFcXeTlWnKZTdzUOniE8PzS5zipi2ssiqXScrj9NX2U
+yCCOkv/42blPXBKbaVnfWBEhtj7pQxHJEQJBAOTvXjnfVXafs/IINPPegLyF2B/G
+EZqTXJp8+mPEP28BGSPYFbdN2mlIc+vlxEtHh3AitdweatNgFiIPiWZk/R8CQEIf
+EAoYtw2alknv7f3YIvHg7d7QUfHrkyxQ/iW9sy7mQBv6YRjkzozM2phJX4ZW4eJP
+l9+SMXqmE+nULFfps+ECQFVkjPDF065x++Fh3BVtNJ0goYStTJM6IcmYKflap+Ux
+cORZUWJ8tvDavlSSwQQYK8kOVTINC6iFwwEQ41HlYLE=
+-----END RSA PRIVATE KEY-----
diff --git a/tests/certs/Server-localhost0h-sv.p12 b/tests/certs/Server-localhost0h-sv.p12
new file mode 100644
index 000000000..82e03c785
--- /dev/null
+++ b/tests/certs/Server-localhost0h-sv.p12
Binary files differ
diff --git a/tests/certs/Server-localhost0h-sv.pem b/tests/certs/Server-localhost0h-sv.pem
new file mode 100644
index 000000000..45be9c35e
--- /dev/null
+++ b/tests/certs/Server-localhost0h-sv.pem
@@ -0,0 +1,127 @@
+extensions = x509v3
+[ x509v3 ]
+#subjectAltName = DNS:localhost\0h
+subjectAltName = DER:30:0d:82:0b:6c:6f:63:61:6c:68:6f:73:74:00:68
+keyUsage = keyEncipherment
+extendedKeyUsage = serverAuth
+subjectKeyIdentifier = hash
+authorityKeyIdentifier = keyid
+basicConstraints = critical,CA:false
+[ req ]
+default_bits = 1024
+distinguished_name = req_DN
+default_md = sha256
+string_mask = utf8only
+[ req_DN ]
+countryName = "Country Name is Northern Nowhere"
+countryName_value = NN
+organizationName = "Organization Name"
+organizationName_value = Edel Curl Arctic Illudium Research Cloud
+commonName = "Common Name"
+commonName_value = localhost
+
+[something]
+# The key
+# the certificate
+# some dhparam
+-----BEGIN RSA PRIVATE KEY-----
+MIICXAIBAAKBgQDMqZErIuiQK+VM3K5t2kzzMsylaGdaO7mGo5WIPuhjw+0AYBkD
+K11bVoraIV5xXNHj3lEYwRcUsTOQAFya5XMLqIic0AtUvOo6Od32ZYFLKZlMcdP3
+aX+A6OhtYUGDh+usLL0P6xv9ojeXbTFWuktR3bEB64n4Jd5bo+WyP0x3UwIDAQAB
+AoGAGT+OBilPUYHoztumtSyqM5J/xqQjo/EcSSzjJKTGHJCuK06vp0FxSfRaOuDE
++u09g4QIsyoXA9l8h/ZTdlR6Jax5nc+iRFs/21isrgKAsZYj4DghjgXJ9LWGHXnb
+7xstVFkFBGnOaeY7dVr54907TYUQwtJg4fk7Vror05gb1qECQQDykAxr2D/CxLk9
+RjWDi/P6JnfF0ZxZzCe0yATvuZ89+rpWQ5uxEJDq5FqwW4QXX+0G2aWDv64YExPS
+JmWQTlojAkEA2AAHDv2KBWFcXeTlWnKZTdzUOniE8PzS5zipi2ssiqXScrj9NX2U
+yCCOkv/42blPXBKbaVnfWBEhtj7pQxHJEQJBAOTvXjnfVXafs/IINPPegLyF2B/G
+EZqTXJp8+mPEP28BGSPYFbdN2mlIc+vlxEtHh3AitdweatNgFiIPiWZk/R8CQEIf
+EAoYtw2alknv7f3YIvHg7d7QUfHrkyxQ/iW9sy7mQBv6YRjkzozM2phJX4ZW4eJP
+l9+SMXqmE+nULFfps+ECQFVkjPDF065x++Fh3BVtNJ0goYStTJM6IcmYKflap+Ux
+cORZUWJ8tvDavlSSwQQYK8kOVTINC6iFwwEQ41HlYLE=
+-----END RSA PRIVATE KEY-----
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number:
+ 0b:98:95:00:0c:7e
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer:
+ countryName = NN
+ organizationName = Edel Curl Arctic Illudium Research Cloud
+ commonName = Nothern Nowhere Trust Anchor
+ Validity
+ Not Before: May 27 21:37:54 2010 GMT
+ Not After : Aug 13 21:37:54 2018 GMT
+ Subject:
+ countryName = NN
+ organizationName = Edel Curl Arctic Illudium Research Cloud
+ commonName = localhost
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ Public-Key: (1024 bit)
+ Modulus:
+ 00:cc:a9:91:2b:22:e8:90:2b:e5:4c:dc:ae:6d:da:
+ 4c:f3:32:cc:a5:68:67:5a:3b:b9:86:a3:95:88:3e:
+ e8:63:c3:ed:00:60:19:03:2b:5d:5b:56:8a:da:21:
+ 5e:71:5c:d1:e3:de:51:18:c1:17:14:b1:33:90:00:
+ 5c:9a:e5:73:0b:a8:88:9c:d0:0b:54:bc:ea:3a:39:
+ dd:f6:65:81:4b:29:99:4c:71:d3:f7:69:7f:80:e8:
+ e8:6d:61:41:83:87:eb:ac:2c:bd:0f:eb:1b:fd:a2:
+ 37:97:6d:31:56:ba:4b:51:dd:b1:01:eb:89:f8:25:
+ de:5b:a3:e5:b2:3f:4c:77:53
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Subject Alternative Name:
+ DNS:localhost
+ X509v3 Key Usage:
+ Key Encipherment
+ X509v3 Extended Key Usage:
+ TLS Web Server Authentication
+ X509v3 Subject Key Identifier:
+ 3B:2B:84:0D:23:3C:46:F9:9B:E5:C2:FA:B7:30:E7:AC:E3:ED:09:C3
+ X509v3 Authority Key Identifier:
+ keyid:AD:3E:E2:39:07:B8:5C:AA:26:90:94:4C:26:69:21:83:E2:4E:36:94
+
+ X509v3 Basic Constraints: critical
+ CA:FALSE
+ Signature Algorithm: sha1WithRSAEncryption
+ a2:fa:61:4e:c0:10:1f:f8:38:2c:fd:a6:74:85:df:8e:ee:41:
+ 90:a1:d7:c9:32:65:5d:61:d5:13:51:3b:11:1c:7b:01:06:70:
+ 9f:93:52:54:15:bd:93:3a:f8:40:e3:e2:ab:01:96:fb:73:c5:
+ 42:2c:ad:ce:e8:52:57:db:b6:15:90:75:e3:e5:75:99:b0:83:
+ ed:b0:fc:f2:d0:d9:3d:68:1c:d9:b4:cd:a1:a9:40:19:44:46:
+ 14:8b:11:6e:2e:1c:65:85:73:45:f0:8b:4f:ea:01:2d:61:0f:
+ ae:0d:70:0c:d3:3c:1c:1f:24:66:a3:0b:62:d1:87:1e:8e:96:
+ f6:43:c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EwHQYDVR0OBBYEFDsrhA0jPEb5m+XC+rcw56zj7QnDMB8GA1UdIwQYMBaA
+FK0+4jkHuFyqJpCUTCZpIYPiTjaUMAwGA1UdEwEB/wQCMAAwDQYJKoZIhvcNAQEF
+BQADggEBAKL6YU7AEB/4OCz9pnSF347uQZCh18kyZV1h1RNROxEcewEGcJ+TUlQV
+vZM6+EDj4qsBlvtzxUIsrc7oUlfbthWQdePldZmwg+2w/PLQ2T1oHNm0zaGpQBlE
+RhSLEW4uHGWFc0Xwi0/qAS1hD64NcAzTPBwfJGajC2LRhx6OlvZDzxwk55TQfrDu
+G28UHwQ16Pw8yJ7jbg5Mfakjly1usU3jBRvOhi8vs8lgR1is6kzLwnsPCLinkOci
+MnD2CT75VJSwN1AiYEkchJ4aIgw+qRZ8XrFQE2uCFNOKPU3tGMpAWda5cp9k5Qvn
+prjuKbVq7IKylFY244ezB6ppuCzvDBQ=
+-----END CERTIFICATE-----
+-----BEGIN DH PARAMETERS-----
+MIGHAoGBAL/3hRxvWX+Mdyu/aBPU1JeeA5sg4nXtA7B24eCql9Tq53Lks1/HJ5B+
+xSapGAFd+22xhBsNkJihf74oiPEVr9nNoLjFV/DZe259+JYgs+pBTFN+Cp13ALUi
+CeZxX2mlxlstD1SBRTKgxA/j4ttR1Chn8knn+RVdFE9YFKCYPyLrAgEC
+-----END DH PARAMETERS-----
diff --git a/tests/certs/Server-localhost0h-sv.prm b/tests/certs/Server-localhost0h-sv.prm
new file mode 100644
index 000000000..5e8944b31
--- /dev/null
+++ b/tests/certs/Server-localhost0h-sv.prm
@@ -0,0 +1,26 @@
+extensions = x509v3
+[ x509v3 ]
+#subjectAltName = DNS:localhost\0h
+subjectAltName = DER:30:0d:82:0b:6c:6f:63:61:6c:68:6f:73:74:00:68
+keyUsage = keyEncipherment
+extendedKeyUsage = serverAuth
+subjectKeyIdentifier = hash
+authorityKeyIdentifier = keyid
+basicConstraints = critical,CA:false
+[ req ]
+default_bits = 1024
+distinguished_name = req_DN
+default_md = sha256
+string_mask = utf8only
+[ req_DN ]
+countryName = "Country Name is Northern Nowhere"
+countryName_value = NN
+organizationName = "Organization Name"
+organizationName_value = Edel Curl Arctic Illudium Research Cloud
+commonName = "Common Name"
+commonName_value = localhost
+
+[something]
+# The key
+# the certificate
+# some dhparam
diff --git a/tests/certs/scripts/genroot.sh b/tests/certs/scripts/genroot.sh
new file mode 100755
index 000000000..6ac138873
--- /dev/null
+++ b/tests/certs/scripts/genroot.sh
@@ -0,0 +1,66 @@
+#!/bin/bash
+
+# (c) CopyRight EdelWeb for EdelKey and OpenEvidence, 2000-2004, 2009
+# Author: Peter Sylvester
+
+# "libre" for integration with curl
+
+OPENSSL=openssl
+if [ -f /usr/local/ssl/bin/openssl ] ; then
+OPENSSL=/usr/local/ssl/bin/openssl
+fi
+
+USAGE="echo Usage is genroot.sh \<name\>"
+
+HOME=`pwd`
+cd $HOME
+
+KEYSIZE=2048
+DURATION=6000
+
+PREFIX=$1
+if [ ".$PREFIX" = . ] ; then
+ echo No configuration prefix
+ NOTOK=1
+else
+ if [ ! -f $PREFIX-ca.prm ] ; then
+ echo No configuration file $PREFIX-ca.prm
+ NOTOK=1
+ fi
+fi
+
+if [ ".$NOTOK" != . ] ; then
+ echo "Sorry, I can't do that for you."
+ $USAGE
+ exit
+fi
+
+GETSERIAL="\$t = time ;\$d = \$t . substr(\$t+$$ ,-4,4)-1;print \$d"
+SERIAL=`/usr/bin/env perl -e "$GETSERIAL"`
+
+echo SERIAL=$SERIAL PREFIX=$PREFIX DURATION=$DURATION KEYSIZE=$KEYSIZE
+
+echo "openssl genrsa -out $PREFIX-ca.key $KEYSIZE -passout XXX"
+openssl genrsa -out $PREFIX-ca.key $KEYSIZE -passout pass:secret
+
+echo "openssl req -config $PREFIX-ca.prm -new -key $PREFIX-ca.key -out $PREFIX-ca.csr"
+$OPENSSL req -config $PREFIX-ca.prm -new -key $PREFIX-ca.key -out $PREFIX-ca.csr -passin pass:secret
+
+echo "openssl x509 -set_serial $SERIAL -extfile $PREFIX-ca.prm -days $DURATION -req -signkey $PREFIX-ca.key -in $PREFIX-ca.csr -out $PREFIX-$SERIAL.ca-cacert -sha1 "
+
+$OPENSSL x509 -set_serial $SERIAL -extfile $PREFIX-ca.prm -days $DURATION -req -signkey $PREFIX-ca.key -in $PREFIX-ca.csr -out $PREFIX-$SERIAL-ca.cacert -sha1
+
+echo "openssl x509 -text -hash -out $PREFIX-ca.cacert -in $PREFIX-$SERIAL-ca.cacert -nameopt multiline"
+$OPENSSL x509 -text -hash -out $PREFIX-ca.cacert -in $PREFIX-$SERIAL-ca.cacert -nameopt multiline
+
+echo "openssl x509 -in $PREFIX-ca.cacert -outform der -out $PREFIX-ca.der "
+$OPENSSL x509 -in $PREFIX-ca.cacert -outform der -out $PREFIX-ca.der
+
+echo "openssl x509 -in $PREFIX-ca.cacert -text -out $PREFIX-ca.crt -nameopt multiline"
+
+$OPENSSL x509 -in $PREFIX-ca.cacert -text -out $PREFIX-ca.crt -nameopt multiline
+
+echo "openssl x509 -noout -text -in $PREFIX-ca.cacert -nameopt multiline"
+$OPENSSL x509 -noout -text -in $PREFIX-ca.cacert -nameopt multiline
+
+#$OPENSSL rsa -in ../keys/$PREFIX-ca.key -text -noout -pubout
diff --git a/tests/certs/scripts/genserv.sh b/tests/certs/scripts/genserv.sh
new file mode 100755
index 000000000..a70da9c76
--- /dev/null
+++ b/tests/certs/scripts/genserv.sh
@@ -0,0 +1,112 @@
+#!/bin/bash
+
+# (c) CopyRight EdelWeb for EdelKey and OpenEvidence, 2000-2004, 2009
+# Author: Peter Sylvester
+
+# "libre" for integration with curl
+
+OPENSSL=openssl
+if [ -f /usr/local/ssl/bin/openssl ] ; then
+ OPENSSL=/usr/local/ssl/bin/openssl
+fi
+
+USAGE="echo Usage is genserv.sh <prefix> <caprefix>"
+
+HOME=`pwd`
+cd $HOME
+
+KEYSIZE=1024
+DURATION=3000
+
+REQ=YES
+P12=NO
+DHP=NO
+
+PREFIX=$1
+if [ ".$PREFIX" = . ] ; then
+ echo No configuration prefix
+ NOTOK=1
+else
+ if [ ! -f $PREFIX-sv.prm ] ; then
+ echo No configuration file $PREFIX-sv.prm
+ NOTOK=1
+ fi
+fi
+
+CAPREFIX=$2
+if [ ".$CAPREFIX" = . ] ; then
+ echo No CA prefix
+ NOTOK=1
+else
+ if [ ! -f $CAPREFIX-ca.cacert ] ; then
+ echo No CA certficate file $CAPREFIX-ca.caert
+ NOTOK=1
+ fi
+ if [ ! -f $CAPREFIX-ca.key ] ; then
+ echo No $CAPREFIX key
+ NOTOK=1
+ fi
+fi
+
+if [ ".$NOTOK" != . ] ; then
+ echo "Sorry, I can't do that for you."
+ $USAGE
+ exit
+fi
+
+if [ ".$SERIAL" = . ] ; then
+ GETSERIAL="\$t = time ;\$d = \$t . substr(\$t+$$ ,-4,4)-1;print \$d"
+ SERIAL=`/usr/bin/env perl -e "$GETSERIAL"`
+fi
+
+echo SERIAL=$SERIAL PREFIX=$PREFIX CAPREFIX=$CAPREFIX DURATION=$DURATION KEYSIZE=$KEYSIZE
+
+if [ "$DHP." = YES. ] ; then
+ echo "openssl dhparam -2 -out $PREFIX-sv.dhp $KEYSIZE"
+ $OPENSSL dhparam -2 -out $PREFIX-sv.dhp $KEYSIZE
+fi
+
+if [ "$REQ." = YES. ] ; then
+ echo "openssl req -config $PREFIX-sv.prm -newkey rsa:$KEYSIZE -keyout $PREFIX-sv.key -out $PREFIX-sv.csr -passout XXX"
+ $OPENSSL req -config $PREFIX-sv.prm -newkey rsa:$KEYSIZE -keyout $PREFIX-sv.key -out $PREFIX-sv.csr -passout pass:secret
+fi
+
+echo "openssl rsa -in $PREFIX-sv.key -out $PREFIX-sv.key"
+$OPENSSL rsa -in $PREFIX-sv.key -out $PREFIX-sv.key -passin pass:secret
+echo pseudo secrets generated
+
+echo "openssl x509 -set_serial $SERIAL -extfile $PREFIX-sv.prm -days $DURATION -CA $CAPREFIX-ca.cacert -CAkey $CAPREFIX-ca.key -in $PREFIX-sv.csr -req -out $PREFIX-sv.crt -text -nameopt multiline -sha1"
+
+$OPENSSL x509 -set_serial $SERIAL -extfile $PREFIX-sv.prm -days $DURATION -CA $CAPREFIX-ca.cacert -CAkey $CAPREFIX-ca.key -in $PREFIX-sv.csr -req -out $PREFIX-sv.crt -text -nameopt multiline -sha1
+
+if [ "$P12." = YES. ] ; then
+
+ echo "$OPENSSL pkcs12 -export -des3 -out $PREFIX-sv.p12 -caname $CAPREFIX -name $PREFIX -inkey $PREFIX-sv.key -in $PREFIX-sv.crt -certfile $CAPREFIX-ca.crt "
+
+ $OPENSSL pkcs12 -export -des3 -out $PREFIX-sv.p12 -caname $CAPREFIX -name $PREFIX -inkey $PREFIX-sv.key -in $PREFIX-sv.crt -certfile $CAPREFIX-ca.crt
+fi
+
+echo "openssl x509 -noout -text -hash -in $PREFIX-sv.selfcert -nameopt multiline"
+$OPENSSL x509 -noout -text -hash -in $PREFIX-sv.crt -nameopt multiline
+
+# revoke server cert
+touch $CAPREFIX-ca.db
+echo 01 > $CAPREFIX-ca.cnt
+echo "openssl ca -config $CAPREFIX-ca.cnf -revoke $PREFIX-sv.crt"
+$OPENSSL ca -config $CAPREFIX-ca.cnf -revoke $PREFIX-sv.crt
+
+# issue CRL
+echo "openssl ca -config $CAPREFIX-ca.cnf -gencrl -out $PREFIX-sv.crl"
+$OPENSSL ca -config $CAPREFIX-ca.cnf -gencrl -out $PREFIX-sv.crl
+
+echo "openssl x509 -in $PREFIX-sv.crt -outform der -out $PREFIX-sv.der "
+$OPENSSL x509 -in $PREFIX-sv.crt -outform der -out $PREFIX-sv.der
+
+# all together now
+touch $PREFIX-sv.dhp
+cat $PREFIX-sv.prm $PREFIX-sv.key $PREFIX-sv.crt $PREFIX-sv.dhp >$PREFIX-sv.pem
+chmod o-r $PREFIX-sv.prm
+
+echo "$PREFIX-sv.pem done"
+
+
diff --git a/tests/data/DISABLED b/tests/data/DISABLED
new file mode 100644
index 000000000..b6071cbd9
--- /dev/null
+++ b/tests/data/DISABLED
@@ -0,0 +1,5 @@
+# This file can be used to specify test cases that should not run when all
+# test cases are run by runtests.pl. Just add the plain test case numbers, one
+# per line.
+# Lines starting with '#' letters are treated as comments.
+564
diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am
new file mode 100644
index 000000000..d4fa32abc
--- /dev/null
+++ b/tests/data/Makefile.am
@@ -0,0 +1,92 @@
+iall:
+install:
+test:
+
+EXTRA_DIST = test1 test108 test117 test127 test20 test27 test34 test46 \
+ test10 test109 test118 test13 test200 test28 test36 test47 test100 test11 \
+ test119 test14 test201 test29 test37 test5 test101 test110 test12 test15 \
+ test202 test3 test4 test6 test102 test111 test120 test16 test21 test30 \
+ test7 test103 test112 test121 test17 test22 test300 test8 test104 test113 \
+ test122 test18 test23 test301 test9 test105 test114 test123 test19 test24 \
+ test302 test43 test31 test106 test115 test124 test190 test25 test303 \
+ test44 test38 test107 test116 test125 test2 test26 test33 test45 test126 \
+ test304 test39 test32 test128 test48 test306 test130 test131 test132 \
+ test133 test134 test135 test305 test49 test50 test51 test52 test53 test54 \
+ test55 test56 test500 test501 test502 test503 test504 test136 test57 \
+ test137 test138 test58 test139 test140 test141 test59 test60 test61 \
+ test142 test143 test62 test63 test64 test65 test66 test144 test145 test67 \
+ test68 test41 test40 test42 test69 test70 test71 test72 test73 test146 \
+ test505 test74 test75 test76 test77 test78 test147 test148 test506 test79 \
+ test80 test81 test82 test83 test84 test85 test86 test87 test507 test149 \
+ test88 test89 test90 test508 test91 test92 test203 test93 test94 test95 \
+ test510 test97 test98 test99 test150 test151 test152 test153 test154 \
+ test155 test156 test157 test158 test159 test511 test160 test161 test162 \
+ test163 test164 test512 test165 test166 test167 test168 test169 test170 \
+ test171 test172 test204 test205 test173 test174 test175 test176 test177 \
+ test513 test514 test178 test179 test180 test181 test182 test183 test184 \
+ test185 test186 test187 test188 test189 test191 test192 test193 test194 \
+ test195 test196 test197 test198 test515 test516 test517 test518 test210 \
+ test211 test212 test220 test221 test222 test223 test224 test206 test207 \
+ test208 test209 test213 test240 test241 test242 test519 test214 test215 \
+ test216 test217 test218 test199 test225 test226 test227 test228 test229 \
+ test233 test234 test235 test236 test520 test237 test238 test239 test243 \
+ test245 test246 test247 test248 test249 test250 test251 test252 test253 \
+ test254 test255 test521 test522 test523 test256 test257 test258 test259 \
+ test260 test261 test262 test263 test264 test265 test266 test267 test268 \
+ test269 test270 test271 test272 test273 test274 test275 test524 test525 \
+ test276 test277 test526 test527 test528 test530 DISABLED test278 test279 \
+ test531 test280 test529 test532 test533 test534 test535 test281 test537 \
+ test282 test283 test284 test538 test285 test286 test307 test308 test287 \
+ test400 test288 test600 test601 test602 test603 test401 test402 test290 \
+ test291 test292 test293 test403 test404 test405 test604 test605 test606 \
+ test607 test608 test609 test294 test295 test296 test297 test298 test610 \
+ test611 test612 test406 test407 test408 test409 test613 test614 test700 \
+ test701 test702 test704 test705 test703 test706 test707 test350 test351 \
+ test352 test353 test289 test540 test354 test231 test1000 test1001 \
+ test1002 test1003 test1004 test1005 test1006 test615 test1007 test541 \
+ test1010 test1011 test1012 test542 test543 test536 test1008 test1009 \
+ test2000 test2001 test2002 test2003 test35 test544 test545 test2004 \
+ test546 test1013 test1014 test1015 test547 test548 test549 test550 \
+ test551 test552 test1016 test1017 test1018 test1019 test1020 test553 \
+ test1021 test1022 test1023 test309 test616 test617 test618 test619 \
+ test620 test621 test622 test623 test624 test625 test626 test627 test554 \
+ test1024 test1025 test555 test1026 test1027 test1028 test1029 test1030 \
+ test556 test557 test1031 test628 test629 test630 test631 test632 test1032 \
+ test1033 test539 test1034 test1035 test1036 test1037 test1038 test1039 \
+ test1040 test1041 test1042 test1043 test1044 test1045 test1046 test1047 \
+ test1048 test1049 test1050 test1051 test1052 test1053 test1054 test1055 \
+ test1056 test1057 test1058 test1059 test1060 test1061 test1062 test1063 \
+ test1064 test1065 test1066 test1067 test1068 test1069 test1070 test1071 \
+ test1072 test1073 test1074 test1075 test1076 test1077 test1078 test1079 \
+ test1080 test1081 test1082 test1083 test1084 test1085 test633 test634 \
+ test635 test636 test637 test558 test559 test1086 test1087 test1088 \
+ test574 test575 test576 test577 test1113 test1114 test1089 test1090 \
+ test1091 test1092 test1093 test1094 test1095 test1096 test1097 test560 \
+ test561 test1098 test1099 test562 test563 test1100 test564 test1101 \
+ test1102 test1103 test1104 test299 test310 test311 test312 test1105 \
+ test565 test800 test1106 test801 test566 test802 test803 test1107 \
+ test1108 test1109 test1110 test1111 test1112 test129 test567 test568 \
+ test569 test570 test571 test572 test804 test805 test806 test807 test573 \
+ test313 test1115 test578 test579 test1116 test1200 test1201 test1202 \
+ test1203 test1117 test1118 test1119 test1120
+
+filecheck:
+ @mkdir test-place; \
+ cp "$(top_srcdir)"/tests/data/test[0-9]* test-place/; \
+ rm test-place/*~; \
+ for f in $(EXTRA_DIST); do \
+ if test -f "$(top_srcdir)/tests/data/$$f"; then \
+ rm -f "test-place/$$f"; \
+ else \
+ echo "$$f is listed but missing!"; \
+ fi \
+ done; \
+ echo "Local files not present in EXTRA_DIST:" ; \
+ ls test-place; \
+ ! ls test-place | grep . >/dev/null ; \
+ RC=$$? ; \
+ rm -rf test-place ; \
+ exit $$RC
+
+show:
+ @echo $(EXTRA_DIST)
diff --git a/tests/data/Makefile.in b/tests/data/Makefile.in
new file mode 100644
index 000000000..26522c3ee
--- /dev/null
+++ b/tests/data/Makefile.in
@@ -0,0 +1,495 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = tests/data
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/curl-compilers.m4 \
+ $(top_srcdir)/m4/curl-confopts.m4 \
+ $(top_srcdir)/m4/curl-functions.m4 \
+ $(top_srcdir)/m4/curl-override.m4 \
+ $(top_srcdir)/m4/curl-reentrant.m4 \
+ $(top_srcdir)/m4/curl-system.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/lib/curl_config.h \
+ $(top_builddir)/src/curl_config.h \
+ $(top_builddir)/include/curl/curlbuild.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_LIBHOSTNAME_FALSE = @BUILD_LIBHOSTNAME_FALSE@
+BUILD_LIBHOSTNAME_TRUE = @BUILD_LIBHOSTNAME_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONFIGURE_OPTIONS = @CONFIGURE_OPTIONS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CROSSCOMPILING_FALSE = @CROSSCOMPILING_FALSE@
+CROSSCOMPILING_TRUE = @CROSSCOMPILING_TRUE@
+CURLDEBUG_FALSE = @CURLDEBUG_FALSE@
+CURLDEBUG_TRUE = @CURLDEBUG_TRUE@
+CURL_CA_BUNDLE = @CURL_CA_BUNDLE@
+CURL_CFLAG_EXTRAS = @CURL_CFLAG_EXTRAS@
+CURL_DISABLE_DICT = @CURL_DISABLE_DICT@
+CURL_DISABLE_FILE = @CURL_DISABLE_FILE@
+CURL_DISABLE_FTP = @CURL_DISABLE_FTP@
+CURL_DISABLE_GOPHER = @CURL_DISABLE_GOPHER@
+CURL_DISABLE_HTTP = @CURL_DISABLE_HTTP@
+CURL_DISABLE_IMAP = @CURL_DISABLE_IMAP@
+CURL_DISABLE_LDAP = @CURL_DISABLE_LDAP@
+CURL_DISABLE_LDAPS = @CURL_DISABLE_LDAPS@
+CURL_DISABLE_POP3 = @CURL_DISABLE_POP3@
+CURL_DISABLE_PROXY = @CURL_DISABLE_PROXY@
+CURL_DISABLE_RTSP = @CURL_DISABLE_RTSP@
+CURL_DISABLE_SMTP = @CURL_DISABLE_SMTP@
+CURL_DISABLE_TELNET = @CURL_DISABLE_TELNET@
+CURL_DISABLE_TFTP = @CURL_DISABLE_TFTP@
+CURL_LIBS = @CURL_LIBS@
+CURL_NETWORK_LIBS = @CURL_NETWORK_LIBS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_SHARED = @ENABLE_SHARED@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+HAVE_LDAP_SSL = @HAVE_LDAP_SSL@
+HAVE_LIBZ = @HAVE_LIBZ@
+HAVE_LIBZ_FALSE = @HAVE_LIBZ_FALSE@
+HAVE_LIBZ_TRUE = @HAVE_LIBZ_TRUE@
+HAVE_PK11_CREATEGENERICOBJECT = @HAVE_PK11_CREATEGENERICOBJECT@
+IDN_ENABLED = @IDN_ENABLED@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+IPV6_ENABLED = @IPV6_ENABLED@
+KRB4_ENABLED = @KRB4_ENABLED@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBCURL_LIBS = @LIBCURL_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+MANOPT = @MANOPT@
+MIMPURE_FALSE = @MIMPURE_FALSE@
+MIMPURE_TRUE = @MIMPURE_TRUE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NO_UNDEFINED_FALSE = @NO_UNDEFINED_FALSE@
+NO_UNDEFINED_TRUE = @NO_UNDEFINED_TRUE@
+NROFF = @NROFF@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH = @PATH@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+PKGADD_NAME = @PKGADD_NAME@
+PKGADD_PKG = @PKGADD_PKG@
+PKGADD_VENDOR = @PKGADD_VENDOR@
+PKGCONFIG = @PKGCONFIG@
+RANDOM_FILE = @RANDOM_FILE@
+RANLIB = @RANLIB@
+REQUIRE_LIB_DEPS = @REQUIRE_LIB_DEPS@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SONAME_BUMP_FALSE = @SONAME_BUMP_FALSE@
+SONAME_BUMP_TRUE = @SONAME_BUMP_TRUE@
+SSL_ENABLED = @SSL_ENABLED@
+STATICLIB_FALSE = @STATICLIB_FALSE@
+STATICLIB_TRUE = @STATICLIB_TRUE@
+STRIP = @STRIP@
+SUPPORT_FEATURES = @SUPPORT_FEATURES@
+SUPPORT_PROTOCOLS = @SUPPORT_PROTOCOLS@
+TEST_SERVER_LIBS = @TEST_SERVER_LIBS@
+USE_ARES = @USE_ARES@
+USE_EMBEDDED_ARES_FALSE = @USE_EMBEDDED_ARES_FALSE@
+USE_EMBEDDED_ARES_TRUE = @USE_EMBEDDED_ARES_TRUE@
+USE_GNUTLS = @USE_GNUTLS@
+USE_LIBRTMP = @USE_LIBRTMP@
+USE_LIBSSH2 = @USE_LIBSSH2@
+USE_MANUAL_FALSE = @USE_MANUAL_FALSE@
+USE_MANUAL_TRUE = @USE_MANUAL_TRUE@
+USE_NSS = @USE_NSS@
+USE_OPENLDAP = @USE_OPENLDAP@
+USE_POLARSSL = @USE_POLARSSL@
+USE_SSLEAY = @USE_SSLEAY@
+USE_WINDOWS_SSPI = @USE_WINDOWS_SSPI@
+VERSION = @VERSION@
+VERSIONNUM = @VERSIONNUM@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+libext = @libext@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+subdirs = @subdirs@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+EXTRA_DIST = test1 test108 test117 test127 test20 test27 test34 test46 \
+ test10 test109 test118 test13 test200 test28 test36 test47 test100 test11 \
+ test119 test14 test201 test29 test37 test5 test101 test110 test12 test15 \
+ test202 test3 test4 test6 test102 test111 test120 test16 test21 test30 \
+ test7 test103 test112 test121 test17 test22 test300 test8 test104 test113 \
+ test122 test18 test23 test301 test9 test105 test114 test123 test19 test24 \
+ test302 test43 test31 test106 test115 test124 test190 test25 test303 \
+ test44 test38 test107 test116 test125 test2 test26 test33 test45 test126 \
+ test304 test39 test32 test128 test48 test306 test130 test131 test132 \
+ test133 test134 test135 test305 test49 test50 test51 test52 test53 test54 \
+ test55 test56 test500 test501 test502 test503 test504 test136 test57 \
+ test137 test138 test58 test139 test140 test141 test59 test60 test61 \
+ test142 test143 test62 test63 test64 test65 test66 test144 test145 test67 \
+ test68 test41 test40 test42 test69 test70 test71 test72 test73 test146 \
+ test505 test74 test75 test76 test77 test78 test147 test148 test506 test79 \
+ test80 test81 test82 test83 test84 test85 test86 test87 test507 test149 \
+ test88 test89 test90 test508 test91 test92 test203 test93 test94 test95 \
+ test510 test97 test98 test99 test150 test151 test152 test153 test154 \
+ test155 test156 test157 test158 test159 test511 test160 test161 test162 \
+ test163 test164 test512 test165 test166 test167 test168 test169 test170 \
+ test171 test172 test204 test205 test173 test174 test175 test176 test177 \
+ test513 test514 test178 test179 test180 test181 test182 test183 test184 \
+ test185 test186 test187 test188 test189 test191 test192 test193 test194 \
+ test195 test196 test197 test198 test515 test516 test517 test518 test210 \
+ test211 test212 test220 test221 test222 test223 test224 test206 test207 \
+ test208 test209 test213 test240 test241 test242 test519 test214 test215 \
+ test216 test217 test218 test199 test225 test226 test227 test228 test229 \
+ test233 test234 test235 test236 test520 test237 test238 test239 test243 \
+ test245 test246 test247 test248 test249 test250 test251 test252 test253 \
+ test254 test255 test521 test522 test523 test256 test257 test258 test259 \
+ test260 test261 test262 test263 test264 test265 test266 test267 test268 \
+ test269 test270 test271 test272 test273 test274 test275 test524 test525 \
+ test276 test277 test526 test527 test528 test530 DISABLED test278 test279 \
+ test531 test280 test529 test532 test533 test534 test535 test281 test537 \
+ test282 test283 test284 test538 test285 test286 test307 test308 test287 \
+ test400 test288 test600 test601 test602 test603 test401 test402 test290 \
+ test291 test292 test293 test403 test404 test405 test604 test605 test606 \
+ test607 test608 test609 test294 test295 test296 test297 test298 test610 \
+ test611 test612 test406 test407 test408 test409 test613 test614 test700 \
+ test701 test702 test704 test705 test703 test706 test707 test350 test351 \
+ test352 test353 test289 test540 test354 test231 test1000 test1001 \
+ test1002 test1003 test1004 test1005 test1006 test615 test1007 test541 \
+ test1010 test1011 test1012 test542 test543 test536 test1008 test1009 \
+ test2000 test2001 test2002 test2003 test35 test544 test545 test2004 \
+ test546 test1013 test1014 test1015 test547 test548 test549 test550 \
+ test551 test552 test1016 test1017 test1018 test1019 test1020 test553 \
+ test1021 test1022 test1023 test309 test616 test617 test618 test619 \
+ test620 test621 test622 test623 test624 test625 test626 test627 test554 \
+ test1024 test1025 test555 test1026 test1027 test1028 test1029 test1030 \
+ test556 test557 test1031 test628 test629 test630 test631 test632 test1032 \
+ test1033 test539 test1034 test1035 test1036 test1037 test1038 test1039 \
+ test1040 test1041 test1042 test1043 test1044 test1045 test1046 test1047 \
+ test1048 test1049 test1050 test1051 test1052 test1053 test1054 test1055 \
+ test1056 test1057 test1058 test1059 test1060 test1061 test1062 test1063 \
+ test1064 test1065 test1066 test1067 test1068 test1069 test1070 test1071 \
+ test1072 test1073 test1074 test1075 test1076 test1077 test1078 test1079 \
+ test1080 test1081 test1082 test1083 test1084 test1085 test633 test634 \
+ test635 test636 test637 test558 test559 test1086 test1087 test1088 \
+ test574 test575 test576 test577 test1113 test1114 test1089 test1090 \
+ test1091 test1092 test1093 test1094 test1095 test1096 test1097 test560 \
+ test561 test1098 test1099 test562 test563 test1100 test564 test1101 \
+ test1102 test1103 test1104 test299 test310 test311 test312 test1105 \
+ test565 test800 test1106 test801 test566 test802 test803 test1107 \
+ test1108 test1109 test1110 test1111 test1112 test129 test567 test568 \
+ test569 test570 test571 test572 test804 test805 test806 test807 test573 \
+ test313 test1115 test578 test579 test1116 test1200 test1201 test1202 \
+ test1203 test1117 test1118 test1119 test1120
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/data/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu tests/data/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ distclean distclean-generic distclean-libtool distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-exec install-exec-am \
+ install-info install-info-am install-man install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
+ uninstall-info-am
+
+iall:
+install:
+test:
+
+filecheck:
+ @mkdir test-place; \
+ cp "$(top_srcdir)"/tests/data/test[0-9]* test-place/; \
+ rm test-place/*~; \
+ for f in $(EXTRA_DIST); do \
+ if test -f "$(top_srcdir)/tests/data/$$f"; then \
+ rm -f "test-place/$$f"; \
+ else \
+ echo "$$f is listed but missing!"; \
+ fi \
+ done; \
+ echo "Local files not present in EXTRA_DIST:" ; \
+ ls test-place; \
+ ! ls test-place | grep . >/dev/null ; \
+ RC=$$? ; \
+ rm -rf test-place ; \
+ exit $$RC
+
+show:
+ @echo $(EXTRA_DIST)
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/tests/data/test1 b/tests/data/test1
new file mode 100644
index 000000000..b88273514
--- /dev/null
+++ b/tests/data/test1
@@ -0,0 +1,55 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+
+#
+# Server-side
+<reply name="1">
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+-foo-
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/1
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /1 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test10 b/tests/data/test10
new file mode 100644
index 000000000..806aa697f
--- /dev/null
+++ b/tests/data/test10
@@ -0,0 +1,67 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP PUT
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.0 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+
+blablabla
+
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+simple HTTP PUT from file
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/want/10 -T log/test10.txt
+</command>
+<file name="log/test10.txt">
+Weird
+ file
+ to
+ upload
+for
+ testing
+the
+ PUT
+ feature
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+PUT /we/want/10 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 78
+Expect: 100-continue
+
+Weird
+ file
+ to
+ upload
+for
+ testing
+the
+ PUT
+ feature
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test100 b/tests/data/test100
new file mode 100644
index 000000000..6127163b2
--- /dev/null
+++ b/tests/data/test100
@@ -0,0 +1,56 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+LIST
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+# When doing LIST, we get the default list output hard-coded in the test
+# FTP server
+<datacheck>
+total 20
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
+drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
+-r--r--r-- 1 0 1 35 Jul 16 1996 README
+lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
+dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
+drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
+dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
+drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
+dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP dir list PASV
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE A
+LIST
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1000 b/tests/data/test1000
new file mode 100644
index 000000000..e6f8eef41
--- /dev/null
+++ b/tests/data/test1000
@@ -0,0 +1,42 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+LIST
+NOBODY
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<datacheck>
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP dir list PASV with -I
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/1000/ -I
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD 1000
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1001 b/tests/data/test1001
new file mode 100644
index 000000000..9a87d6e8b
--- /dev/null
+++ b/tests/data/test1001
@@ -0,0 +1,104 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP PUT
+HTTP proxy
+HTTP Digest auth
+Resume
+Content-Range
+CUSTOMREQUEST
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 100 Continue
+Server: Microsoft-IIS/5.0
+Date: Sun, 03 Apr 2005 14:57:45 GMT
+X-Powered-By: ASP.NET
+
+HTTP/1.1 401 authentication please swsbounce
+Server: Microsoft-IIS/6.0
+WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 0
+
+</data>
+<data1000>
+HTTP/1.1 200 A OK
+Server: Microsoft-IIS/6.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 3
+
+ok
+</data1000>
+
+<datacheck>
+HTTP/1.1 100 Continue
+Server: Microsoft-IIS/5.0
+Date: Sun, 03 Apr 2005 14:57:45 GMT
+X-Powered-By: ASP.NET
+
+HTTP/1.1 401 authentication please swsbounce
+Server: Microsoft-IIS/6.0
+WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 0
+
+HTTP/1.1 200 A OK
+Server: Microsoft-IIS/6.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 3
+
+ok
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+#
+<server>
+http
+</server>
+ <name>
+HTTP POST --digest with PUT and resumed upload and modified method
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/1001 -u auser:apasswd --digest -T log/1001 -x http://%HOSTIP:%HTTPPORT -C 2 -X GET
+</command>
+<file name="log/1001">
+test
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET http://%HOSTIP:%HTTPPORT/1001 HTTP/1.1
+Content-Range: bytes 2-4/5
+User-Agent: curl/7.12.1-CVS (i686-pc-linux-gnu) libcurl/7.12.1-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 GSS libidn/0.4.6
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Proxy-Connection: Keep-Alive
+Content-Length: 0
+Expect: 100-continue
+
+GET http://%HOSTIP:%HTTPPORT/1001 HTTP/1.1
+Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/1001", response="6af4d89c952f4dd4cc215a6878dc499d"
+Content-Range: bytes 2-4/5
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Proxy-Connection: Keep-Alive
+Content-Length: 3
+Expect: 100-continue
+
+st
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1002 b/tests/data/test1002
new file mode 100644
index 000000000..04c18f91a
--- /dev/null
+++ b/tests/data/test1002
@@ -0,0 +1,114 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP PUT
+HTTP proxy
+HTTP Digest auth
+Resume
+Content-Range
+CUSTOMREQUEST
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 100 Continue
+Server: Microsoft-IIS/5.0
+Date: Sun, 03 Apr 2005 14:57:45 GMT
+X-Powered-By: ASP.NET
+
+HTTP/1.1 401 authentication please swsbounce
+Server: Microsoft-IIS/6.0
+WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 0
+
+</data>
+<data1000>
+HTTP/1.1 200 A OK
+Server: Microsoft-IIS/6.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 3
+
+ok
+</data1000>
+
+<datacheck>
+HTTP/1.1 100 Continue
+Server: Microsoft-IIS/5.0
+Date: Sun, 03 Apr 2005 14:57:45 GMT
+X-Powered-By: ASP.NET
+
+HTTP/1.1 401 authentication please swsbounce
+Server: Microsoft-IIS/6.0
+WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 0
+
+HTTP/1.1 200 A OK
+Server: Microsoft-IIS/6.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 3
+
+ok
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+#
+<server>
+http
+</server>
+ <name>
+HTTP POST --digest with PUT and resumed upload and modified method, twice
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/1002.upload1 -T log/1002 http://%HOSTIP:%HTTPPORT/1002.upload2 -T log/1002 -u auser:apasswd --digest -x http://%HOSTIP:%HTTPPORT -C 2 -X GET
+</command>
+<file name="log/1002">
+test
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET http://%HOSTIP:%HTTPPORT/1002.upload1 HTTP/1.1
+Content-Range: bytes 2-4/5
+User-Agent: curl/7.12.1-CVS (i686-pc-linux-gnu) libcurl/7.12.1-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 GSS libidn/0.4.6
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Proxy-Connection: Keep-Alive
+Content-Length: 0
+Expect: 100-continue
+
+GET http://%HOSTIP:%HTTPPORT/1002.upload1 HTTP/1.1
+Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/1002.upload1", response="198aa9b6acb4b0c71d02a197a5e41f54"
+Content-Range: bytes 2-4/5
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Proxy-Connection: Keep-Alive
+Content-Length: 3
+Expect: 100-continue
+
+st
+GET http://%HOSTIP:%HTTPPORT/1002.upload2 HTTP/1.1
+Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/1002.upload2", response="d711f0d2042786d930de635ba0d1a1d0"
+Content-Range: bytes 2-4/5
+User-Agent: curl/7.16.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Proxy-Connection: Keep-Alive
+Content-Length: 3
+Expect: 100-continue
+
+st
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1003 b/tests/data/test1003
new file mode 100644
index 000000000..08e377a79
--- /dev/null
+++ b/tests/data/test1003
@@ -0,0 +1,48 @@
+<testcase>
+<info>
+<keywords>
+FTP
+RETR
+huge response
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+mooo
+</data>
+# a ~17000 bytes response string to CWD to make sure the ftp parser deals
+# with it nicely
+<servercmd>
+REPLY CWD 250 CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP with excessively large server command response line
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/path/1003
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD path
+EPSV
+TYPE I
+SIZE 1003
+RETR 1003
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1004 b/tests/data/test1004
new file mode 100644
index 000000000..955163b36
--- /dev/null
+++ b/tests/data/test1004
@@ -0,0 +1,59 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP proxy
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+-foo-
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET with empty proxy
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/1004 --proxy ""
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /1004 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+<valgrind>
+disable
+</valgrind>
+</verify>
+</testcase>
diff --git a/tests/data/test1005 b/tests/data/test1005
new file mode 100644
index 000000000..5c0c67643
--- /dev/null
+++ b/tests/data/test1005
@@ -0,0 +1,48 @@
+<testcase>
+<info>
+<keywords>
+FTP
+RETR
+huge response
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+mooo
+</data>
+# a long set of response strings to CWD to make sure the ftp parser deals
+# with it nicely
+<servercmd>
+REPLY CWD 250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250 Finally, here is the response
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP with excessively large number of server command response lines
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/path/1005
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD path
+EPSV
+TYPE I
+SIZE 1005
+RETR 1005
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1006 b/tests/data/test1006
new file mode 100644
index 000000000..b37f807b7
--- /dev/null
+++ b/tests/data/test1006
@@ -0,0 +1,49 @@
+<testcase>
+<info>
+<keywords>
+FTP
+RETR
+huge response
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+mooo
+</data>
+# A long set of response strings to CWD to make sure the ftp parser deals
+# with it nicely. The length hits a boundary condition that may make curl
+# hang.
+<servercmd>
+REPLY CWD 250-AAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250 Finally, here is the response
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP with excessively large number of server command response lines (boundary condition)
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/path/1006
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD path
+EPSV
+TYPE I
+SIZE 1006
+RETR 1006
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1007 b/tests/data/test1007
new file mode 100644
index 000000000..5966ab366
--- /dev/null
+++ b/tests/data/test1007
@@ -0,0 +1,39 @@
+<testcase>
+<info>
+<keywords>
+TFTP
+TFTP WRQ
+FAILURE
+</keywords>
+</info>
+
+#
+# Client-side
+<client>
+<server>
+tftp
+</server>
+ <name>
+TFTP send with invalid permission on server
+ </name>
+ <command>
+-T log/test1007.txt tftp://%HOSTIP:%TFTPPORT//invalid-file --trace-ascii log/traceit
+</command>
+<file name="log/test1007.txt">
+This data will not be sent
+</file>
+</client>
+
+#
+# Verify pseudo protocol after the test has been "shot"
+<verify>
+<errorcode>
+69
+</errorcode>
+<protocol>
+opcode: 2
+filename: /invalid-file
+mode: octet
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1008 b/tests/data/test1008
new file mode 100644
index 000000000..5334f856e
--- /dev/null
+++ b/tests/data/test1008
@@ -0,0 +1,126 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP CONNECT
+HTTP proxy
+HTTP proxy NTLM auth
+</keywords>
+</info>
+
+# Server-side
+<reply>
+
+# this is returned first since we get no proxy-auth
+<data1001>
+HTTP/1.1 407 Authorization Required to proxy me my dear
+Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+Transfer-Encoding: chunked
+
+20
+And you should ignore this data.
+FA0
+XXXXXXXXXXXXXXXXXXXXXXXXXXXXX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XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+0
+
+</data1001>
+
+# This is supposed to be returned when the server gets the second
+# Authorization: NTLM line passed-in from the client
+<data1002>
+HTTP/1.1 200 Things are fine in proxy land
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+
+</data1002>
+
+# this is returned when we get a GET!
+<data2>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 7
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+daniel
+</data2>
+
+# then this is returned when we get proxy-auth
+<data1000>
+HTTP/1.1 200 OK swsbounce
+Server: no
+
+Nice proxy auth sir!
+</data1000>
+
+<datacheck>
+HTTP/1.1 407 Authorization Required to proxy me my dear
+Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+Transfer-Encoding: chunked
+
+HTTP/1.1 200 Things are fine in proxy land
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 7
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+daniel
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+NTLM
+</features>
+ <name>
+HTTP proxy CONNECT auth NTLM with chunked-encoded 407 response
+ </name>
+ <setenv>
+# we force our own host name, in order to make the test machine independent
+CURL_GETHOSTNAME=curlhost
+# we try to use the LD_PRELOAD hack, if not a debug build
+LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
+ </setenv>
+ <command>
+http://test.remote.haxx.se:1008/path/10080002 --proxy http://%HOSTIP:%HTTPPORT --proxy-user silly:person --proxy-ntlm --proxytunnel
+</command>
+<precheck>
+chkhostname curlhost
+</precheck>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent: curl/.*
+</strip>
+<protocol>
+CONNECT test.remote.haxx.se:1008 HTTP/1.1
+Host: test.remote.haxx.se:1008
+Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
+Proxy-Connection: Keep-Alive
+
+CONNECT test.remote.haxx.se:1008 HTTP/1.1
+Host: test.remote.haxx.se:1008
+Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAABQAFAHAAAAAIAAgAdQAAAAAAAAAAAAAABoKBAKAeQjzKtCQ7ubW8S6MN7B59436GAxPu0CVROwwNBsgxML49gcbAXLT/bU+H5wrS9XNpbGx5Y3VybGhvc3Q=
+Proxy-Connection: Keep-Alive
+
+GET /path/10080002 HTTP/1.1
+User-Agent: curl/7.12.3-CVS (i686-pc-linux-gnu) libcurl/7.12.3-CVS OpenSSL/0.9.6b zlib/1.1.4
+Host: test.remote.haxx.se:1008
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1009 b/tests/data/test1009
new file mode 100644
index 000000000..b0a93e5e0
--- /dev/null
+++ b/tests/data/test1009
@@ -0,0 +1,44 @@
+<testcase>
+<info>
+<keywords>
+TFTP
+TFTP RRQ
+--local-port
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+a chunk of
+data
+returned
+ to client
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+tftp
+</server>
+ <name>
+TFTP retrieve with --local-port
+ </name>
+ <command>
+tftp://%HOSTIP:%TFTPPORT//1009 --local-port 44444-45444
+</command>
+</client>
+
+#
+# Verify pseudo protocol after the test has been "shot"
+<verify>
+<protocol>
+opcode: 1
+filename: /1009
+mode: octet
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test101 b/tests/data/test101
new file mode 100644
index 000000000..815292b2c
--- /dev/null
+++ b/tests/data/test101
@@ -0,0 +1,58 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PORT
+LIST
+</keywords>
+</info>
+# Server-side
+<reply>
+# When doing LIST, we get the default list output hard-coded in the test
+# FTP server
+<datacheck>
+total 20
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
+drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
+-r--r--r-- 1 0 1 35 Jul 16 1996 README
+lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
+dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
+drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
+dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
+drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
+dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP dir list, PORT with specified IP
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/ -P %CLIENTIP
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+# Strip all valid kinds of PORT and EPRT that curl can send
+<strip>
+^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
+^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
+</strip>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+PORT 127,0,0,1,243,212
+TYPE A
+LIST
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1010 b/tests/data/test1010
new file mode 100644
index 000000000..1f8bf3a8e
--- /dev/null
+++ b/tests/data/test1010
@@ -0,0 +1,56 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+LIST
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+# When doing LIST, we get the default list output hard-coded in the test
+# FTP server
+<datacheck>
+total 20
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
+drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
+-r--r--r-- 1 0 1 35 Jul 16 1996 README
+lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
+dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
+drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
+dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
+drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
+dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP dir list nocwd
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT//list/this/path/1010/ --ftp-method nocwd
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE A
+LIST /list/this/path/1010/
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1011 b/tests/data/test1011
new file mode 100644
index 000000000..62ba074a1
--- /dev/null
+++ b/tests/data/test1011
@@ -0,0 +1,76 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP POST
+followlocation
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 301 OK swsclose
+Location: moo.html&testcase=/10110002
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+
+</data>
+<data2>
+HTTP/1.1 200 OK swsclose
+Location: this should be ignored
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+
+body
+</data2>
+<datacheck>
+HTTP/1.1 301 OK swsclose
+Location: moo.html&testcase=/10110002
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+
+HTTP/1.1 200 OK swsclose
+Location: this should be ignored
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+
+body
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP POST with 301 redirect
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/blah/1011 -L -d "moo"
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+POST /blah/1011 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 3
+Content-Type: application/x-www-form-urlencoded
+
+mooGET /blah/moo.html&testcase=/10110002 HTTP/1.1
+User-Agent: curl/7.10 (i686-pc-linux-gnu) libcurl/7.10 OpenSSL/0.9.6c ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1012 b/tests/data/test1012
new file mode 100644
index 000000000..6aa17156d
--- /dev/null
+++ b/tests/data/test1012
@@ -0,0 +1,79 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP POST
+followlocation
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 301 OK swsclose
+Location: moo.html&testcase=/10120002
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+
+</data>
+<data2>
+HTTP/1.1 200 OK swsclose
+Location: this should be ignored
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+
+body
+</data2>
+<datacheck>
+HTTP/1.1 301 OK swsclose
+Location: moo.html&testcase=/10120002
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+
+HTTP/1.1 200 OK swsclose
+Location: this should be ignored
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+
+body
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP POST with 301 redirect and --post301
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/blah/1012 -L -d "moo" --post301
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol nonewline="yes">
+POST /blah/1012 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 3
+Content-Type: application/x-www-form-urlencoded
+
+mooPOST /blah/moo.html&testcase=/10120002 HTTP/1.1
+User-Agent: curl/7.10 (i686-pc-linux-gnu) libcurl/7.10 OpenSSL/0.9.6c ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 3
+Content-Type: application/x-www-form-urlencoded
+
+moo
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1013 b/tests/data/test1013
new file mode 100644
index 000000000..9a1e6d4e3
--- /dev/null
+++ b/tests/data/test1013
@@ -0,0 +1,37 @@
+<testcase>
+<info>
+<keywords>
+curl-config
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+none
+</server>
+ <name>
+Compare curl --version with curl-config --protocols
+ </name>
+ <command>
+--version
+</command>
+<postcheck>
+%SRCDIR/libtest/test1013.pl ../curl-config log/stdout1013 protocols
+</postcheck>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+0
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test1014 b/tests/data/test1014
new file mode 100644
index 000000000..5116aad7c
--- /dev/null
+++ b/tests/data/test1014
@@ -0,0 +1,37 @@
+<testcase>
+<info>
+<keywords>
+curl-config
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+none
+</server>
+ <name>
+Compare curl --version with curl-config --features
+ </name>
+ <command>
+--version
+</command>
+<postcheck>
+%SRCDIR/libtest/test1013.pl ../curl-config log/stdout1014 features
+</postcheck>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+0
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test1015 b/tests/data/test1015
new file mode 100644
index 000000000..c16746646
--- /dev/null
+++ b/tests/data/test1015
@@ -0,0 +1,53 @@
+<testcase>
+<info>
+<keywords>
+--data-urlencode
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 I am cool swsclose
+Server: Cool server/10.0
+Content-Length: 0
+
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+--data-urlencode
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/1015 --data-urlencode "my name is moo[]" --data-urlencode "y e s=s_i_r" --data-urlencode "v_alue@log/1015.txt" --data-urlencode @log/1015.txt
+</command>
+<file name="log/1015.txt">
+content to _?!#$'|<>
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol nonewline="yes">
+POST /1015 HTTP/1.1
+User-Agent: curl/7.17.2-CVS (i686-pc-linux-gnu) libcurl/7.17.2-CVS OpenSSL/0.9.8g zlib/1.2.3.3 c-ares/1.5.2-CVS libidn/1.1 libssh2/0.19.0-C
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 133
+Content-Type: application/x-www-form-urlencoded
+
+my%20name%20is%20moo%5B%5D&y e s=s_i_r&v_alue=content%20to%20_%3F%21%23%24%27%7C%3C%3E%0A&content%20to%20_%3F%21%23%24%27%7C%3C%3E%0A
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1016 b/tests/data/test1016
new file mode 100644
index 000000000..b404cacb6
--- /dev/null
+++ b/tests/data/test1016
@@ -0,0 +1,39 @@
+<testcase>
+<info>
+<keywords>
+FILE
+Range
+</keywords>
+</info>
+
+<reply>
+<data>
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+none
+</server>
+<features>
+file
+</features>
+ <name>
+X-Y range on a file:// URL to stdout
+ </name>
+ <command>
+-r 1-4 file://localhost/%PWD/log/test1016.txt
+</command>
+<file name="log/test1016.txt">
+1234567890
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<stdout nonewline="yes">
+2345
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test1017 b/tests/data/test1017
new file mode 100644
index 000000000..6fbc38ab2
--- /dev/null
+++ b/tests/data/test1017
@@ -0,0 +1,40 @@
+<testcase>
+<info>
+<keywords>
+FILE
+Range
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+none
+</server>
+<features>
+file
+</features>
+ <name>
+0-Y range on a file:// URL to stdout
+ </name>
+ <command>
+-r 0-3 file://localhost/%PWD/log/test1017.txt
+</command>
+<file name="log/test1017.txt">
+1234567890
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<stdout nonewline="yes">
+1234
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test1018 b/tests/data/test1018
new file mode 100644
index 000000000..28a7027d9
--- /dev/null
+++ b/tests/data/test1018
@@ -0,0 +1,39 @@
+<testcase>
+<info>
+<keywords>
+FILE
+Range
+</keywords>
+</info>
+
+<reply>
+<data>
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+none
+</server>
+<features>
+file
+</features>
+ <name>
+X-X range on a file:// URL to stdout
+ </name>
+ <command>
+-r 4-4 file://localhost/%PWD/log/test1018.txt
+</command>
+<file name="log/test1018.txt">
+1234567890
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<stdout nonewline="yes">
+5
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test1019 b/tests/data/test1019
new file mode 100644
index 000000000..4d9872a2d
--- /dev/null
+++ b/tests/data/test1019
@@ -0,0 +1,42 @@
+<testcase>
+<info>
+<keywords>
+FILE
+Range
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+none
+</server>
+<features>
+file
+</features>
+ <name>
+X- range on a file:// URL to stdout
+ </name>
+ <command>
+-r 7- file://localhost/%PWD/log/test1019.txt
+</command>
+<file name="log/test1019.txt">
+1234567890
+1234567890
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<stdout>
+890
+1234567890
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test102 b/tests/data/test102
new file mode 100644
index 000000000..141bc0f35
--- /dev/null
+++ b/tests/data/test102
@@ -0,0 +1,52 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+RETR
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+data
+ to
+ see
+that FTP
+works
+ so does it?
+</data>
+<servercmd>
+REPLY EPSV 500 no such command
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP RETR PASV
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/102
+</command>
+
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+PASV
+TYPE I
+SIZE 102
+RETR 102
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1020 b/tests/data/test1020
new file mode 100644
index 000000000..735871d6b
--- /dev/null
+++ b/tests/data/test1020
@@ -0,0 +1,42 @@
+<testcase>
+<info>
+<keywords>
+FILE
+Range
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+none
+</server>
+<features>
+file
+</features>
+ <name>
+-Y range on a file:// URL to stdout
+ </name>
+ <command>
+-r -9 file://localhost/%PWD/log/test1020.txt
+</command>
+<file name="log/test1020.txt">
+1234567890
+1234567890
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<stdout>
+34567890
+</stdout>
+</verify>
+</testcase>
+
diff --git a/tests/data/test1021 b/tests/data/test1021
new file mode 100644
index 000000000..5ab772878
--- /dev/null
+++ b/tests/data/test1021
@@ -0,0 +1,139 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP CONNECT
+HTTP proxy
+HTTP proxy NTLM auth
+--proxy-anyauth
+</keywords>
+</info>
+# Server-side
+<reply>
+
+<data>
+HTTP/1.1 407 Authorization Required to proxy me my dear swsclose
+Proxy-Authenticate: NTLM
+Content-Length: 21
+Connection: close
+
+data to discard
+</data>
+
+# this is returned first since we get no proxy-auth
+<data1001>
+HTTP/1.1 407 Authorization Required to proxy me my dear
+Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+Content-Length: 28
+
+And you should ignore this data.
+</data1001>
+
+# This is supposed to be returned when the server gets the second
+# Authorization: NTLM line passed-in from the client
+<data1002>
+HTTP/1.1 200 Things are fine in proxy land
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+
+</data1002>
+
+# this is returned when we get a GET!
+<data2>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 7
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+daniel
+</data2>
+
+# then this is returned when we get proxy-auth
+<data1000>
+HTTP/1.1 200 OK swsbounce
+Server: no
+
+Nice proxy auth sir!
+</data1000>
+
+<datacheck>
+HTTP/1.1 407 Authorization Required to proxy me my dear swsclose
+Proxy-Authenticate: NTLM
+Content-Length: 21
+Connection: close
+
+HTTP/1.1 407 Authorization Required to proxy me my dear
+Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+Content-Length: 28
+
+HTTP/1.1 200 Things are fine in proxy land
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 7
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+daniel
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+NTLM
+</features>
+ <name>
+HTTP proxy CONNECT with any proxyauth and proxy offers NTLM and close
+ </name>
+ <setenv>
+# we force our own host name, in order to make the test machine independent
+CURL_GETHOSTNAME=curlhost
+# we try to use the LD_PRELOAD hack, if not a debug build
+LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
+ </setenv>
+ <command>
+http://test.remote.haxx.se:1021/path/10210002 --proxy http://%HOSTIP:%HTTPPORT --proxy-user silly:person --proxy-anyauth --proxytunnel
+</command>
+<precheck>
+chkhostname curlhost
+</precheck>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent: curl/.*
+</strip>
+<protocol>
+CONNECT test.remote.haxx.se:1021 HTTP/1.1
+Host: test.remote.haxx.se:1021
+Proxy-Connection: Keep-Alive
+
+CONNECT test.remote.haxx.se:1021 HTTP/1.1
+Host: test.remote.haxx.se:1021
+Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
+Proxy-Connection: Keep-Alive
+
+CONNECT test.remote.haxx.se:1021 HTTP/1.1
+Host: test.remote.haxx.se:1021
+Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAABQAFAHAAAAAIAAgAdQAAAAAAAAAAAAAABoKBAKAeQjzKtCQ7ubW8S6MN7B59436GAxPu0CVROwwNBsgxML49gcbAXLT/bU+H5wrS9XNpbGx5Y3VybGhvc3Q=
+Proxy-Connection: Keep-Alive
+
+GET /path/10210002 HTTP/1.1
+User-Agent: curl/7.12.3-CVS (i686-pc-linux-gnu) libcurl/7.12.3-CVS OpenSSL/0.9.6b zlib/1.1.4
+Host: test.remote.haxx.se:1021
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1022 b/tests/data/test1022
new file mode 100644
index 000000000..6a8b01258
--- /dev/null
+++ b/tests/data/test1022
@@ -0,0 +1,37 @@
+<testcase>
+<info>
+<keywords>
+curl-config
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+none
+</server>
+ <name>
+Compare curl --version with curl-config --version
+ </name>
+ <command>
+--version
+</command>
+<postcheck>
+%SRCDIR/libtest/test1022.pl ../curl-config log/stdout1022 version
+</postcheck>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+0
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test1023 b/tests/data/test1023
new file mode 100644
index 000000000..9c916a085
--- /dev/null
+++ b/tests/data/test1023
@@ -0,0 +1,37 @@
+<testcase>
+<info>
+<keywords>
+curl-config
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+none
+</server>
+ <name>
+Compare curl --version with curl-config --vernum
+ </name>
+ <command>
+--version
+</command>
+<postcheck>
+%SRCDIR/libtest/test1022.pl ../curl-config log/stdout1023 vernum
+</postcheck>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+0
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test1024 b/tests/data/test1024
new file mode 100644
index 000000000..086ef267a
--- /dev/null
+++ b/tests/data/test1024
@@ -0,0 +1,103 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+followlocation
+cookies
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 301 This is a weirdo text message
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Location: ../data/10240002.txt
+Set-Cookie: firstcookie=want; path=/want/
+Content-Length: 69
+
+This server reply is for testing a Location: following with cookies
+
+</data>
+<data2>
+HTTP/1.1 301 This is a weirdo text message
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Location: ../want/10240003.txt
+Set-Cookie: nextcookie=data; path=/data/
+Content-Length: 69
+
+This server reply is for testing a Location: following with cookies
+
+</data2>
+<data3>
+HTTP/1.1 200 Followed here fine
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 52
+
+If this is received, the location following worked
+
+</data3>
+<datacheck>
+HTTP/1.1 301 This is a weirdo text message
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Location: ../data/10240002.txt
+Set-Cookie: firstcookie=want; path=/want/
+Content-Length: 69
+
+HTTP/1.1 301 This is a weirdo text message
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Location: ../want/10240003.txt
+Set-Cookie: nextcookie=data; path=/data/
+Content-Length: 69
+
+HTTP/1.1 200 Followed here fine
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 52
+
+If this is received, the location following worked
+
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP Location: following with cookies
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/want/1024 -L -c log/jar1024
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /want/1024 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /data/10240002.txt HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /want/10240003.txt HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Cookie: firstcookie=want
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1025 b/tests/data/test1025
new file mode 100644
index 000000000..494f8f8d5
--- /dev/null
+++ b/tests/data/test1025
@@ -0,0 +1,105 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+followlocation
+cookies
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 301 This is a weirdo text message
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Location: ../data/10250002.txt
+Set-Cookie: firstcookie=want; path=/want/
+Content-Length: 69
+
+This server reply is for testing a Location: following with cookies
+
+</data>
+<data2>
+HTTP/1.1 301 This is a weirdo text message
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Location: ../want/10250003.txt
+Set-Cookie: nextcookie=data; path=/data/
+Content-Length: 69
+
+This server reply is for testing a Location: following with cookies
+
+</data2>
+<data3>
+HTTP/1.1 200 Followed here fine
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 52
+
+If this is received, the location following worked
+
+</data3>
+<datacheck>
+HTTP/1.1 301 This is a weirdo text message
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Location: ../data/10250002.txt
+Set-Cookie: firstcookie=want; path=/want/
+Content-Length: 69
+
+HTTP/1.1 301 This is a weirdo text message
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Location: ../want/10250003.txt
+Set-Cookie: nextcookie=data; path=/data/
+Content-Length: 69
+
+HTTP/1.1 200 Followed here fine
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 52
+
+If this is received, the location following worked
+
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP Location: following with command-line and server cookies
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/want/1025 -L -c log/jar1025 -b forcedcookie=yes
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /want/1025 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Cookie: forcedcookie=yes
+
+GET /data/10250002.txt HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Cookie: forcedcookie=yes
+
+GET /want/10250003.txt HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Cookie: firstcookie=want; forcedcookie=yes
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1026 b/tests/data/test1026
new file mode 100644
index 000000000..e47b12a0a
--- /dev/null
+++ b/tests/data/test1026
@@ -0,0 +1,39 @@
+<testcase>
+<info>
+<keywords>
+--manual
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+none
+</server>
+ <name>
+curl --manual
+ </name>
+ <command>
+--manual
+</command>
+# Search for these two sentinel lines in the manual output; if they are found,
+# then chances are good the entire manual is there.
+<postcheck>
+perl -e 'open(IN,$ARGV[0]); my $lines=grep(/(a\s*tool\s*to\s*transfer\s*data)|(mailing\s*lists\s*to\s*discuss\s*curl)/, <IN>); exit ($lines != 2); # Let this file pass an XML syntax check: </IN>' log/stdout1026
+</postcheck>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+0
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test1027 b/tests/data/test1027
new file mode 100644
index 000000000..9c3d6e3ea
--- /dev/null
+++ b/tests/data/test1027
@@ -0,0 +1,39 @@
+<testcase>
+<info>
+<keywords>
+--help
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+none
+</server>
+ <name>
+curl --help
+ </name>
+ <command>
+--help
+</command>
+# Search for these two sentinel lines in the help output; if they are found,
+# then chances are good the entire help is there.
+<postcheck>
+perl -e 'open(IN,$ARGV[0]); my $lines=grep(/(Usage: curl )|(--version\s*Show version)/, <IN>); exit ($lines != 2); # Let this file pass an XML syntax check: </IN>' log/stdout1027
+</postcheck>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+0
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test1028 b/tests/data/test1028
new file mode 100644
index 000000000..fd5162a70
--- /dev/null
+++ b/tests/data/test1028
@@ -0,0 +1,94 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+followlocation
+FTP
+PASV
+FILE
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data1>
+HTTP/1.1 302 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/html
+Funny-head: yesyes
+Location: ftp://127.0.0.1:8992/10280002
+Content-Length: 0
+Connection: close
+
+</data1>
+<data2>
+data
+ to
+ see
+that FTP
+works
+ so does it?
+</data2>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+ftp
+</server>
+ <name>
+HTTP Location: redirect to FTP URL
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/10280001 -L
+</command>
+# The data section doesn't do variable substitution, so we must assert this
+<precheck>
+perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP' ne '127.0.0.1' || '%FTPPORT' ne '8992' );"
+</precheck>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /10280001 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE I
+SIZE 10280002
+RETR 10280002
+QUIT
+</protocol>
+<stdout>
+HTTP/1.1 302 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/html
+Funny-head: yesyes
+Location: ftp://%HOSTIP:%FTPPORT/10280002
+Content-Length: 0
+Connection: close
+
+data
+ to
+ see
+that FTP
+works
+ so does it?
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test1029 b/tests/data/test1029
new file mode 100644
index 000000000..9c2bc5ff0
--- /dev/null
+++ b/tests/data/test1029
@@ -0,0 +1,58 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+redirect_url
+followlocation
+--write-out
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.1 301 This is a weirdo text message swsclose
+Location: data/10290002.txt?coolsite=yes
+Content-Length: 62
+Connection: close
+
+This server reply is for testing a simple Location: following
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP Location: and 'redirect_url' check
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/want/our/1029 -w '%{redirect_url}\n'
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /we/want/our/1029 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+<stdout mode="text">
+HTTP/1.1 301 This is a weirdo text message swsclose
+Location: data/10290002.txt?coolsite=yes
+Content-Length: 62
+Connection: close
+
+This server reply is for testing a simple Location: following
+http://%HOSTIP:%HTTPPORT/we/want/our/data/10290002.txt?coolsite=yes
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test103 b/tests/data/test103
new file mode 100644
index 000000000..15712f5da
--- /dev/null
+++ b/tests/data/test103
@@ -0,0 +1,54 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PORT
+RETR
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+data
+ to
+ see
+that FTP
+works
+ so does it?
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP RETR PORT with CWD
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/a/path/103 -P -
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+# Strip all valid kinds of PORT and EPRT that curl can send
+<strip>
+^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
+^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
+</strip>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD a
+CWD path
+PORT 127,0,0,1,0,0
+TYPE I
+SIZE 103
+RETR 103
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1030 b/tests/data/test1030
new file mode 100644
index 000000000..d05a0927a
--- /dev/null
+++ b/tests/data/test1030
@@ -0,0 +1,109 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP PUT
+HTTP Digest auth
+--anyauth
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 401 Authorization Required
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
+WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
+WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344"
+Content-Length: 26
+Content-Type: text/html; charset=iso-8859-1
+
+This is not the real page
+</data>
+
+# This is supposed to be returned when the server gets a
+# Authorization: Digest line passed-in from the client
+<data1000>
+HTTP/1.1 200 OK
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 23
+Connection: close
+
+This IS the real page!
+</data1000>
+
+<datacheck>
+HTTP/1.1 401 Authorization Required
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
+WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
+WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344"
+Content-Length: 26
+Content-Type: text/html; charset=iso-8859-1
+
+HTTP/1.1 200 OK
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 23
+Connection: close
+
+This IS the real page!
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+crypto
+</features>
+ <name>
+HTTP PUT with --anyauth authorization (picking Digest)
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/1030 -T log/put1030 -u testuser:testpass --anyauth
+</command>
+<file name="log/put1030">
+This is data we upload with PUT
+a second line
+line three
+four is the number of lines
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+PUT /1030 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 85
+Expect: 100-continue
+
+This is data we upload with PUT
+a second line
+line three
+four is the number of lines
+PUT /1030 HTTP/1.1
+Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/1030", response="01cb59db1ddaac246b072d5f5f0716d9"
+User-Agent: curl/7.10.5 (i686-pc-linux-gnu) libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 85
+Expect: 100-continue
+
+This is data we upload with PUT
+a second line
+line three
+four is the number of lines
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1031 b/tests/data/test1031
new file mode 100644
index 000000000..9cfbab5c5
--- /dev/null
+++ b/tests/data/test1031
@@ -0,0 +1,76 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+followlocation
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 301 This is a weirdo text message swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Location: ?coolsite=yes/10310002.txt
+Connection: close
+
+This server reply is for testing a simple Location: following
+
+</data>
+<data2>
+HTTP/1.1 200 Followed here fine swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 52
+
+If this is received, the location following worked
+
+</data2>
+<datacheck>
+HTTP/1.1 301 This is a weirdo text message swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Location: ?coolsite=yes/10310002.txt
+Connection: close
+
+HTTP/1.1 200 Followed here fine swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 52
+
+If this is received, the location following worked
+
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP Location: following to a query string
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/want/this/1031 -L
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /want/this/1031 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /want/this/1031?coolsite=yes/10310002.txt HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1032 b/tests/data/test1032
new file mode 100644
index 000000000..614cdbf74
--- /dev/null
+++ b/tests/data/test1032
@@ -0,0 +1,56 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP HEAD
+range
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP HEAD with --range
+ </name>
+ <command>
+--range 1-3 --head http://%HOSTIP:%HTTPPORT/1032
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+HEAD /1032 HTTP/1.1
+Range: bytes=1-3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1033 b/tests/data/test1033
new file mode 100644
index 000000000..9ad5d2526
--- /dev/null
+++ b/tests/data/test1033
@@ -0,0 +1,60 @@
+<testcase>
+#
+# This case with an unexpected 1xx response used to cause a "hang" before the fix
+# got 7.19.0
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 102 unexpected huh?!
+
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+-foo-
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET with 102 response!
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/1033
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /1033 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1034 b/tests/data/test1034
new file mode 100644
index 000000000..c47574051
--- /dev/null
+++ b/tests/data/test1034
@@ -0,0 +1,62 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP proxy
+IDN
+FAILURE
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.0 503 Service Unavailable
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/html
+Funny-head: yesyes
+
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+idn
+</features>
+<setenv>
+CHARSET=UTF-8
+</setenv>
+ <name>
+HTTP over proxy with malformatted IDN host name
+ </name>
+
+# This host name contains an invalid UTF-8 byte sequence that can't be
+# converted into an IDN name
+ <command>
+http://invalid-utf8-â.local/page/1034 -x %HOSTIP:%HTTPPORT
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET http://invalid-utf8-â.local/page/1034 HTTP/1.1
+Host: invalid-utf8-â.local
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1035 b/tests/data/test1035
new file mode 100644
index 000000000..20b434c34
--- /dev/null
+++ b/tests/data/test1035
@@ -0,0 +1,59 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP proxy
+IDN
+FAILURE
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.0 503 Service Unavailable
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/html
+Funny-head: yesyes
+
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+idn
+</features>
+<setenv>
+CHARSET=ISO8859-1
+</setenv>
+ <name>
+HTTP over proxy with too long IDN host name
+ </name>
+ <command>
+http://too-long-IDN-name-cürl-rüles-la-la-la-dee-da-flooby-nooby.local/page/1035 -x %HOSTIP:%HTTPPORT
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET http://too-long-IDN-name-cürl-rüles-la-la-la-dee-da-flooby-nooby.local/page/1035 HTTP/1.1
+Host: too-long-IDN-name-cürl-rüles-la-la-la-dee-da-flooby-nooby.local
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1036 b/tests/data/test1036
new file mode 100644
index 000000000..b8ebc4fc0
--- /dev/null
+++ b/tests/data/test1036
@@ -0,0 +1,61 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+RETR
+Resume
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data nocheck="yes">
+expected to be a file without the first part
+but we emulate that
+</data>
+<size>
+85
+</size>
+<servercmd>
+REPLY EPSV 500 no such command
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP download resume from end of file
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/1036 -C -
+</command>
+<file name="log/curl1036.out">
+This is the start!!
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+PASV
+TYPE I
+SIZE 1036
+REST 20
+RETR 1036
+QUIT
+</protocol>
+<file name="log/curl1036.out">
+This is the start!!
+expected to be a file without the first part
+but we emulate that
+</file>
+</verify>
+</testcase>
diff --git a/tests/data/test1037 b/tests/data/test1037
new file mode 100644
index 000000000..d9cdc0a66
--- /dev/null
+++ b/tests/data/test1037
@@ -0,0 +1,54 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+RETR
+Resume
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data nocheck="yes">
+expected to be a file without the first part
+but we emulate that
+</data>
+<size>
+65
+</size>
+<servercmd>
+REPLY EPSV 500 no such command
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP download resume from end of empty file
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/1037 -C -
+</command>
+<file name="log/curl1037.out">
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+PASV
+TYPE I
+SIZE 1037
+RETR 1037
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1038 b/tests/data/test1038
new file mode 100644
index 000000000..9572d78e0
--- /dev/null
+++ b/tests/data/test1038
@@ -0,0 +1,53 @@
+<testcase>
+<info>
+<keywords>
+FTP
+EPSV
+APPE
+Resume
+</keywords>
+</info>
+# Server-side
+<reply>
+<size>
+17
+</size>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP PASV upload resume from end of file
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/1038 -T log/upload1038 -C -
+</command>
+<file name="log/upload1038">
+this is the *****cr@p******** that we're gonna upload
+
+worx?
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE I
+SIZE 1038
+APPE 1038
+QUIT
+</protocol>
+<upload>
+cr@p******** that we're gonna upload
+
+worx?
+</upload>
+</verify>
+</testcase>
diff --git a/tests/data/test1039 b/tests/data/test1039
new file mode 100644
index 000000000..654d836d2
--- /dev/null
+++ b/tests/data/test1039
@@ -0,0 +1,53 @@
+<testcase>
+<info>
+<keywords>
+FTP
+EPSV
+APPE
+Resume
+</keywords>
+</info>
+# Server-side
+<reply>
+<size>
+0
+</size>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP PASV upload resume from end of empty file
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/1039 -T log/upload1039 -C -
+</command>
+<file name="log/upload1039">
+this is the *****cr@p******** that we're gonna upload
+
+worx?
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE I
+SIZE 1039
+STOR 1039
+QUIT
+</protocol>
+<upload>
+this is the *****cr@p******** that we're gonna upload
+
+worx?
+</upload>
+</verify>
+</testcase>
diff --git a/tests/data/test104 b/tests/data/test104
new file mode 100644
index 000000000..82df98aee
--- /dev/null
+++ b/tests/data/test104
@@ -0,0 +1,43 @@
+<testcase>
+<info>
+<keywords>
+FTP
+NOBODY
+</keywords>
+</info>
+# Server-side
+<reply>
+<size>
+51
+</size>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP --head to get file size only
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/a/path/104 --head
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD a
+CWD path
+MDTM 104
+TYPE I
+SIZE 104
+REST 0
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1040 b/tests/data/test1040
new file mode 100644
index 000000000..2466e7050
--- /dev/null
+++ b/tests/data/test1040
@@ -0,0 +1,79 @@
+<testcase>
+# Similar to test92
+<info>
+<keywords>
+HTTP
+HTTP GET
+Resume
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 416 Invalid range
+Connection: close
+Content-Length: 0
+
+</data>
+
+# The file data that exists at the start of the test must be included in
+# the verification.
+<datacheck>
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+HTTP/1.1 416 Invalid range
+Connection: close
+Content-Length: 0
+
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET with resume from end of entirely-downloaded file
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/1040 -C -
+</command>
+<file name="log/curl1040.out">
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /1040 HTTP/1.1
+Range: bytes=100-
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1041 b/tests/data/test1041
new file mode 100644
index 000000000..fa1692c1f
--- /dev/null
+++ b/tests/data/test1041
@@ -0,0 +1,78 @@
+<testcase>
+# Similar to test33
+<info>
+<keywords>
+HTTP
+HTTP PUT
+Resume
+Content-Range
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Accept-Ranges: bytes
+Content-Length: 0
+Connection: close
+Content-Type: text/html
+
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP PUT with resume from end of already-uploaded file
+ </name>
+<file name="log/test1041.txt">
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+</file>
+ <command>
+http://%HOSTIP:%HTTPPORT/1041 -Tlog/test1041.txt -C -
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+# curl doesn't do a HEAD request on the remote file so it has no idea whether
+# it can skip part of the file or not. Instead, it sends the entire file.
+<protocol>
+PUT /1041 HTTP/1.1
+Content-Range: bytes 0-99/100
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 100
+Expect: 100-continue
+
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1042 b/tests/data/test1042
new file mode 100644
index 000000000..d532120d9
--- /dev/null
+++ b/tests/data/test1042
@@ -0,0 +1,94 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+Resume
+FAILURE
+</keywords>
+</info>
+
+# Server-side
+<reply>
+# Some servers (e.g. Apache 1.2) respond this way to an invalid byte range
+<data>
+HTTP/1.1 200 OK
+Connection: close
+Content-Length: 100
+Content-Type: text/plain
+
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+</data>
+
+# The file data that exists at the start of the test must be included in
+# the verification.
+<datacheck>
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+HTTP/1.1 200 OK
+Connection: close
+Content-Length: 100
+Content-Type: text/plain
+
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET from end of entirely-downloaded file, no server resume
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/1042 -C -
+</command>
+<file name="log/curl1042.out">
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+33
+</errorcode>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /1042 HTTP/1.1
+Range: bytes=100-
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1043 b/tests/data/test1043
new file mode 100644
index 000000000..f9bd1057b
--- /dev/null
+++ b/tests/data/test1043
@@ -0,0 +1,84 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+Resume
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 206 Partial Content
+Date: Mon, 13 Nov 2007 13:41:09 GMT
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+Accept-Ranges: bytes
+Content-Length: 60
+Content-Range: bytes 40-99/100
+
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+</data>
+
+# The file data that exists at the start of the test must be included in
+# the verification.
+<datacheck>
+012345678
+012345678
+012345678
+012345678
+HTTP/1.1 206 Partial Content
+Date: Mon, 13 Nov 2007 13:41:09 GMT
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+Accept-Ranges: bytes
+Content-Length: 60
+Content-Range: bytes 40-99/100
+
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET with resume from end of file
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/1043 -C -
+</command>
+<file name="log/curl1043.out">
+012345678
+012345678
+012345678
+012345678
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /1043 HTTP/1.1
+Range: bytes=40-
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1044 b/tests/data/test1044
new file mode 100644
index 000000000..a95f5681d
--- /dev/null
+++ b/tests/data/test1044
@@ -0,0 +1,58 @@
+<testcase>
+# Similar to test141
+<info>
+<keywords>
+FTP
+NOBODY
+Largefile
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+</data>
+<size>
+9999999999
+</size>
+<mdtm>
+213 20080726102659
+</mdtm>
+</reply>
+
+# Client-side
+<client>
+<features>
+large_file
+</features>
+<server>
+ftp
+</server>
+ <name>
+FTP download large file info with -I
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/blalbla/1044 -I
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD blalbla
+MDTM 1044
+TYPE I
+SIZE 1044
+REST 0
+QUIT
+</protocol>
+<stdout>
+Last-Modified: Sat, 26 Jul 2008 10:26:59 GMT
+Content-Length: 9999999999
+Accept-ranges: bytes
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test1045 b/tests/data/test1045
new file mode 100644
index 000000000..fa8ad4b44
--- /dev/null
+++ b/tests/data/test1045
@@ -0,0 +1,52 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+--interface
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Mon, 28 Jul 2008 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 6
+Connection: close
+Content-Type: text/plain
+
+-foo-
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET with numeric localhost --interface
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/1045 --interface %CLIENTIP
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /1045 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1046 b/tests/data/test1046
new file mode 100644
index 000000000..bc4e5c293
--- /dev/null
+++ b/tests/data/test1046
@@ -0,0 +1,60 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+--interface
+IPv6
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Mon, 28 Jul 2008 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 6
+Connection: close
+Content-Type: text/plain
+
+-foo-
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+ipv6
+</features>
+<server>
+http-ipv6
+</server>
+ <name>
+HTTP-IPv6 GET with numeric localhost --interface
+ </name>
+ <command>
+-g "http://%HOST6IP:%HTTP6PORT/1046" --interface ::1
+</command>
+# --interface doesn't accept an address surrounded by [] so %CLIENT6IP is out
+<precheck>
+perl -e "print 'Test requires default test server host address' if ( '%CLIENT6IP' ne '[::1]' );"
+</precheck>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /1046 HTTP/1.1
+Host: %HOST6IP:%HTTP6PORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1047 b/tests/data/test1047
new file mode 100644
index 000000000..421708cc4
--- /dev/null
+++ b/tests/data/test1047
@@ -0,0 +1,58 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+LIST
+--interface
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+# When doing LIST, we get the default list output hard-coded in the test
+# FTP server
+<datacheck>
+total 20
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
+drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
+-r--r--r-- 1 0 1 35 Jul 16 1996 README
+lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
+dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
+drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
+dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
+drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
+dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP dir list PASV with localhost --interface
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/ --interface %CLIENTIP
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE A
+LIST
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1048 b/tests/data/test1048
new file mode 100644
index 000000000..cba99ba75
--- /dev/null
+++ b/tests/data/test1048
@@ -0,0 +1,66 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+LIST
+--interface
+IPv6
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+# When doing LIST, we get the default list output hard-coded in the test
+# FTP server
+<datacheck>
+total 20
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
+drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
+-r--r--r-- 1 0 1 35 Jul 16 1996 README
+lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
+dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
+drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
+dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
+drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
+dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+ipv6
+</features>
+<server>
+ftp-ipv6
+</server>
+ <name>
+FTP-IPv6 dir list PASV with localhost --interface
+ </name>
+ <command>
+-g "ftp://%HOST6IP:%FTP6PORT/" --interface ::1
+</command>
+# --interface doesn't accept an address surrounded by [] so %CLIENT6IP is out
+<precheck>
+perl -e "print 'Test requires default test server host address' if ( '%CLIENT6IP' ne '[::1]' );"
+</precheck>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE A
+LIST
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1049 b/tests/data/test1049
new file mode 100644
index 000000000..e6054a478
--- /dev/null
+++ b/tests/data/test1049
@@ -0,0 +1,44 @@
+<testcase>
+<info>
+<keywords>
+TFTP
+TFTP RRQ
+--interface
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+a chunk of
+data
+returned
+ to client
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+tftp
+</server>
+ <name>
+TFTP retrieve with localhost --interface
+ </name>
+ <command>
+tftp://%HOSTIP:%TFTPPORT//1049 --trace-ascii log/traceit --interface %CLIENTIP
+</command>
+</client>
+
+#
+# Verify pseudo protocol after the test has been "shot"
+<verify>
+<protocol>
+opcode: 1
+filename: /1049
+mode: octet
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test105 b/tests/data/test105
new file mode 100644
index 000000000..cc811aeb8
--- /dev/null
+++ b/tests/data/test105
@@ -0,0 +1,53 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+TYPE A
+RETR
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+data
+ to
+ see
+that FTP
+works
+ so does it?
+</data>
+<servercmd>
+REPLY EPSV 500 no such command
+REPLY SIZE 500 no such command
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP user+password in URL and ASCII transfer
+ </name>
+ <command>
+ftp://userdude:passfellow@%HOSTIP:%FTPPORT/105 --use-ascii
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER userdude
+PASS passfellow
+PWD
+EPSV
+PASV
+TYPE A
+SIZE 105
+RETR 105
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1050 b/tests/data/test1050
new file mode 100644
index 000000000..1abb9b1ce
--- /dev/null
+++ b/tests/data/test1050
@@ -0,0 +1,66 @@
+<testcase>
+# Similar to test 253
+<info>
+<keywords>
+FTP-ipv6
+IPv6
+EPRT
+</keywords>
+</info>
+
+# Server-side
+<reply>
+# When doing LIST, we get the default list output hard-coded in the test
+# FTP server
+<datacheck>
+total 20
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
+drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
+-r--r--r-- 1 0 1 35 Jul 16 1996 README
+lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
+dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
+drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
+dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
+drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
+dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<features>
+ipv6
+</features>
+<server>
+ftp-ipv6
+</server>
+ <name>
+FTP-IPv6 dir list, EPRT with specified IP
+ </name>
+ <command>
+-g "ftp://%HOST6IP:%FTP6PORT/" -P ::1
+</command>
+# --interface doesn't accept an address surrounded by [] so %CLIENT6IP is out
+<precheck>
+perl -e "print 'Test requires default test server host address' if ( '%CLIENT6IP' ne '[::1]' );"
+</precheck>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+# Strip all valid kinds of EPRT that curl can send
+<strippart>
+s/^(EPRT \|2\|::1\|)(.*)/$1/
+</strippart>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPRT |2|::1|
+TYPE A
+LIST
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1051 b/tests/data/test1051
new file mode 100644
index 000000000..080e1d1d5
--- /dev/null
+++ b/tests/data/test1051
@@ -0,0 +1,118 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP PUT
+followlocation
+</keywords>
+
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 301 Redirect swsclose
+Date: Thu, 29 Jul 2008 14:49:00 GMT
+Server: test-server/fake
+Location: data/10510002.txt?coolsite=yes
+Content-Length: 0
+Connection: close
+
+</data>
+<data2>
+HTTP/1.1 100 Continue
+
+HTTP/1.1 200 Followed here fine swsclose
+Date: Thu, 29 Jul 2008 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 51
+
+If this is received, the location following worked
+</data2>
+<datacheck>
+HTTP/1.1 301 Redirect swsclose
+Date: Thu, 29 Jul 2008 14:49:00 GMT
+Server: test-server/fake
+Location: data/10510002.txt?coolsite=yes
+Content-Length: 0
+Connection: close
+
+HTTP/1.1 100 Continue
+
+HTTP/1.1 200 Followed here fine swsclose
+Date: Thu, 29 Jul 2008 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 51
+
+If this is received, the location following worked
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP PUT with Location: following
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/want/1051 -L -T log/test1051.txt
+</command>
+<file name="log/test1051.txt">
+Weird
+ file
+ to
+ upload
+for
+ testing
+the
+ PUT
+ feature
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+
+# The primary reason libcurl sends the data part twice in this test is that
+# the test HTTP server is blocking until it has read the entire request,
+# including the full request-body before it responds. So in this test the
+# server says 301 and 100 _after_ the entire PUT body has been sent.
+
+<protocol>
+PUT /want/1051 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 78
+Expect: 100-continue
+
+Weird
+ file
+ to
+ upload
+for
+ testing
+the
+ PUT
+ feature
+PUT /want/data/10510002.txt?coolsite=yes HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 78
+Expect: 100-continue
+
+Weird
+ file
+ to
+ upload
+for
+ testing
+the
+ PUT
+ feature
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1052 b/tests/data/test1052
new file mode 100644
index 000000000..10c16b4a7
--- /dev/null
+++ b/tests/data/test1052
@@ -0,0 +1,111 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP PUT
+followlocation
+</keywords>
+
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.0 301 Redirect swsclose
+Date: Thu, 29 Jul 2008 14:49:00 GMT
+Server: test-server/fake
+Location: data/10520002.txt?coolsite=yes
+Content-Length: 0
+Connection: close
+
+</data>
+<data2>
+HTTP/1.0 200 Followed here fine swsclose
+Date: Thu, 29 Jul 2008 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 51
+
+If this is received, the location following worked
+</data2>
+<datacheck>
+HTTP/1.0 301 Redirect swsclose
+Date: Thu, 29 Jul 2008 14:49:00 GMT
+Server: test-server/fake
+Location: data/10520002.txt?coolsite=yes
+Content-Length: 0
+Connection: close
+
+HTTP/1.0 200 Followed here fine swsclose
+Date: Thu, 29 Jul 2008 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 51
+
+If this is received, the location following worked
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP 1.0 PUT with Location: following
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/want/1052 -0 -L -T log/test1052.txt
+</command>
+<file name="log/test1052.txt">
+Weird
+ file
+ to
+ upload
+for
+ testing
+the
+ PUT
+ feature
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+
+# The primary reason libcurl sends the data part twice in this test is that
+# the test HTTP server is blocking until it has read the entire request,
+# including the full request-body before it responds. So in this test the
+# server says 301 and 200 _after_ the entire PUT body has been sent.
+<protocol>
+PUT /want/1052 HTTP/1.0
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 78
+
+Weird
+ file
+ to
+ upload
+for
+ testing
+the
+ PUT
+ feature
+PUT /want/data/10520002.txt?coolsite=yes HTTP/1.0
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 78
+
+Weird
+ file
+ to
+ upload
+for
+ testing
+the
+ PUT
+ feature
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1053 b/tests/data/test1053
new file mode 100644
index 000000000..8c60e5ce3
--- /dev/null
+++ b/tests/data/test1053
@@ -0,0 +1,129 @@
+<testcase>
+# Based on test 9
+<info>
+<keywords>
+HTTP
+HTTP FORMPOST
+HTTP file upload
+followlocation
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 307 Redirect swsclose
+Date: Thu, 29 Jul 2008 14:49:00 GMT
+Server: test-server/fake
+Location: data/10530002.txt?coolsite=yes
+Content-Length: 0
+Connection: close
+
+</data>
+<data2>
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 11
+Connection: close
+
+blablabla
+
+</data2>
+<datacheck>
+HTTP/1.1 307 Redirect swsclose
+Date: Thu, 29 Jul 2008 14:49:00 GMT
+Server: test-server/fake
+Location: data/10530002.txt?coolsite=yes
+Content-Length: 0
+Connection: close
+
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 11
+Connection: close
+
+blablabla
+
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP RFC1867-type formposting from file with Location: following
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/want/1053 -L -F name=daniel -F tool=curl -F file=@log/test1053.txt
+</command>
+# We create this file before the command is invoked!
+<file name="log/test1053.txt">
+foo-
+This is a moo-
+bar
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^(User-Agent:|Content-Type: multipart/form-data;|------------).*
+</strip>
+<protocol>
+POST /we/want/1053 HTTP/1.1
+User-Agent: curl/7.18.2 (i686-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.7a ipv6 zlib/1.1.4
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 410
+Expect: 100-continue
+Content-Type: multipart/form-data; boundary=----------------------------9ef8d6205763
+
+------------------------------9ef8d6205763
+Content-Disposition: form-data; name="name"
+
+daniel
+------------------------------9ef8d6205763
+Content-Disposition: form-data; name="tool"
+
+curl
+------------------------------9ef8d6205763
+Content-Disposition: form-data; name="file"; filename="test1053.txt"
+Content-Type: text/plain
+
+foo-
+This is a moo-
+bar
+
+------------------------------9ef8d6205763--
+POST /we/want/data/10530002.txt?coolsite=yes HTTP/1.1
+User-Agent: curl/7.18.2 (i686-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.7a ipv6 zlib/1.1.4
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 410
+Expect: 100-continue
+Content-Type: multipart/form-data; boundary=----------------------------9ef8d6205763
+
+------------------------------9ef8d6205763
+Content-Disposition: form-data; name="name"
+
+daniel
+------------------------------9ef8d6205763
+Content-Disposition: form-data; name="tool"
+
+curl
+------------------------------9ef8d6205763
+Content-Disposition: form-data; name="file"; filename="test1053.txt"
+Content-Type: text/plain
+
+foo-
+This is a moo-
+bar
+
+------------------------------9ef8d6205763--
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1054 b/tests/data/test1054
new file mode 100644
index 000000000..54d023267
--- /dev/null
+++ b/tests/data/test1054
@@ -0,0 +1,80 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP POST
+followlocation
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 301 OK swsclose
+Location: moo/testcase/10540002
+Date: Thu, 31 Jul 2008 14:49:00 GMT
+Connection: close
+
+</data>
+<data2>
+HTTP/1.1 200 OK swsclose
+Date: Thu, 31 Jul 2008 14:49:00 GMT
+Connection: close
+
+body
+</data2>
+<datacheck>
+HTTP/1.1 301 OK swsclose
+Location: moo/testcase/10540002
+Date: Thu, 31 Jul 2008 14:49:00 GMT
+Connection: close
+
+HTTP/1.1 200 OK swsclose
+Date: Thu, 31 Jul 2008 14:49:00 GMT
+Connection: close
+
+body
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP POST from file with 301 redirect and --post301
+ </name>
+<file name="log/test1054.txt">
+field=data
+</file>
+ <command>
+http://%HOSTIP:%HTTPPORT/blah/1054 -L -d @log/test1054.txt --post301
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol nonewline="yes">
+POST /blah/1054 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 10
+Content-Type: application/x-www-form-urlencoded
+
+field=dataPOST /blah/moo/testcase/10540002 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 10
+Content-Type: application/x-www-form-urlencoded
+
+field=data
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1055 b/tests/data/test1055
new file mode 100644
index 000000000..510d490f4
--- /dev/null
+++ b/tests/data/test1055
@@ -0,0 +1,100 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP PUT
+followlocation
+FTP
+EPSV
+STOR
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 307 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/html
+Location: ftp://127.0.0.1:8992/1055
+Content-Length: 0
+Connection: close
+
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+ftp
+</server>
+ <name>
+HTTP PUT Location: redirect to FTP URL
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/1055 -L -T log/test1055.txt
+</command>
+# The data section doesn't do variable substitution, so we must assert this
+<precheck>
+perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP' ne '127.0.0.1' || '%FTPPORT' ne '8992' );"
+</precheck>
+<file name="log/test1055.txt">
+Weird
+ file
+ to
+ upload
+for
+ testing
+the
+ PUT
+ feature
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+PUT /1055 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 78
+Expect: 100-continue
+
+Weird
+ file
+ to
+ upload
+for
+ testing
+the
+ PUT
+ feature
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE I
+STOR 1055
+QUIT
+</protocol>
+<upload>
+Weird
+ file
+ to
+ upload
+for
+ testing
+the
+ PUT
+ feature
+</upload>
+</verify>
+</testcase>
diff --git a/tests/data/test1056 b/tests/data/test1056
new file mode 100644
index 000000000..52b013614
--- /dev/null
+++ b/tests/data/test1056
@@ -0,0 +1,81 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+followlocation
+IPv6
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 302 OK swsclose
+Location: http://[::1%259999]:8994/moo/10560002
+Date: Thu, 31 Jul 2008 14:49:00 GMT
+Connection: close
+
+</data>
+<data2>
+HTTP/1.1 200 OK swsclose
+Date: Thu, 31 Jul 2008 14:49:00 GMT
+Connection: close
+
+body
+</data2>
+<datacheck>
+HTTP/1.1 302 OK swsclose
+Location: http://[::1%259999]:8994/moo/10560002
+Date: Thu, 31 Jul 2008 14:49:00 GMT
+Connection: close
+
+HTTP/1.1 200 OK swsclose
+Date: Thu, 31 Jul 2008 14:49:00 GMT
+Connection: close
+
+body
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+ipv6
+</features>
+<server>
+http
+http-ipv6
+</server>
+ <name>
+HTTP follow redirect from IPv4 to IPv6 with scope
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/are/all/twits/1056 -L
+</command>
+# The data section doesn't do variable substitution, so we must assert this
+<precheck>
+perl -e "print 'Test requires default test server host and port' if ( '%HOST6IP' ne '[::1]' || '%HTTP6PORT' ne '8994' );"
+</precheck>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /we/are/all/twits/1056 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /moo/10560002 HTTP/1.1
+Host: %HOST6IP:%HTTP6PORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1057 b/tests/data/test1057
new file mode 100644
index 000000000..b4ef20c8d
--- /dev/null
+++ b/tests/data/test1057
@@ -0,0 +1,52 @@
+<testcase>
+<info>
+<keywords>
+FTP
+EPSV
+RETR
+Range
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+456789abcdef
+</data>
+<datacheck nonewline="yes">
+456789abcdef
+</datacheck>
+<size>
+64
+</size>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP retrieve a byte-range relative to end of file
+ </name>
+ <command>
+-r -12 ftp://%HOSTIP:%FTPPORT/1057
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE I
+SIZE 1057
+REST 52
+RETR 1057
+ABOR
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1058 b/tests/data/test1058
new file mode 100644
index 000000000..0731778e0
--- /dev/null
+++ b/tests/data/test1058
@@ -0,0 +1,53 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+Content-Range
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 206 Partial Content
+Date: Thu, 31 Jul 2008 13:41:09 GMT
+Accept-Ranges: bytes
+Content-Length: 101
+Content-Range: bytes 100-200/201
+Connection: close
+Content-Type: text/html
+
+..partial data returned from the
+server as a result of setting an explicit byte range
+in the request
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP range relative to end of file
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/want/1058 -r -101
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /want/1058 HTTP/1.1
+Range: bytes=-101
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1059 b/tests/data/test1059
new file mode 100644
index 000000000..5a96de61a
--- /dev/null
+++ b/tests/data/test1059
@@ -0,0 +1,58 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP CONNECT
+proxytunnel
+FTP
+FAILURE
+</keywords>
+
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 501 Method not implemented swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+Content-Length: 0
+
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+ftp
+</features>
+<server>
+http
+</server>
+ <name>
+HTTP CONNECT with proxytunnel to unsupported FTP URL
+ </name>
+ <command>
+ftp://test-number:1059/wanted/page -p -x %HOSTIP:%HTTPPORT
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+# The server doesn't implement CONNECT for ftp, so this must be a failure test
+<errorcode>
+56
+</errorcode>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+CONNECT test-number:1059 HTTP/1.1
+Host: test-number:1059
+Proxy-Connection: Keep-Alive
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test106 b/tests/data/test106
new file mode 100644
index 000000000..d1b9a81b9
--- /dev/null
+++ b/tests/data/test106
@@ -0,0 +1,51 @@
+<testcase>
+<info>
+<keywords>
+FTP
+EPSV
+TYPE A
+RETR
+type=
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+data
+ to
+ see
+that FTP
+works
+ so does it?
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP GET with type=A style ASCII URL using %20 codes
+ </name>
+ <command>
+"ftp://%HOSTIP:%FTPPORT//path%20with%20%20spaces//and%20things2/106;type=A"
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD /path with spaces
+CWD and things2
+EPSV
+TYPE A
+SIZE 106
+RETR 106
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1060 b/tests/data/test1060
new file mode 100644
index 000000000..767a7ccc9
--- /dev/null
+++ b/tests/data/test1060
@@ -0,0 +1,902 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP CONNECT
+HTTP proxy
+proxytunnel
+HTTP proxy Digest auth
+</keywords>
+</info>
+
+# Server-side
+<reply>
+
+# this is returned first since we get no proxy-auth
+<data>
+HTTP/1.1 407 Authorization Required to proxy me my dear
+Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345"
+Content-Length: 40000
+X-tra-long-header: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+</data>
+
+# this is returned when we get a GET!
+<data2>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 7
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+daniel
+</data2>
+
+# then this is returned when we get proxy-auth
+<data1000>
+HTTP/1.1 200 OK swsbounce
+Server: no
+
+Nice proxy auth sir!
+</data1000>
+
+<datacheck>
+HTTP/1.1 407 Authorization Required to proxy me my dear
+Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345"
+Content-Length: 40000
+X-tra-long-header: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaa
+
+HTTP/1.1 200 OK swsbounce
+Server: no
+
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 7
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+daniel
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+crypto
+</features>
+ <name>
+HTTP proxy CONNECT auth Digest, large headers and data
+ </name>
+ <command>
+http://test.remote.haxx.se:1060/path/10600002 --proxy http://%HOSTIP:%HTTPPORT --proxy-user silly:person --proxy-digest --proxytunnel
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent: curl/.*
+</strip>
+<protocol>
+CONNECT test.remote.haxx.se:1060 HTTP/1.1
+Host: test.remote.haxx.se:1060
+Proxy-Connection: Keep-Alive
+
+CONNECT test.remote.haxx.se:1060 HTTP/1.1
+Host: test.remote.haxx.se:1060
+Proxy-Authorization: Digest username="silly", realm="weirdorealm", nonce="12345", uri="test.remote.haxx.se:1060", response="79e394ffcd42b6c771c7582da1fc4498"
+Proxy-Connection: Keep-Alive
+
+GET /path/10600002 HTTP/1.1
+Host: test.remote.haxx.se:1060
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1061 b/tests/data/test1061
new file mode 100644
index 000000000..0fb8c5110
--- /dev/null
+++ b/tests/data/test1061
@@ -0,0 +1,907 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP CONNECT
+HTTP proxy
+chunked Transfer-Encoding
+proxytunnel
+HTTP proxy Digest auth
+</keywords>
+</info>
+
+# Server-side
+<reply>
+
+# this is returned first since we get no proxy-auth
+<data>
+HTTP/1.1 407 Authorization Required to proxy me my dear
+Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345"
+Transfer-Encoding: chunked
+X-tra-long-header: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+
+9c40
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+And you should ignore this data. aaaaaaaaaaaaaaaa
+end of 1 KB aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+
+0
+
+</data>
+
+# this is returned when we get a GET!
+<data2>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 7
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+daniel
+</data2>
+
+# then this is returned when we get proxy-auth
+<data1000>
+HTTP/1.1 200 OK swsbounce
+Server: no
+
+Nice proxy auth sir!
+</data1000>
+
+<datacheck>
+HTTP/1.1 407 Authorization Required to proxy me my dear
+Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345"
+Transfer-Encoding: chunked
+X-tra-long-header: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+
+HTTP/1.1 200 OK swsbounce
+Server: no
+
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 7
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+daniel
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+crypto
+</features>
+ <name>
+HTTP proxy CONNECT auth Digest, large headers and chunked data
+ </name>
+ <command>
+http://test.remote.haxx.se:1061/path/10610002 --proxy http://%HOSTIP:%HTTPPORT --proxy-user silly:person --proxy-digest --proxytunnel
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent: curl/.*
+</strip>
+<protocol>
+CONNECT test.remote.haxx.se:1061 HTTP/1.1
+Host: test.remote.haxx.se:1061
+Proxy-Connection: Keep-Alive
+
+CONNECT test.remote.haxx.se:1061 HTTP/1.1
+Host: test.remote.haxx.se:1061
+Proxy-Authorization: Digest username="silly", realm="weirdorealm", nonce="12345", uri="test.remote.haxx.se:1061", response="8e96acf6a6214012183879e28e73b2d3"
+Proxy-Connection: Keep-Alive
+
+GET /path/10610002 HTTP/1.1
+Host: test.remote.haxx.se:1061
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1062 b/tests/data/test1062
new file mode 100644
index 000000000..d96686e05
--- /dev/null
+++ b/tests/data/test1062
@@ -0,0 +1,49 @@
+<testcase>
+<info>
+<keywords>
+FTP
+RETR
+huge response
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+mooo
+</data>
+# a long set of response strings to CWD to make sure the ftp parser deals
+# with it nicely
+<servercmd>
+REPLY CWD 250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-A Exactly fill curl's buffer\r\n250 Finally, here is the response, boundary condition
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP with excessively long server command response lines, boundary condition
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/path/1062
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD path
+EPSV
+TYPE I
+SIZE 1062
+RETR 1062
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1063 b/tests/data/test1063
new file mode 100644
index 000000000..cc07e6bfc
--- /dev/null
+++ b/tests/data/test1063
@@ -0,0 +1,47 @@
+<testcase>
+<info>
+<keywords>
+FILE
+Range
+FAILURE
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+none
+</server>
+<features>
+file
+large_file
+</features>
+ <name>
+Invalid large X- range on a file://
+ </name>
+# This range value is 2**32+7, which will be truncated to the valid value 7
+# if the large file support is not working correctly
+ <command>
+-r 4294967303- file://localhost/%PWD/log/test1063.txt
+</command>
+<file name="log/test1063.txt">
+1234567890
+1234567890
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+36
+</errorcode>
+<stdout>
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test1064 b/tests/data/test1064
new file mode 100644
index 000000000..dd05ddf3a
--- /dev/null
+++ b/tests/data/test1064
@@ -0,0 +1,79 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP PUT
+</keywords>
+</info>
+
+<reply>
+<data nocheck="yes">
+HTTP/1.1 200 A OK
+Server: curl test
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 3
+
+ok
+</data>
+<data2 nocheck="yes">
+HTTP/1.1 200 A OK
+Server: curl test
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 9
+
+still ok
+</data2>
+</reply>
+
+# Client-side
+<client>
+#
+<server>
+http
+</server>
+ <name>
+HTTP PUT twice
+ </name>
+ <command>
+-H "Expect:" -T log/1064 http://%HOSTIP:%HTTPPORT/1064.upload1 -T log/1064 http://%HOSTIP:%HTTPPORT/10640002.upload2
+</command>
+<file name="log/1064">
+test
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+PUT /1064.upload1 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 5
+
+test
+PUT /10640002.upload2 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 5
+
+test
+</protocol>
+<stdout>
+HTTP/1.1 200 A OK
+Server: curl test
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 3
+
+ok
+HTTP/1.1 200 A OK
+Server: curl test
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 9
+
+still ok
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test1065 b/tests/data/test1065
new file mode 100644
index 000000000..5688ff964
--- /dev/null
+++ b/tests/data/test1065
@@ -0,0 +1,78 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP PUT
+HTTP GET
+</keywords>
+</info>
+
+<reply>
+<data nocheck="yes">
+HTTP/1.1 200 A OK
+Server: curl test
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 3
+
+ok
+</data>
+<data2 nocheck="yes">
+HTTP/1.1 200 A OK
+Server: curl test
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 9
+
+still ok
+</data2>
+</reply>
+
+# Client-side
+<client>
+#
+<server>
+http
+</server>
+ <name>
+HTTP PUT with one file but two URLs
+ </name>
+ <command>
+-H "Expect:" -T log/1065 http://%HOSTIP:%HTTPPORT/1065.upload1 http://%HOSTIP:%HTTPPORT/10650002.url2
+</command>
+<file name="log/1065">
+test
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+PUT /1065.upload1 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 5
+
+test
+GET /10650002.url2 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+<stdout>
+HTTP/1.1 200 A OK
+Server: curl test
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 3
+
+ok
+HTTP/1.1 200 A OK
+Server: curl test
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 9
+
+still ok
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test1066 b/tests/data/test1066
new file mode 100644
index 000000000..bacedefbb
--- /dev/null
+++ b/tests/data/test1066
@@ -0,0 +1,82 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.1 200 OK
+Server: thebest/1.0
+Content-Type: text/plain
+Content-Length: 6
+
+first
+</data>
+<data1 nocheck="yes">
+HTTP/1.1 200 OK
+Server: thebest/1.0
+Content-Type: text/plain
+Content-Length: 7
+
+second
+</data1>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP --dump-header - with two URLs
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/want/1066 http://%HOSTIP:%HTTPPORT/want/10660001 --dump-header -
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /want/1066 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /want/10660001 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+<stdout>
+HTTP/1.1 200 OK
+HTTP/1.1 200 OK
+Server: thebest/1.0
+Server: thebest/1.0
+Content-Type: text/plain
+Content-Type: text/plain
+Content-Length: 6
+Content-Length: 6
+
+
+first
+HTTP/1.1 200 OK
+HTTP/1.1 200 OK
+Server: thebest/1.0
+Server: thebest/1.0
+Content-Type: text/plain
+Content-Type: text/plain
+Content-Length: 7
+Content-Length: 7
+
+
+second
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test1067 b/tests/data/test1067
new file mode 100644
index 000000000..9fc7a6fa4
--- /dev/null
+++ b/tests/data/test1067
@@ -0,0 +1,78 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+followlocation
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 301 This is a weirdo text message swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Location: data/10670002.txt?coolsite=yes
+Connection: close
+
+This server reply is for testing a simple Location: following
+
+</data>
+<data2>
+HTTP/1.1 200 Followed here fine swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 52
+
+If this is received, the location following worked
+
+</data2>
+<datacheck>
+HTTP/1.1 301 This is a weirdo text message swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Location: data/10670002.txt?coolsite=yes
+Connection: close
+
+HTTP/1.1 200 Followed here fine swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 52
+
+If this is received, the location following worked
+
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP Location: following with auto-referer
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/want/1067 -L --referer "firstone.html;auto"
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /want/1067 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Referer: firstone.html
+
+GET /want/data/10670002.txt?coolsite=yes HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Referer: http://%HOSTIP:%HTTPPORT/want/1067
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1068 b/tests/data/test1068
new file mode 100644
index 000000000..ff26d78c6
--- /dev/null
+++ b/tests/data/test1068
@@ -0,0 +1,57 @@
+<testcase>
+# Similar to test 60
+<info>
+<keywords>
+HTTP
+HTTP PUT
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.0 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+
+blablabla
+
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<name>
+HTTP PUT from stdin
+</name>
+ <command>
+http://%HOSTIP:%HTTPPORT/bzz/1068 -T -
+</command>
+<stdin>
+more than one byte
+</stdin>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+PUT /bzz/1068 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Transfer-Encoding: chunked
+Expect: 100-continue
+
+13
+more than one byte
+
+0
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1069 b/tests/data/test1069
new file mode 100644
index 000000000..c47c357d7
--- /dev/null
+++ b/tests/data/test1069
@@ -0,0 +1,36 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP PUT
+HTTP/1.0
+</keywords>
+</info>
+
+# Server-side
+<reply>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<name>
+HTTP 1.0 PUT from stdin with no content length
+</name>
+ <command>
+http://%HOSTIP:%HTTPPORT/bzz/1069 -T - -0
+</command>
+<stdin>
+this data can't be sent
+</stdin>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+25
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test107 b/tests/data/test107
new file mode 100644
index 000000000..25b645200
--- /dev/null
+++ b/tests/data/test107
@@ -0,0 +1,51 @@
+<testcase>
+<info>
+<keywords>
+FTP
+EPSV
+STOR
+</keywords>
+</info>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP PASV upload file
+ </name>
+<file name="log/test107.txt">
+data
+ to
+ see
+that FTP
+works
+ so does it?
+</file>
+ <command>
+ftp://%HOSTIP:%FTPPORT/107 -T log/test107.txt
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<upload>
+data
+ to
+ see
+that FTP
+works
+ so does it?
+</upload>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE I
+STOR 107
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1070 b/tests/data/test1070
new file mode 100644
index 000000000..d202a9c07
--- /dev/null
+++ b/tests/data/test1070
@@ -0,0 +1,65 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP POST
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 403 Go away and swsclose
+Server: test-server/fake
+Content-Type: text/html
+Content-Length: 55
+Connection: close
+
+you are not supposed to be allowed to send things here
+</data>
+<servercmd>
+skip: 2300
+</servercmd>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP POST with server closing connection before (all) data is received
+ </name>
+ <command>
+ -d @log/input1070 http://%HOSTIP:%HTTPPORT/1070
+</command>
+<file name="log/input1070">
+This creates the named file with this content before the test case is run,
+which is useful if the test case needs a file to act on. We create this file
+rather large (larger than your typical TCP packet) so that not all of it can nor
+will be sent in one go as that is kind of the point of this test!
+
+Here's 2000 x 'O':
+OOOOOOOOOOOOOOOOOOOOOOO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yes">
+POST /1070 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 2313
+Content-Type: application/x-www-form-urlencoded
+Expect: 100-continue
+
+This creates
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1071 b/tests/data/test1071
new file mode 100644
index 000000000..758457a04
--- /dev/null
+++ b/tests/data/test1071
@@ -0,0 +1,113 @@
+<testcase>
+# Authorization is used to force curl to realize that the server is
+# speaking HTTP 1.0. The request must be resent with the correct
+# authorization header, but using HTTP 1.0, not 1.1.
+<info>
+<keywords>
+HTTP
+HTTP PUT
+HTTP Digest auth
+--anyauth
+HTTP/1.0
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.0 401 Authorization Required swsclose
+Server: testcurl
+WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
+WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
+WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344"
+Content-Type: text/plain
+Content-Length: 35
+Connection: close
+
+Try again on this HTTP 1.0 server!
+</data>
+
+# This is supposed to be returned when the server gets a
+# Authorization: Digest line passed-in from the client
+<data1000>
+HTTP/1.0 200 OK swsclose
+Server: testcurl
+Content-Type: text/plain
+Content-Length: 23
+Connection: close
+
+This IS the real page!
+</data1000>
+
+<datacheck>
+HTTP/1.0 401 Authorization Required swsclose
+Server: testcurl
+WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
+WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
+WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344"
+Content-Type: text/plain
+Content-Length: 35
+Connection: close
+
+HTTP/1.0 200 OK swsclose
+Server: testcurl
+Content-Type: text/plain
+Content-Length: 23
+Connection: close
+
+This IS the real page!
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+crypto
+</features>
+ <name>
+Downgraded HTTP PUT to HTTP 1.0 with authorization
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/1071 -T log/put1071 -u testuser:testpass --anyauth
+</command>
+<file name="log/put1071">
+This is data we upload with PUT
+a second line
+line three
+four is the number of lines
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+PUT /1071 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 85
+Expect: 100-continue
+
+This is data we upload with PUT
+a second line
+line three
+four is the number of lines
+PUT /1071 HTTP/1.0
+Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/1071", response="df4cef6b52a30e65d472dd848d2055a1"
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 85
+
+This is data we upload with PUT
+a second line
+line three
+four is the number of lines
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1072 b/tests/data/test1072
new file mode 100644
index 000000000..14b6d804c
--- /dev/null
+++ b/tests/data/test1072
@@ -0,0 +1,78 @@
+<testcase>
+# Authorization is used to force curl to realize that the server is
+# speaking HTTP 1.0. The request is impossible to satisfy with HTTP 1.0
+# because chunked encoding is unavailable, so the request must fail.
+<info>
+<keywords>
+HTTP
+HTTP PUT
+HTTP Digest auth
+--anyauth
+HTTP/1.0
+chunked Transfer-Encoding
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.0 401 Authorization Required swsclose
+Server: testcurl
+WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
+WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
+WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344"
+Content-Type: text/plain
+Content-Length: 0
+Connection: close
+
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+crypto
+</features>
+ <name>
+HTTP chunked PUT to HTTP 1.0 server with authorization
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/1072 -T - -u testuser:testpass --anyauth
+</command>
+<stdin>
+This is data we upload with PUT
+it comes from stdin so MUST be sent
+with chunked encoding
+which is impossible in HTTP/1.0
+</stdin>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+25
+</errorcode>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+PUT /1072 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Transfer-Encoding: chunked
+Expect: 100-continue
+
+7a
+This is data we upload with PUT
+it comes from stdin so MUST be sent
+with chunked encoding
+which is impossible in HTTP/1.0
+
+0
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1073 b/tests/data/test1073
new file mode 100644
index 000000000..481f9098f
--- /dev/null
+++ b/tests/data/test1073
@@ -0,0 +1,72 @@
+<testcase>
+# Redirection is used to force curl to realize that the server is
+# speaking HTTP 1.0. The request is impossible to satisfy with HTTP 1.0
+# because chunked encoding is unavailable, so the request must fail.
+<info>
+<keywords>
+HTTP
+HTTP PUT
+HTTP/1.0
+followlocation
+chunked Transfer-Encoding
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.0 301 Redirect swsclose
+Server: testcurl
+Content-Type: text/plain
+Location: /newlocation/10730002
+Content-Length: 0
+Connection: close
+
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP chunked PUT to HTTP 1.0 server with redirect
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/1073 -T - -L
+</command>
+<stdin>
+This is data we upload with PUT
+it comes from stdin so MUST be sent
+with chunked encoding
+which is impossible in HTTP/1.0
+</stdin>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+25
+</errorcode>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+PUT /1073 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Transfer-Encoding: chunked
+Expect: 100-continue
+
+7a
+This is data we upload with PUT
+it comes from stdin so MUST be sent
+with chunked encoding
+which is impossible in HTTP/1.0
+
+0
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1074 b/tests/data/test1074
new file mode 100644
index 000000000..3464b4183
--- /dev/null
+++ b/tests/data/test1074
@@ -0,0 +1,76 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP/1.0
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.0 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 9
+Connection: Keep-Alive
+
+surprise
+</data>
+<data1>
+HTTP/1.0 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+
+surprise2
+</data1>
+
+<postcmd>
+wait 1
+</postcmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP downgrade to HTTP/1.0 on second request
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/want/1074 http://%HOSTIP:%HTTPPORT/wantmore/10740001
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<stdout>
+HTTP/1.0 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 9
+Connection: Keep-Alive
+
+surprise
+HTTP/1.0 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+
+surprise2
+</stdout>
+
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /want/1074 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /wantmore/10740001 HTTP/1.0
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1075 b/tests/data/test1075
new file mode 100644
index 000000000..5b8f186a0
--- /dev/null
+++ b/tests/data/test1075
@@ -0,0 +1,94 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP PUT
+HTTP Basic auth
+--anyauth
+</keywords>
+</info>
+
+# Server-side
+<reply>
+# The test server provides no way to respond differently to a subsequent
+# Basic authenticated request (we really want to respond with 200 for
+# the second), so just respond with 401 for both and let curl deal with it.
+<data>
+HTTP/1.1 401 Authorization Required
+Server: testcurl
+WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
+WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
+WWW-Authenticate: X-bogus-auth realm="gimme all yer s3cr3ts"
+Content-Type: text/plain
+Content-Length: 0
+
+</data>
+<datacheck>
+HTTP/1.1 401 Authorization Required
+Server: testcurl
+WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
+WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
+WWW-Authenticate: X-bogus-auth realm="gimme all yer s3cr3ts"
+Content-Type: text/plain
+Content-Length: 0
+
+HTTP/1.1 401 Authorization Required
+Server: testcurl
+WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
+WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
+WWW-Authenticate: X-bogus-auth realm="gimme all yer s3cr3ts"
+Content-Type: text/plain
+Content-Length: 0
+
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP PUT with --anyauth authorization (picking Basic)
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/1075 -T log/put1075 -u testuser:testpass --anyauth
+</command>
+<file name="log/put1075">
+This is data we upload with PUT
+a second line
+line three
+four is the number of lines
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+PUT /1075 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 85
+Expect: 100-continue
+
+This is data we upload with PUT
+a second line
+line three
+four is the number of lines
+PUT /1075 HTTP/1.1
+Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M=
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 85
+Expect: 100-continue
+
+This is data we upload with PUT
+a second line
+line three
+four is the number of lines
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1076 b/tests/data/test1076
new file mode 100644
index 000000000..ad079eb94
--- /dev/null
+++ b/tests/data/test1076
@@ -0,0 +1,79 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP POST
+followlocation
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 302 OK swsclose
+Location: moo.html&testcase=/10760002
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+
+</data>
+<data2>
+HTTP/1.1 200 OK swsclose
+Location: this should be ignored
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+
+body
+</data2>
+<datacheck>
+HTTP/1.1 302 OK swsclose
+Location: moo.html&testcase=/10760002
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+
+HTTP/1.1 200 OK swsclose
+Location: this should be ignored
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+
+body
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP POST with 302 redirect and --post302
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/blah/1076 -L -d "moo" --post302
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol nonewline="yes">
+POST /blah/1076 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 3
+Content-Type: application/x-www-form-urlencoded
+
+mooPOST /blah/moo.html&testcase=/10760002 HTTP/1.1
+User-Agent: curl/7.10 (i686-pc-linux-gnu) libcurl/7.10 OpenSSL/0.9.6c ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 3
+Content-Type: application/x-www-form-urlencoded
+
+moo
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1077 b/tests/data/test1077
new file mode 100644
index 000000000..a3c90245a
--- /dev/null
+++ b/tests/data/test1077
@@ -0,0 +1,75 @@
+<testcase>
+<info>
+<keywords>
+FTP
+HTTP
+HTTP/1.0
+HTTP GET
+HTTP proxy
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.0 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Type: text/plain
+Content-Length: 9
+Funny-head: yesyes
+Proxy-Connection: Keep-Alive
+
+contents
+</data>
+<data2>
+HTTP/1.0 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Type: text/plain
+Content-Length: 9
+Funny-head: yesyes
+Proxy-Connection: Keep-Alive
+
+contents
+</data2>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+ftp
+</features>
+ <name>
+FTP over HTTP proxy with downgrade to HTTP 1.0
+ </name>
+ <command>
+-x %HOSTIP:%HTTPPORT ftp://%HOSTIP:%HTTPPORT/we/want/that/page/1077 ftp://%HOSTIP:%HTTPPORT/we/want/that/page/10770002
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET ftp://%HOSTIP:%HTTPPORT/we/want/that/page/1077 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+GET ftp://%HOSTIP:%HTTPPORT/we/want/that/page/10770002 HTTP/1.0
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1078 b/tests/data/test1078
new file mode 100644
index 000000000..e2355e3ae
--- /dev/null
+++ b/tests/data/test1078
@@ -0,0 +1,86 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP/1.0
+HTTP GET
+HTTP CONNECT
+HTTP proxy
+proxytunnel
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.0 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Type: text/html
+Funny-head: yesyes
+Content-Length: 9
+Connection: keep-alive
+
+contents
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP 1.0 CONNECT with proxytunnel and downgrade GET to HTTP/1.0
+ </name>
+ <command>
+--proxy1.0 %HOSTIP:%HTTPPORT -p http://%HOSTIP:%HTTPPORT/we/want/that/page/1078 http://%HOSTIP:%HTTPPORT/we/want/that/page/1078
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+CONNECT %HOSTIP:%HTTPPORT HTTP/1.0
+Host: %HOSTIP:%HTTPPORT
+Proxy-Connection: Keep-Alive
+
+GET /we/want/that/page/1078 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /we/want/that/page/1078 HTTP/1.0
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+<stdout>
+HTTP/1.1 200 Mighty fine indeed
+
+HTTP/1.0 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Type: text/html
+Funny-head: yesyes
+Content-Length: 9
+Connection: keep-alive
+
+contents
+HTTP/1.0 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Type: text/html
+Funny-head: yesyes
+Content-Length: 9
+Connection: keep-alive
+
+contents
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test1079 b/tests/data/test1079
new file mode 100644
index 000000000..c188e792e
--- /dev/null
+++ b/tests/data/test1079
@@ -0,0 +1,75 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP Digest auth
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 401 Authorization Required swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"
+Content-Type: text/plain; charset=iso-8859-1
+Content-Length: 26
+
+This is not the real page
+</data>
+
+# This is supposed to be returned when the server gets a
+# Authorization: Digest line passed-in from the client
+# Send nothing to force an error code 52 reply
+<data1000>
+</data1000>
+
+<datacheck>
+HTTP/1.1 401 Authorization Required swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"
+Content-Type: text/plain; charset=iso-8859-1
+Content-Length: 26
+
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+crypto
+</features>
+ <name>
+HTTP retry after closed connection and empty response
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/1079 -u testuser:testpass --digest
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+52
+</errorcode>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /1079 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /1079 HTTP/1.1
+Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/1079", response="e340c7cdca0950462070f46ee139e9f7"
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test108 b/tests/data/test108
new file mode 100644
index 000000000..eb2ea63c1
--- /dev/null
+++ b/tests/data/test108
@@ -0,0 +1,56 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PORT
+STOR
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP PORT upload with CWD
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/CWD/STOR/RETR/108 -T log/upload108 -P -
+</command>
+<file name="log/upload108">
+Moooooooooooo
+ upload this
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+# Strip all valid kinds of PORT and EPRT that curl can send
+<strip>
+^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
+^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
+</strip>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD CWD
+CWD STOR
+CWD RETR
+PORT 127,0,0,1,5,109
+TYPE I
+STOR 108
+QUIT
+</protocol>
+<upload>
+Moooooooooooo
+ upload this
+</upload>
+</verify>
+</testcase>
diff --git a/tests/data/test1080 b/tests/data/test1080
new file mode 100644
index 000000000..ae37fb7fd
--- /dev/null
+++ b/tests/data/test1080
@@ -0,0 +1,69 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+redirect_url
+followlocation
+--write-out
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.1 301 This is a weirdo text message swsclose
+Location: data/10800002.txt?coolsite=yes
+Content-Length: 62
+Connection: close
+
+This server reply is for testing a simple Location: following
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP Location: on two URLs 'redirect_url' check
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/want/our/1080 http://%HOSTIP:%HTTPPORT/we/want/our/1080 -w '%{redirect_url}\n'
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /we/want/our/1080 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /we/want/our/1080 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+<stdout mode="text">
+HTTP/1.1 301 This is a weirdo text message swsclose
+Location: data/10800002.txt?coolsite=yes
+Content-Length: 62
+Connection: close
+
+This server reply is for testing a simple Location: following
+http://%HOSTIP:%HTTPPORT/we/want/our/data/10800002.txt?coolsite=yes
+HTTP/1.1 301 This is a weirdo text message swsclose
+Location: data/10800002.txt?coolsite=yes
+Content-Length: 62
+Connection: close
+
+This server reply is for testing a simple Location: following
+http://%HOSTIP:%HTTPPORT/we/want/our/data/10800002.txt?coolsite=yes
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test1081 b/tests/data/test1081
new file mode 100644
index 000000000..d290020b6
--- /dev/null
+++ b/tests/data/test1081
@@ -0,0 +1,77 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+redirect_url
+followlocation
+--write-out
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.1 301 This is a weirdo text message swsclose
+Location: data/10810099.txt?coolsite=yes
+Content-Length: 62
+Connection: close
+
+This server reply is for testing a simple Location: following
+</data>
+<data2 nocheck="yes">
+HTTP/1.1 200 Followed here fine swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 41
+
+This second URL does not have a location
+</data2>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP no Location: on second URL 'redirect_url' check
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/want/our/1081 http://%HOSTIP:%HTTPPORT/we/want/our/10810002 -w '%{redirect_url}\n'
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /we/want/our/1081 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /we/want/our/10810002 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+<stdout mode="text">
+HTTP/1.1 301 This is a weirdo text message swsclose
+Location: data/10810099.txt?coolsite=yes
+Content-Length: 62
+Connection: close
+
+This server reply is for testing a simple Location: following
+http://%HOSTIP:%HTTPPORT/we/want/our/data/10810099.txt?coolsite=yes
+HTTP/1.1 200 Followed here fine swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 41
+
+This second URL does not have a location
+
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test1082 b/tests/data/test1082
new file mode 100644
index 000000000..d58dd25cd
--- /dev/null
+++ b/tests/data/test1082
@@ -0,0 +1,55 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+--interface
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Mon, 28 Jul 2008 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 6
+Connection: close
+Content-Type: text/plain
+
+-foo-
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET with localhost --interface
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/1082 --interface localhost
+</command>
+<precheck>
+perl -e "print 'Test requires default test server host address' if ( '%CLIENTIP' ne '127.0.0.1' );"
+</precheck>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /1082 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1083 b/tests/data/test1083
new file mode 100644
index 000000000..e441278da
--- /dev/null
+++ b/tests/data/test1083
@@ -0,0 +1,59 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+--interface
+IPv6
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Mon, 28 Jul 2008 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 6
+Connection: close
+Content-Type: text/plain
+
+-foo-
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+ipv6
+</features>
+<server>
+http-ipv6
+</server>
+ <name>
+HTTP-IPv6 GET with ip6-localhost --interface
+ </name>
+ <command>
+-g "http://%HOST6IP:%HTTP6PORT/1083" --interface ip6-localhost
+</command>
+<precheck>
+perl -e "if ('%CLIENT6IP' ne '[::1]') {print 'Test requires default test server host address';} else {exec './server/resolve --ipv6 ip6-localhost'; print 'Cannot run precheck resolve';}"
+</precheck>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /1083 HTTP/1.1
+Host: %HOST6IP:%HTTP6PORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1084 b/tests/data/test1084
new file mode 100644
index 000000000..1cfab68dc
--- /dev/null
+++ b/tests/data/test1084
@@ -0,0 +1,41 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+--interface
+FAILURE
+non-existing host
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+http
+</features>
+<server>
+none
+</server>
+ <name>
+HTTP GET with invalid --interface
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/1084 --interface non-existing-host.haxx.se.
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+45
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test1085 b/tests/data/test1085
new file mode 100644
index 000000000..db02e6033
--- /dev/null
+++ b/tests/data/test1085
@@ -0,0 +1,48 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+--interface
+IPv6
+FAILURE
+non-existing host
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+http
+ipv6
+</features>
+<server>
+none
+</server>
+ <name>
+HTTP-IPv6 GET with invalid --interface
+ </name>
+ <command>
+-g "http://%HOST6IP:%HTTP6PORT/1085" --interface non-existing-host.haxx.se.
+</command>
+# Ensure the IPv6 stack is operational before running this test (other tests
+# use the startup of the IPv6 test server as a substitute check for this).
+<precheck>
+./server/resolve --ipv6 ::1
+</precheck>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+45
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test1086 b/tests/data/test1086
new file mode 100644
index 000000000..402e1f920
--- /dev/null
+++ b/tests/data/test1086
@@ -0,0 +1,109 @@
+<testcase>
+<info>
+<keywords>
+FTP
+EPSV
+RETR
+timeout
+FAILURE
+</keywords>
+</info>
+
+# Server-side
+<reply>
+# Overload some standard FTP responses to make them shorter and faster
+# to avoid wasting time waiting for the data phase to start
+<servercmd>
+SLOWDOWN
+REPLY USER 331 OK
+REPLY PASS 230 OK
+REPLY PWD 257 "/"
+REPLY TYPE 200 OK
+</servercmd>
+<data nocheck="yes">
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+<killserver>
+ftp
+</killserver>
+ <name>
+FTP download with strict timeout and slow data transfer
+ </name>
+ <command timeout="1">
+ftp://%HOSTIP:%FTPPORT/1086 -m 7
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+# 28 is CURLE_OPERATION_TIMEDOUT
+<errorcode>
+28
+</errorcode>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE I
+SIZE 1086
+RETR 1086
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1087 b/tests/data/test1087
new file mode 100644
index 000000000..d3bec0c84
--- /dev/null
+++ b/tests/data/test1087
@@ -0,0 +1,110 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP proxy
+HTTP Basic auth
+HTTP proxy Basic auth
+followlocation
+--anyauth
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data1000 nocheck="yes">
+HTTP/1.1 401 Authorization Required
+WWW-Authenticate: Basic
+Content-Type: text/plain
+Content-Length: 0
+
+</data1000>
+<data1001 nocheck="yes">
+HTTP/1.1 302 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/plain
+Funny-head: yesyes
+Location: http://goto.second.host.now/10871002
+Content-Length: 0
+Connection: close
+
+</data1001>
+<data1002 nocheck="yes">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/plain
+Funny-head: yesyes
+Content-Length: 9
+
+contents
+</data1002>
+
+<datacheck>
+HTTP/1.1 401 Authorization Required
+WWW-Authenticate: Basic
+Content-Type: text/plain
+Content-Length: 0
+
+HTTP/1.1 302 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/plain
+Funny-head: yesyes
+Location: http://goto.second.host.now/10871002
+Content-Length: 0
+Connection: close
+
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/plain
+Funny-head: yesyes
+Content-Length: 9
+
+contents
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP, proxy with --anyauth and Location: to new host
+ </name>
+ <command>
+http://first.host.it.is/we/want/that/page/10871000 -x %HOSTIP:%HTTPPORT --user iam:myself --location --anyauth
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET http://first.host.it.is/we/want/that/page/10871000 HTTP/1.1
+Host: first.host.it.is
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+GET http://first.host.it.is/we/want/that/page/10871000 HTTP/1.1
+Authorization: Basic aWFtOm15c2VsZg==
+Host: first.host.it.is
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+GET http://goto.second.host.now/10871002 HTTP/1.1
+Host: goto.second.host.now
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1088 b/tests/data/test1088
new file mode 100644
index 000000000..13e7d03cb
--- /dev/null
+++ b/tests/data/test1088
@@ -0,0 +1,112 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP proxy
+HTTP Basic auth
+HTTP proxy Basic auth
+followlocation
+--anyauth
+--location-trusted
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data1000 nocheck="yes">
+HTTP/1.1 401 Authorization Required
+WWW-Authenticate: Basic
+Content-Type: text/plain
+Content-Length: 0
+
+</data1000>
+<data1001 nocheck="yes">
+HTTP/1.1 302 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/plain
+Funny-head: yesyes
+Location: http://goto.second.host.now/10881002
+Content-Length: 0
+Connection: close
+
+</data1001>
+<data1003 nocheck="yes">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/plain
+Funny-head: yesyes
+Content-Length: 9
+
+contents
+</data1003>
+
+<datacheck>
+HTTP/1.1 401 Authorization Required
+WWW-Authenticate: Basic
+Content-Type: text/plain
+Content-Length: 0
+
+HTTP/1.1 302 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/plain
+Funny-head: yesyes
+Location: http://goto.second.host.now/10881002
+Content-Length: 0
+Connection: close
+
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/plain
+Funny-head: yesyes
+Content-Length: 9
+
+contents
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP, proxy with --anyauth and Location: to new host using location-trusted
+ </name>
+ <command>
+http://first.host.it.is/we/want/that/page/10881000 -x %HOSTIP:%HTTPPORT --user iam:myself --location-trusted --anyauth
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET http://first.host.it.is/we/want/that/page/10881000 HTTP/1.1
+Host: first.host.it.is
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+GET http://first.host.it.is/we/want/that/page/10881000 HTTP/1.1
+Authorization: Basic aWFtOm15c2VsZg==
+Host: first.host.it.is
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+GET http://goto.second.host.now/10881002 HTTP/1.1
+Authorization: Basic aWFtOm15c2VsZg==
+Host: goto.second.host.now
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1089 b/tests/data/test1089
new file mode 100644
index 000000000..d2a18a21d
--- /dev/null
+++ b/tests/data/test1089
@@ -0,0 +1,91 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+followlocation
+--write-out
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.1 302 OK swsbounce swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 8
+Connection: close
+Content-Type: text/plain
+Location: ./10890001
+
+monster
+</data>
+<data1 nocheck="yes">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 15
+Connection: close
+Content-Type: text/plain; charset=us-ascii
+
+bigger monster
+</data1>
+
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET --write-out with redirected fetch
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/1089 -w "%{num_connects}\n%{num_redirects}\n%{size_download}\n%{url_effective}\n%{content_type}\n%{response_code}\n" -L
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /1089 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /10890001 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+
+<stdout>
+HTTP/1.1 302 OK swsbounce swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 8
+Connection: close
+Content-Type: text/plain
+Location: ./10890001
+
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 15
+Connection: close
+Content-Type: text/plain; charset=us-ascii
+
+bigger monster
+2
+1
+15
+http://%HOSTIP:%HTTPPORT/10890001
+text/plain; charset=us-ascii
+200
+</stdout>
+
+</verify>
+</testcase>
diff --git a/tests/data/test109 b/tests/data/test109
new file mode 100644
index 000000000..c027885b1
--- /dev/null
+++ b/tests/data/test109
@@ -0,0 +1,48 @@
+<testcase>
+<info>
+<keywords>
+FTP
+EPSV
+APPE
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP PASV upload append
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/109 -T log/upload109 --append
+</command>
+<file name="log/upload109">
+Moooooooooooo
+ upload this
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE I
+APPE 109
+QUIT
+</protocol>
+<upload>
+Moooooooooooo
+ upload this
+</upload>
+</verify>
+</testcase>
diff --git a/tests/data/test1090 b/tests/data/test1090
new file mode 100644
index 000000000..3304f911d
--- /dev/null
+++ b/tests/data/test1090
@@ -0,0 +1,98 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+followlocation
+chunked Transfer-Encoding
+--write-out
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.1 302 OK swsbounce swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 8
+Connection: close
+Content-Type: text/plain
+Location: ./10900001
+
+monster
+</data>
+<data1 nocheck="yes">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Transfer-Encoding: chunked
+Connection: close
+Content-Type: text/plain; charset=us-ascii
+
+0007
+bigger
+0008
+monster
+
+0
+
+</data1>
+
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET --write-out with redirected fetch and chunked reply
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/1090 -w "%{num_connects}\n%{num_redirects}\n%{size_download}\n%{url_effective}\n%{content_type}\n%{response_code}\n" -L
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /1090 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /10900001 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+
+<stdout>
+HTTP/1.1 302 OK swsbounce swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 8
+Connection: close
+Content-Type: text/plain
+Location: ./10900001
+
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Transfer-Encoding: chunked
+Connection: close
+Content-Type: text/plain; charset=us-ascii
+
+bigger monster
+2
+1
+15
+http://%HOSTIP:%HTTPPORT/10900001
+text/plain; charset=us-ascii
+200
+</stdout>
+
+</verify>
+</testcase>
diff --git a/tests/data/test1091 b/tests/data/test1091
new file mode 100644
index 000000000..f3ce8608a
--- /dev/null
+++ b/tests/data/test1091
@@ -0,0 +1,46 @@
+<testcase>
+# based on test 143
+<info>
+<keywords>
+FTP
+RETR
+type=
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+bla bla bla
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP URL with type=i
+ </name>
+ <command>
+"ftp://%HOSTIP:%FTPPORT/%2ftmp/moo/1091;type=i" --use-ascii
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD /tmp
+CWD moo
+EPSV
+TYPE I
+SIZE 1091
+RETR 1091
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1092 b/tests/data/test1092
new file mode 100644
index 000000000..adef4320b
--- /dev/null
+++ b/tests/data/test1092
@@ -0,0 +1,56 @@
+<testcase>
+<info>
+<keywords>
+FTP
+HTTP
+HTTP GET
+HTTP proxy
+type=
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.0 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/html
+Funny-head: yesyes
+
+contents
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+ftp
+</features>
+ <name>
+FTP with type=i over HTTP proxy
+ </name>
+ <command>
+"ftp://%HOSTIP:%HTTPPORT/we/want/that/page/1092;type=i" --use-ascii -x %HOSTIP:%HTTPPORT
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET ftp://%HOSTIP:%HTTPPORT/we/want/that/page/1092;type=i HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1093 b/tests/data/test1093
new file mode 100644
index 000000000..dbcfd9f7a
--- /dev/null
+++ b/tests/data/test1093
@@ -0,0 +1,44 @@
+<testcase>
+<info>
+<keywords>
+TFTP
+TFTP RRQ
+mode=
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+a chunk of
+data
+returned
+ to client
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+tftp
+</server>
+ <name>
+TFTP retrieve with mode=i
+ </name>
+ <command>
+"tftp://%HOSTIP:%TFTPPORT//1093;mode=i" --use-ascii --trace-ascii log/traceit
+</command>
+</client>
+
+#
+# Verify pseudo protocol after the test has been "shot"
+<verify>
+<protocol>
+opcode: 1
+filename: /1093
+mode: octet
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1094 b/tests/data/test1094
new file mode 100644
index 000000000..29965505f
--- /dev/null
+++ b/tests/data/test1094
@@ -0,0 +1,50 @@
+<testcase>
+<info>
+<keywords>
+TFTP
+TFTP RRQ
+mode=
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+a chunk of
+data
+returned
+ to client
+</data>
+<datacheck>
+a chunk of
+data
+returned
+ to client
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+tftp
+</server>
+ <name>
+TFTP retrieve with mode=netascii
+ </name>
+ <command>
+"tftp://%HOSTIP:%TFTPPORT//1094;mode=netascii" --trace-ascii log/traceit
+</command>
+</client>
+
+#
+# Verify pseudo protocol after the test has been "shot"
+<verify>
+<protocol>
+opcode: 1
+filename: /1094
+mode: netascii
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1095 b/tests/data/test1095
new file mode 100644
index 000000000..d401b52be
--- /dev/null
+++ b/tests/data/test1095
@@ -0,0 +1,83 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP Digest auth
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 401 Authorization Required swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+WWW-Authenticate: Digest realm="test \"this\" realm!!", nonce="1053604145"
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 26
+
+This is not the real page
+</data>
+
+# This is supposed to be returned when the server gets a
+# Authorization: Digest line passed-in from the client
+<data1000>
+HTTP/1.1 200 OK swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 23
+
+This IS the real page!
+</data1000>
+
+<datacheck>
+HTTP/1.1 401 Authorization Required swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+WWW-Authenticate: Digest realm="test \"this\" realm!!", nonce="1053604145"
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 26
+
+HTTP/1.1 200 OK swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 23
+
+This IS the real page!
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+crypto
+</features>
+ <name>
+HTTP with Digest and realm with quoted quotes
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/1095 -u testuser:testpass --digest
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /1095 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /1095 HTTP/1.1
+Authorization: Digest username="testuser", realm="test \"this\" realm!!", nonce="1053604145", uri="/1095", response="a1c7931ece9e8617bae2715045e4f49f"
+User-Agent: curl/7.10.5 (i686-pc-linux-gnu) libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1096 b/tests/data/test1096
new file mode 100644
index 000000000..30748c1b4
--- /dev/null
+++ b/tests/data/test1096
@@ -0,0 +1,50 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+RETR
+FAILURE
+</keywords>
+</info>
+# Server-side
+<reply>
+<servercmd>
+REPLY RETR 550 no such file!
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+Two FTP downloads, with failed RETR but re-used control connection
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/dir/1096 ftp://%HOSTIP:%FTPPORT/dir/1096
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+78
+</errorcode>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD dir
+EPSV
+TYPE I
+SIZE 1096
+RETR 1096
+EPSV
+SIZE 1096
+RETR 1096
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1097 b/tests/data/test1097
new file mode 100644
index 000000000..ebb039962
--- /dev/null
+++ b/tests/data/test1097
@@ -0,0 +1,79 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP POST
+HTTP CONNECT
+HTTP proxy
+HTTP proxy NTLM auth
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 We are fine and cool
+Server: Apache/1.3.27 (Dorw1n) PHP/44.1.2
+Content-Length: 27
+
+This is all fine and dandy
+</data>
+<data1001>
+HTTP/1.1 200 We are fine and cool
+Server: Apache/1.3.27 (Dorw1n) PHP/44.1.2
+Content-Length: 27
+
+This is all fine and dandy
+</data1001>
+<datacheck>
+HTTP/1.1 200 We are fine and cool
+Server: Apache/1.3.27 (Dorw1n) PHP/44.1.2
+Content-Length: 27
+
+HTTP/1.1 200 We are fine and cool
+Server: Apache/1.3.27 (Dorw1n) PHP/44.1.2
+Content-Length: 27
+
+This is all fine and dandy
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+https
+</server>
+<features>
+NTLM
+</features>
+ <name>
+HTTP POST using CONNECT with --proxy-ntlm but no auth is required
+ </name>
+ <command>
+http://test.a.galaxy.far.far.away:1097/1097 --proxy http://%HOSTIP:%HTTPPORT --proxy-user foo:bar --proxy-ntlm -d "dummy=value" -p
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent: curl/.*
+</strip>
+<protocol>
+CONNECT test.a.galaxy.far.far.away:1097 HTTP/1.1
+Host: test.a.galaxy.far.far.away:1097
+Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
+User-Agent: curl/7.19.5-CVS (i686-pc-linux-gnu) libcurl/7.19.5-CVS OpenSSL/0.9.8g zlib/1.2.3.3 c-ares/1.6.1-CVS libidn/1.12 libssh2/1.0.1_CVS
+Proxy-Connection: Keep-Alive
+
+POST /1097 HTTP/1.1
+User-Agent: curl/7.19.5-CVS (i686-pc-linux-gnu) libcurl/7.19.5-CVS OpenSSL/0.9.8g zlib/1.2.3.3 c-ares/1.6.1-CVS libidn/1.12 libssh2/1.0.1_CVS
+Host: test.a.galaxy.far.far.away:1097
+Accept: */*
+Content-Length: 0
+Content-Type: application/x-www-form-urlencoded
+
+</protocol>
+
+</verify>
+</testcase>
diff --git a/tests/data/test1098 b/tests/data/test1098
new file mode 100644
index 000000000..b5c45cbc9
--- /dev/null
+++ b/tests/data/test1098
@@ -0,0 +1,73 @@
+<testcase>
+<info>
+<keywords>
+FTP
+HTTP proxy
+CURLOPT_PROXY
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 6
+
+hello
+</data>
+
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+http
+ftp
+</features>
+ <name>
+FTP RETR twice over proxy confirming persistent connection
+ </name>
+
+ <command>
+ftp://ftp-site/moo/1098 ftp://ftp-site/moo/1098 --proxy http://%HOSTIP:%HTTPPORT
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET ftp://ftp-site/moo/1098 HTTP/1.1
+Host: ftp-site:21
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+GET ftp://ftp-site/moo/1098 HTTP/1.1
+Host: ftp-site:21
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+<stdout mode="text">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 6
+
+hello
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 6
+
+hello
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test1099 b/tests/data/test1099
new file mode 100644
index 000000000..f81e6017b
--- /dev/null
+++ b/tests/data/test1099
@@ -0,0 +1,45 @@
+<testcase>
+<info>
+<keywords>
+TFTP
+TFTP RRQ
+FAILURE
+</keywords>
+</info>
+
+<reply>
+<data nocheck="yes">
+data for 1099
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+tftp
+</server>
+ <name>
+TFTP get first a non-existing file then an existing
+ </name>
+ <command>
+tftp://%HOSTIP:%TFTPPORT/an/invalid-file tftp://%HOSTIP:%TFTPPORT//1099 --trace-ascii log/traceit
+</command>
+</client>
+
+#
+# Verify pseudo protocol after the test has been "shot"
+<verify>
+<protocol>
+opcode: 1
+filename: an/invalid-file
+mode: octet
+opcode: 1
+filename: /1099
+mode: octet
+</protocol>
+<stdout mode="text">
+data for 1099
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test11 b/tests/data/test11
new file mode 100644
index 000000000..9d93f80e0
--- /dev/null
+++ b/tests/data/test11
@@ -0,0 +1,76 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+followlocation
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 301 This is a weirdo text message swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Location: data/110002.txt?coolsite=yes
+Connection: close
+
+This server reply is for testing a simple Location: following
+
+</data>
+<data2>
+HTTP/1.1 200 Followed here fine swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 52
+
+If this is received, the location following worked
+
+</data2>
+<datacheck>
+HTTP/1.1 301 This is a weirdo text message swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Location: data/110002.txt?coolsite=yes
+Connection: close
+
+HTTP/1.1 200 Followed here fine swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 52
+
+If this is received, the location following worked
+
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+simple HTTP Location: following
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/want/11 -L
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /want/11 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /want/data/110002.txt?coolsite=yes HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test110 b/tests/data/test110
new file mode 100644
index 000000000..b63ba8a2d
--- /dev/null
+++ b/tests/data/test110
@@ -0,0 +1,52 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+RETR
+Resume
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+expected to be a file without the first part
+but we emulate that
+</data>
+<size>
+85
+</size>
+<servercmd>
+REPLY EPSV 500 no such command
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP download resume with set limit
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/110 -C 20
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+PASV
+TYPE I
+SIZE 110
+REST 20
+RETR 110
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1100 b/tests/data/test1100
new file mode 100644
index 000000000..e38c0e0d7
--- /dev/null
+++ b/tests/data/test1100
@@ -0,0 +1,116 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP POST
+HTTP NTLM auth
+</keywords>
+</info>
+# Server-side
+<reply>
+
+<data>
+HTTP/1.1 200 Thanks for this! swsclose
+Content-Length: 25
+
+This is the final page !
+</data>
+
+<data1001>
+HTTP/1.1 401 Now gimme that second request of crap
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 34
+WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+
+This is not the real page either!
+</data1001>
+
+# This is supposed to be returned when the server gets the second
+# Authorization: NTLM line passed-in from the client
+<data1002>
+HTTP/1.1 302 Thanks for this, but we want to redir you!
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Location: /1100
+Content-Length: 34
+
+This is not the real page either!
+</data1002>
+
+<datacheck>
+HTTP/1.1 401 Now gimme that second request of crap
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 34
+WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+
+HTTP/1.1 302 Thanks for this, but we want to redir you!
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Location: /1100
+Content-Length: 34
+
+HTTP/1.1 200 Thanks for this! swsclose
+Content-Length: 25
+
+This is the final page !
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+<features>
+NTLM
+</features>
+<server>
+http
+</server>
+ <name>
+HTTP POST with NTLM authorization and following a 302 redirect
+ </name>
+ <setenv>
+# we force our own host name, in order to make the test machine independent
+CURL_GETHOSTNAME=curlhost
+# we try to use the LD_PRELOAD hack, if not a debug build
+LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
+ </setenv>
+ <command>
+http://%HOSTIP:%HTTPPORT/1100 -u testuser:testpass --ntlm -L -d "stuff to send away"
+</command>
+<precheck>
+chkhostname curlhost
+</precheck>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+POST /1100 HTTP/1.1
+Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
+User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 0
+Content-Type: application/x-www-form-urlencoded
+
+POST /1100 HTTP/1.1
+Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoKBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyY3VybGhvc3Q=
+User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 18
+Content-Type: application/x-www-form-urlencoded
+
+stuff to send awayGET /1100 HTTP/1.1
+User-Agent: curl/7.19.5-CVS (i686-pc-linux-gnu) libcurl/7.19.5-CVS GnuTLS/2.6.6 zlib/1.2.3.3 c-ares/1.6.1-CVS libidn/1.14 libssh2/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1101 b/tests/data/test1101
new file mode 100644
index 000000000..63887c4bb
--- /dev/null
+++ b/tests/data/test1101
@@ -0,0 +1,54 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP Basic auth
+NO_PROXY
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 4
+Content-Type: text/html
+
+boo
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+NO_PROXY test, with user name in URL
+ </name>
+
+<setenv>
+no_proxy=%HOSTIP
+http_proxy=http://non-existing-host.haxx.se:3128/
+</setenv>
+ <command>
+http://user:secret@%HOSTIP:%HTTPPORT/gimme/1101
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /gimme/1101 HTTP/1.1
+Authorization: Basic dXNlcjpzZWNyZXQ=
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1102 b/tests/data/test1102
new file mode 100644
index 000000000..addc7b572
--- /dev/null
+++ b/tests/data/test1102
@@ -0,0 +1,51 @@
+<testcase>
+<info>
+<keywords>
+FTP
+SYST
+SITE
+OS400
+</keywords>
+</info>
+# Server-side
+<reply>
+<data nocheck="yes">
+blabla
+</data>
+<servercmd>
+REPLY PWD 257 "QGPL" is the current library
+REPLY SYST 215 OS/400 runs this server
+REPLY SITE 250 Name format set to 1
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP OS/400 server name format check
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/1102
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+SYST
+SITE NAMEFMT 1
+PWD
+EPSV
+TYPE I
+SIZE 1102
+RETR 1102
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1103 b/tests/data/test1103
new file mode 100644
index 000000000..4d45056d5
--- /dev/null
+++ b/tests/data/test1103
@@ -0,0 +1,48 @@
+<testcase>
+<info>
+<keywords>
+FTP
+SYST
+SITE
+OS400
+</keywords>
+</info>
+# Server-side
+<reply>
+<data nocheck="yes">
+blabla
+</data>
+<servercmd>
+REPLY PWD 257 "C:/somedir" is the current directory
+REPLY SYST 215 unknown-OS runs this server
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP non-OS/400 server
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/1103
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+SYST
+EPSV
+TYPE I
+SIZE 1103
+RETR 1103
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1104 b/tests/data/test1104
new file mode 100644
index 000000000..21efe3c15
--- /dev/null
+++ b/tests/data/test1104
@@ -0,0 +1,85 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP proxy
+cookies
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 301 Moved
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Location: /want/data/11040002
+Server: test-server/fake
+Set-Cookie: test=true; domain=127.0.0.1; path=/; expires=Thu Jan 1 00:00:00 GMT 1970;
+Set-Cookie: test2=true; domain=127.0.0.1; path=/; expires=Fri Feb 2 11:56:27 GMT 2035;
+Connection: close
+
+This server reply is for testing a set-cookie
+
+</data>
+<data2>
+HTTP/1.1 200 Followed here fine swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 52
+
+If this is received, the location following worked
+
+</data2>
+<datacheck>
+HTTP/1.1 301 Moved
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Location: /want/data/11040002
+Server: test-server/fake
+Set-Cookie: test=true; domain=127.0.0.1; path=/; expires=Thu Jan 1 00:00:00 GMT 1970;
+Set-Cookie: test2=true; domain=127.0.0.1; path=/; expires=Fri Feb 2 11:56:27 GMT 2035;
+Connection: close
+
+HTTP/1.1 200 Followed here fine swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 52
+
+If this is received, the location following worked
+
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP cookie expiry date at Jan 1 00:00:00 GMT 1970
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/want/1104 -L -x %HOSTIP:%HTTPPORT -c log/cookies.jar
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET http://%HOSTIP:%HTTPPORT/want/1104 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+GET http://%HOSTIP:%HTTPPORT/want/data/11040002 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Proxy-Connection: Keep-Alive
+Cookie: test2=true
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1105 b/tests/data/test1105
new file mode 100644
index 000000000..1a8f896a7
--- /dev/null
+++ b/tests/data/test1105
@@ -0,0 +1,63 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP POST
+cookies
+cookiejar
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Type: text/html
+Funny-head: yesyes swsclose
+Set-Cookie: foobar=name;
+Set-Cookie: mismatch=this; domain=127.0.0.1; path="/silly/";
+Set-Cookie: partmatch=present; domain=.0.0.1; path=/;
+
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP with cookie parser and header recording
+ </name>
+ <command>
+"http://%HOSTIP:%HTTPPORT/we/want/1105?parm1=this*that/other/thing&parm2=foobar/1105" -c log/cookie1105.txt -d "userid=myname&password=mypassword"
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol nonewline="yes">
+POST /we/want/1105?parm1=this*that/other/thing&parm2=foobar/1105 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 33
+Content-Type: application/x-www-form-urlencoded
+
+userid=myname&password=mypassword
+</protocol>
+<file name="log/cookie1105.txt">
+# Netscape HTTP Cookie File
+# http://curl.haxx.se/rfc/cookie_spec.html
+# This file was generated by libcurl! Edit at your own risk.
+
+127.0.0.1 FALSE /we/want/ FALSE 0 foobar name
+.127.0.0.1 TRUE "/silly/" FALSE 0 mismatch this
+.0.0.1 TRUE / FALSE 0 partmatch present
+</file>
+</verify>
+</testcase>
diff --git a/tests/data/test1106 b/tests/data/test1106
new file mode 100644
index 000000000..0c6bec177
--- /dev/null
+++ b/tests/data/test1106
@@ -0,0 +1,57 @@
+<testcase>
+<info>
+<keywords>
+FTP
+CURLOPT_PORT
+HTTP proxy
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Accept-Ranges: bytes
+Content-Length: 6
+
+hello
+</data>
+</reply>
+
+# Client-side
+<client>
+<features>
+ftp
+</features>
+<server>
+http
+</server>
+ <name>
+FTP URL and with ftp_proxy environment variable set
+ </name>
+
+<setenv>
+ftp_proxy=http://%HOSTIP:%HTTPPORT/
+</setenv>
+ <command>
+ftp://%HOSTIP:23456/1106
+</command>
+
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET ftp://%HOSTIP:23456/1106 HTTP/1.1
+Host: %HOSTIP:23456
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1107 b/tests/data/test1107
new file mode 100644
index 000000000..6adc6360c
--- /dev/null
+++ b/tests/data/test1107
@@ -0,0 +1,53 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+RETR
+PRET
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+data
+ to
+ see
+that FTP
+works
+ so does it?
+</data>
+<servercmd>
+REPLY PRET 200 fine
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP RETR PASV with PRET
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/1107 --ftp-pret
+</command>
+
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+PRET RETR 1107
+EPSV
+TYPE I
+SIZE 1107
+RETR 1107
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1108 b/tests/data/test1108
new file mode 100644
index 000000000..7b779e11f
--- /dev/null
+++ b/tests/data/test1108
@@ -0,0 +1,45 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+RETR
+PRET
+</keywords>
+</info>
+# Server-side
+<reply>
+
+<servercmd>
+REPLY PRET 550 unkown command
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP RETR PASV with PRET not supported
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/1108 --ftp-pret
+</command>
+
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+PRET RETR 1108
+</protocol>
+# we expect that the server doesn't understand PRET
+<errorcode>
+84
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test1109 b/tests/data/test1109
new file mode 100644
index 000000000..c18ae46c6
--- /dev/null
+++ b/tests/data/test1109
@@ -0,0 +1,46 @@
+<testcase>
+# Test that the fragment is not send as part of the path.
+<info>
+<keywords>
+HTTP
+CURLOPT_URL
+</keywords>
+</info>
+
+# Server-side
+<reply name="1">
+<data>
+HTTP/1.1 200 OK
+Content-Length: 6
+
+hello
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET with URL that contains fragment after the path
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/1109#test
+</command>
+</client>
+
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /1109 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test111 b/tests/data/test111
new file mode 100644
index 000000000..bcaa55425
--- /dev/null
+++ b/tests/data/test111
@@ -0,0 +1,45 @@
+<testcase>
+<info>
+<keywords>
+FTP
+EPSV
+Resume
+FAILURE
+</keywords>
+</info>
+# Server-side
+<reply>
+<size>
+85
+</size>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP download resume beyond file size
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/111 -C 2000
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+36
+</errorcode>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE I
+SIZE 111
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1110 b/tests/data/test1110
new file mode 100644
index 000000000..90ffc41e3
--- /dev/null
+++ b/tests/data/test1110
@@ -0,0 +1,47 @@
+<testcase>
+# Test that the fragment is not send as part of the path
+# when it contains a query.
+<info>
+<keywords>
+HTTP
+CURLOPT_URL
+</keywords>
+</info>
+
+# Server-side
+<reply name="1">
+<data>
+HTTP/1.1 200 OK
+Content-Length: 6
+
+hello
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET with URL that contains a fragment after the query part
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/1110?q=foobar#fragment
+</command>
+</client>
+
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /1110?q=foobar HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1111 b/tests/data/test1111
new file mode 100644
index 000000000..77b78f75d
--- /dev/null
+++ b/tests/data/test1111
@@ -0,0 +1,47 @@
+<testcase>
+# Test that no fragment is not send as part of the path
+# when the URI contains 2 '#' (does not follow RFC 2396)
+<info>
+<keywords>
+HTTP
+CURLOPT_URL
+</keywords>
+</info>
+
+# Server-side
+<reply name="1">
+<data>
+HTTP/1.1 200 OK
+Content-Length: 6
+
+hello
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET with URL whose fragment contains a # (which is illegal)
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/1111?q=foobar#fragment#fragment2
+</command>
+</client>
+
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /1111?q=foobar HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1112 b/tests/data/test1112
new file mode 100644
index 000000000..9307d9354
--- /dev/null
+++ b/tests/data/test1112
@@ -0,0 +1,114 @@
+<testcase>
+<info>
+<keywords>
+FTPS
+EPSV
+RETR
+timeout
+FAILURE
+</keywords>
+</info>
+
+# Server-side
+<reply>
+# Overload some standard FTP responses to make them shorter and faster
+# to avoid wasting time waiting for the data phase to start
+<servercmd>
+SLOWDOWN
+REPLY USER 331 OK
+REPLY PASS 230 OK
+REPLY PWD 257 "/"
+REPLY TYPE 200 OK
+</servercmd>
+<data nocheck="yes">
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+Long chunk of data that couldn't possibly be sent in the time allotted.
+</data>
+</reply>
+
+# Client-side
+<client>
+<features>
+SSL
+</features>
+<server>
+ftps
+</server>
+<killserver>
+ftps
+</killserver>
+ <name>
+FTPS download with strict timeout and slow data transfer
+ </name>
+ <command timeout="1">
+-k --ftp-ssl-control ftps://%HOSTIP:%FTPSPORT/1112 -m 7
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+# 28 is CURLE_OPERATION_TIMEDOUT
+<errorcode>
+28
+</errorcode>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PBSZ 0
+PROT C
+PWD
+EPSV
+TYPE I
+SIZE 1112
+RETR 1112
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1113 b/tests/data/test1113
new file mode 100644
index 000000000..4d692ae38
--- /dev/null
+++ b/tests/data/test1113
@@ -0,0 +1,98 @@
+<testcase>
+<info>
+<keywords>
+FTP
+RETR
+LIST
+wildcardmatch
+ftplistparser
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data mode="text">
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+<tool>
+lib574
+</tool>
+<name>
+FTP wildcard download - changed fnmatch, 2x perform (DOS LIST response)
+</name>
+<command>
+"ftp://%HOSTIP:%FTPPORT/fully_simulated/DOS/*.txt"
+</command>
+</client>
+
+############################################
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+0
+</errorcode>
+# THERE SHOULD NOT BE "SIZE"! and one "USER/PASS"
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD fully_simulated
+CWD DOS
+EPSV
+TYPE A
+LIST
+EPSV
+TYPE I
+RETR chmod1
+EPSV
+RETR chmod2
+EPSV
+RETR chmod3
+EPSV
+RETR empty_file.dat
+EPSV
+RETR file.txt
+EPSV
+RETR someothertext.txt
+CWD /
+CWD fully_simulated
+CWD DOS
+EPSV
+TYPE A
+LIST
+EPSV
+TYPE I
+RETR chmod1
+EPSV
+RETR chmod2
+EPSV
+RETR chmod3
+EPSV
+RETR empty_file.dat
+EPSV
+RETR file.txt
+EPSV
+RETR someothertext.txt
+QUIT
+</protocol>
+<stdout mode="text">
+This file should have permissions 444
+This file should have permissions 666
+This file should have permissions 777
+This is content of file "file.txt"
+Some junk ;-) This file does not really exist.
+This file should have permissions 444
+This file should have permissions 666
+This file should have permissions 777
+This is content of file "file.txt"
+Some junk ;-) This file does not really exist.
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test1114 b/tests/data/test1114
new file mode 100644
index 000000000..8eee4293b
--- /dev/null
+++ b/tests/data/test1114
@@ -0,0 +1,136 @@
+<testcase>
+<info>
+<keywords>
+FTP
+wildcardmatch
+ftplistparser
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+<tool>
+lib576
+</tool>
+ <name>
+FTP wildcard download - skip/parser_correctness/CURLOPT_FNMATCH_FUNCTION (DOS)
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/fully_simulated/DOS/*
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+0
+</errorcode>
+<stdout mode="text">
+=============================================================
+Remains: 12
+Filename: .
+Size: 0B
+Time: 04-27-10 05:12AM
+Filetype: directory
+=============================================================
+Remains: 11
+Filename: ..
+Size: 0B
+Time: 04-23-10 03:12AM
+Filetype: directory
+=============================================================
+Remains: 10
+Filename: chmod1
+Size: 38B
+Time: 01-11-10 10:00AM
+Filetype: regular file
+Content:
+-------------------------------------------------------------
+This file should have permissions 444
+-------------------------------------------------------------
+=============================================================
+Remains: 9
+Filename: chmod2
+Size: 38B
+Time: 02-01-10 08:00AM
+Filetype: regular file
+Content:
+-------------------------------------------------------------
+This file should have permissions 666
+-------------------------------------------------------------
+=============================================================
+Remains: 8
+Filename: chmod3
+Size: 38B
+Time: 02-01-10 08:00AM
+Filetype: regular file
+Content:
+-------------------------------------------------------------
+This file should have permissions 777
+-------------------------------------------------------------
+=============================================================
+Remains: 7
+Filename: chmod4
+Size: 0B
+Time: 05-04-10 04:31AM
+Filetype: directory
+=============================================================
+Remains: 6
+Filename: chmod5
+Size: 0B
+Time: 05-04-10 04:31AM
+Filetype: directory
+=============================================================
+Remains: 5
+Filename: empty_file.dat
+Size: 0B
+Time: 04-27-10 11:01AM
+Filetype: regular file
+Content:
+-------------------------------------------------------------
+-------------------------------------------------------------
+=============================================================
+Remains: 4
+Filename: file.txt
+Size: 35B
+Time: 04-27-10 11:01AM
+Filetype: regular file
+Content:
+-------------------------------------------------------------
+This is content of file "file.txt"
+-------------------------------------------------------------
+=============================================================
+Remains: 3
+Filename: .NeXT
+Size: 0B
+Time: 01-23-05 02:05AM
+Filetype: directory
+=============================================================
+Remains: 2
+Filename: someothertext.txt
+Size: 47B
+Time: 04-27-10 11:01AM
+Filetype: regular file
+Content:
+-------------------------------------------------------------
+# THIS CONTENT WAS SKIPPED IN CHUNK_BGN CALLBACK #
+-------------------------------------------------------------
+=============================================================
+Remains: 1
+Filename: weirddir.txt
+Size: 0B
+Time: 04-23-10 03:12AM
+Filetype: directory
+=============================================================
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test1115 b/tests/data/test1115
new file mode 100644
index 000000000..0f294d4cf
--- /dev/null
+++ b/tests/data/test1115
@@ -0,0 +1,55 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP 1xx response code
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 104 Experiment
+Server: Microsoft-IIS/5.0
+Date: Sun, 03 Apr 2005 14:57:45 GMT
+X-Powered-By: ASP.NET
+
+HTTP/1.1 200 OK swsbounce
+Server: Microsoft-IIS/6.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 0
+
+</data>
+
+</reply>
+
+# Client-side
+<client>
+#
+<server>
+http
+</server>
+<features>
+crypto
+</features>
+ <name>
+HTTP GET with unexpected 1xx response
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/1115
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /1115 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1116 b/tests/data/test1116
new file mode 100644
index 000000000..a9af3e61b
--- /dev/null
+++ b/tests/data/test1116
@@ -0,0 +1,77 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+chunked Transfer-Encoding
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 funky chunky!
+Server: fakeit/0.9 fakeitbad/1.0
+Transfer-Encoding: chunked
+Connection: mooo
+
+40
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+30
+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+21;heresatest=moooo
+cccccccccccccccccccccccccccccccc
+
+0
+chunky-trailer: header data
+another-header: yes
+
+</data>
+<datacheck>
+HTTP/1.1 200 funky chunky!
+Server: fakeit/0.9 fakeitbad/1.0
+Transfer-Encoding: chunked
+Connection: mooo
+
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccc
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET with chunked trailer without Trailer:
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/1116 -D log/heads1116
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /1116 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+<file name="log/heads1116">
+HTTP/1.1 200 funky chunky!
+Server: fakeit/0.9 fakeitbad/1.0
+Transfer-Encoding: chunked
+Connection: mooo
+
+chunky-trailer: header data
+another-header: yes
+</file>
+</verify>
+
+</testcase>
diff --git a/tests/data/test1117 b/tests/data/test1117
new file mode 100644
index 000000000..5b696112b
--- /dev/null
+++ b/tests/data/test1117
@@ -0,0 +1,87 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+Range
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.1 416 Requested Range Not Satisfiable
+Date: Thu, 09 Sep 2010 14:49:00 GMT
+Accept-Ranges: bytes
+Content-Length: 115
+
+This is a long error message that is large enough that the test server is
+guaranteed to split it into two packets.
+</data>
+
+<data1>
+HTTP/1.1 206 Partial Content
+Date: Thu, 09 Sep 2010 14:49:01 GMT
+Accept-Ranges: bytes
+Content-Range: bytes 10-18/155
+Content-Length: 13
+Content-Type: text/plain
+
+partial body
+</data1>
+
+<servercmd>
+writedelay: 1
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP with invalid range then another URL
+ </name>
+ <command>
+-r 10-22 http://%HOSTIP:%HTTPPORT/want/1117 http://%HOSTIP:%HTTPPORT/wantmore/11170001
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<stdout>
+HTTP/1.1 416 Requested Range Not Satisfiable
+Date: Thu, 09 Sep 2010 14:49:00 GMT
+Accept-Ranges: bytes
+Content-Length: 115
+
+This is a long error message that is large enough that the test server is
+guaranteed to split it into two packets.
+HTTP/1.1 206 Partial Content
+Date: Thu, 09 Sep 2010 14:49:01 GMT
+Accept-Ranges: bytes
+Content-Range: bytes 10-18/155
+Content-Length: 13
+Content-Type: text/plain
+
+partial body
+</stdout>
+
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /want/1117 HTTP/1.1
+Range: bytes=10-22
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /wantmore/11170001 HTTP/1.1
+Range: bytes=10-22
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1118 b/tests/data/test1118
new file mode 100644
index 000000000..bc776aff6
--- /dev/null
+++ b/tests/data/test1118
@@ -0,0 +1,55 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+-foo-
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+URL without slash and @-letter in query
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT?email=name@example.com/1118
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /?email=name@example.com/1118 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1119 b/tests/data/test1119
new file mode 100644
index 000000000..4b5a9ec73
--- /dev/null
+++ b/tests/data/test1119
@@ -0,0 +1,24 @@
+<testcase>
+<info>
+<keywords>
+symbols-in-versions
+</keywords>
+</info>
+
+#
+# Client-side
+<client>
+<server>
+none
+</server>
+
+ <name>
+Verify that symbols-in-versions and headers are in sync
+ </name>
+
+<command type="perl">
+%SRCDIR/symbol-scan.pl %SRCDIR/.. ../include/curl
+</command>
+</client>
+
+</testcase>
diff --git a/tests/data/test112 b/tests/data/test112
new file mode 100644
index 000000000..eb3400c57
--- /dev/null
+++ b/tests/data/test112
@@ -0,0 +1,49 @@
+<testcase>
+<info>
+<keywords>
+FTP
+EPSV
+APPE
+Resume
+</keywords>
+</info>
+# Server-side
+<reply>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP PASV upload resume
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/112 -T log/upload112 -C 40
+</command>
+<file name="log/upload112">
+this is the *****crap******** that we're gonna upload
+
+worx?
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE I
+APPE 112
+QUIT
+</protocol>
+<upload>
+ gonna upload
+
+worx?
+</upload>
+</verify>
+</testcase>
diff --git a/tests/data/test1120 b/tests/data/test1120
new file mode 100644
index 000000000..ddec00a04
--- /dev/null
+++ b/tests/data/test1120
@@ -0,0 +1,44 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PORT
+RETR
+421
+</keywords>
+</info>
+# Server-side
+<reply>
+<servercmd>
+REPLY CWD 421 Timeout!
+</server>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP with 421 timeout response
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/a/path/1120
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+# Strip all valid kinds of PORT and EPRT that curl can send
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD a
+</protocol>
+# CURLE_OPERATION_TIMEDOUT is 28
+<errorcode>
+28
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test113 b/tests/data/test113
new file mode 100644
index 000000000..0046297cf
--- /dev/null
+++ b/tests/data/test113
@@ -0,0 +1,37 @@
+<testcase>
+<info>
+<keywords>
+FTP
+FAILURE
+</keywords>
+</info>
+# Server-side
+<reply>
+<servercmd>
+REPLY USER 314 bluah you fewl!
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP download, failed login: USER not valid
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/113
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+67
+</errorcode>
+<protocol>
+USER anonymous
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test114 b/tests/data/test114
new file mode 100644
index 000000000..6611aedeb
--- /dev/null
+++ b/tests/data/test114
@@ -0,0 +1,38 @@
+<testcase>
+<info>
+<keywords>
+FTP
+FAILURE
+</keywords>
+</info>
+# Server-side
+<reply>
+<servercmd>
+REPLY PASS 314 bluah you f00l!
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP download, failed login: PASS not valid
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/114
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+67
+</errorcode>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test115 b/tests/data/test115
new file mode 100644
index 000000000..f37a7e9fd
--- /dev/null
+++ b/tests/data/test115
@@ -0,0 +1,44 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+FAILURE
+</keywords>
+</info>
+# Server-side
+<reply>
+<servercmd>
+REPLY PASV 314 bluah you f00l!
+REPLY EPSV 314 bluah you f00l!
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP download, failed PASV
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/115
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+13
+</errorcode>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+PASV
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test116 b/tests/data/test116
new file mode 100644
index 000000000..bf04492f1
--- /dev/null
+++ b/tests/data/test116
@@ -0,0 +1,52 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PORT
+FAILURE
+</keywords>
+</info>
+# Server-side
+<reply>
+<servercmd>
+REPLY PORT 314 bluah you f00l!
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+# EPRT is only sent when IPv6 is enabled
+<features>
+ipv6
+</features>
+ <name>
+FTP download, failed PORT
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/116 -P 1.2.3.4
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+30
+</errorcode>
+# Strip the port number but leave the rest
+<strippart>
+s/^(PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},)\d{1,3},\d{1,3}/$1/
+s/^(EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|)\d{1,5}\|/$1/
+</strippart>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPRT |1|1.2.3.4|
+PORT 1,2,3,4,
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test117 b/tests/data/test117
new file mode 100644
index 000000000..2caad0da5
--- /dev/null
+++ b/tests/data/test117
@@ -0,0 +1,44 @@
+<testcase>
+<info>
+<keywords>
+FTP
+FAILURE
+</keywords>
+</info>
+# Server-side
+<reply>
+<servercmd>
+REPLY EPSV 314 bluah you f00l!
+REPLY TYPE 314 bluah you f00l!
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP download, failed TYPE
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/117
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+17
+</errorcode>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+PASV
+TYPE I
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test118 b/tests/data/test118
new file mode 100644
index 000000000..6cd086ca2
--- /dev/null
+++ b/tests/data/test118
@@ -0,0 +1,48 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+RETR
+FAILURE
+</keywords>
+</info>
+# Server-side
+<reply>
+<servercmd>
+REPLY RETR 314 bluah you f00l!
+REPLY EPSV 314 bluah you f00l!
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP download, failed RETR
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/118
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+19
+</errorcode>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+PASV
+TYPE I
+SIZE 118
+RETR 118
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test119 b/tests/data/test119
new file mode 100644
index 000000000..00a24287b
--- /dev/null
+++ b/tests/data/test119
@@ -0,0 +1,50 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PORT
+RETR
+FAILURE
+</keywords>
+</info>
+# Server-side
+<reply>
+<servercmd>
+REPLY RETR 314 bluah you f00l!
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP download, failed RETR with PORT
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/119 -P -
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+19
+</errorcode>
+# Strip all valid kinds of PORT and EPRT that curl can send
+<strip>
+^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
+^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
+</strip>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+TYPE I
+SIZE 119
+RETR 119
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test12 b/tests/data/test12
new file mode 100644
index 000000000..95b891aca
--- /dev/null
+++ b/tests/data/test12
@@ -0,0 +1,56 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+Content-Range
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 206 Partial Content
+Date: Mon, 13 Nov 2000 13:41:09 GMT
+Server: Apache/1.3.11 (Unix) PHP/3.0.14
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 101
+Content-Range: bytes 100-200/3527
+Connection: close
+Content-Type: text/html
+
+..partial data returned from the
+server as a result of setting an explicit byte range
+in the request
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP range support
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/want/12 -r 100-200
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /want/12 HTTP/1.1
+Range: bytes=100-200
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test120 b/tests/data/test120
new file mode 100644
index 000000000..85d49f529
--- /dev/null
+++ b/tests/data/test120
@@ -0,0 +1,53 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+RETR
+post-quote
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+data
+ to
+ see
+that FTP
+works
+ so does it?
+</data>
+<servercmd>
+REPLY EPSV 314 bluah you f00l!
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+ftp download with post-quote delete operation
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/120 -Q "-DELE file"
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+PASV
+TYPE I
+SIZE 120
+RETR 120
+DELE file
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1200 b/tests/data/test1200
new file mode 100644
index 000000000..ba1159f80
--- /dev/null
+++ b/tests/data/test1200
@@ -0,0 +1,39 @@
+<testcase>
+<info>
+<keywords>
+GOPHER
+INDEX
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+iMenu results error.host 1
+0Selector /bar bar.foo.invalid 70
+.
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+gopher
+</server>
+ <name>
+Gopher index
+ </name>
+ <command>
+gopher://%HOSTIP:%GOPHERPORT/1/1200
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+/1200
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1201 b/tests/data/test1201
new file mode 100644
index 000000000..81a9fe425
--- /dev/null
+++ b/tests/data/test1201
@@ -0,0 +1,39 @@
+<testcase>
+<info>
+<keywords>
+GOPHER
+SELECTOR
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+iMenu results error.host 1
+0Selector /selector/SELECTOR /bar bar.foo.invalid 70
+.
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+gopher
+</server>
+ <name>
+Gopher selector
+ </name>
+ <command>
+gopher://%HOSTIP:%GOPHERPORT/1/selector/SELECTOR/1201
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+/selector/SELECTOR/1201
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1202 b/tests/data/test1202
new file mode 100644
index 000000000..37d270acb
--- /dev/null
+++ b/tests/data/test1202
@@ -0,0 +1,40 @@
+<testcase>
+<info>
+<keywords>
+GOPHER
+QUERY
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+iSearch results error.host 1
+0Query query succeeded /foo foo.bar.invalid 70
+0Selector /the/search/engine /bar bar.foo.invalid 70
+.
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+gopher
+</server>
+ <name>
+Gopher query
+ </name>
+ <command>
+"gopher://%HOSTIP:%GOPHERPORT/7/the/search/engine?query%20succeeded/1202"
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+/the/search/engine query succeeded/1202
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1203 b/tests/data/test1203
new file mode 100644
index 000000000..02d094da0
--- /dev/null
+++ b/tests/data/test1203
@@ -0,0 +1,43 @@
+<testcase>
+<info>
+<keywords>
+GOPHER-ipv6
+IPv6
+INDEX
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+iMenu results error.host 1
+0Selector /bar bar.foo.invalid 70
+.
+</data>
+</reply>
+
+# Client-side
+<client>
+<features>
+ipv6
+</features>
+<server>
+gopher-ipv6
+</server>
+ <name>
+Gopher IPv6 index
+ </name>
+ <command>
+-g gopher://%HOST6IP:%GOPHER6PORT/1/moo/1203
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+/moo/1203
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test121 b/tests/data/test121
new file mode 100644
index 000000000..de7a56174
--- /dev/null
+++ b/tests/data/test121
@@ -0,0 +1,51 @@
+<testcase>
+<info>
+<keywords>
+FTP
+EPSV
+RETR
+post-quote
+pre-quote
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+data
+ to
+ see
+that FTP
+works
+ so does it?
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+ftp download with post- and pre-transfer delete operations
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/121 -Q "-DELE after_transfer" -Q "DELE before_transfer"
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+DELE before_transfer
+EPSV
+TYPE I
+SIZE 121
+RETR 121
+DELE after_transfer
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test122 b/tests/data/test122
new file mode 100644
index 000000000..fb1dd05fc
--- /dev/null
+++ b/tests/data/test122
@@ -0,0 +1,45 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+Resume
+</keywords>
+</info>
+# Server-side
+<reply>
+<size>
+5
+</size>
+<servercmd>
+REPLY EPSV 500 no such command
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP download resume with whole file already downloaded
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/122 -C 5
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+PASV
+TYPE I
+SIZE 122
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test123 b/tests/data/test123
new file mode 100644
index 000000000..4bbfce9a4
--- /dev/null
+++ b/tests/data/test123
@@ -0,0 +1,40 @@
+<testcase>
+<info>
+<keywords>
+FTP
+EPSV
+Resume
+</keywords>
+</info>
+# Server-side
+<reply>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP upload resume with whole file already downloaded
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/123 -T log/upload123 -C 51
+</command>
+<file name="log/upload123">
+--------------------------------------------------
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE I
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test124 b/tests/data/test124
new file mode 100644
index 000000000..255d8731f
--- /dev/null
+++ b/tests/data/test124
@@ -0,0 +1,47 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+RETR
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+we can still send data even if pwd fails!
+</data>
+<servercmd>
+REPLY PWD 314 bluah you f00l!
+REPLY EPSV 314 bluah you f00l!
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP download, failed PWD
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/124
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+PASV
+TYPE I
+SIZE 124
+RETR 124
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test125 b/tests/data/test125
new file mode 100644
index 000000000..5677aeb47
--- /dev/null
+++ b/tests/data/test125
@@ -0,0 +1,41 @@
+<testcase>
+<info>
+<keywords>
+FTP
+FAILURE
+</keywords>
+</info>
+# Server-side
+<reply>
+<servercmd>
+REPLY CWD 314 bluah you f00l!
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP download, failed CWD
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/path/to/file/125
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+9
+</errorcode>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD path
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test126 b/tests/data/test126
new file mode 100644
index 000000000..0872214af
--- /dev/null
+++ b/tests/data/test126
@@ -0,0 +1,48 @@
+<testcase>
+<info>
+<keywords>
+FTP
+EPSV
+RETR
+RETRWEIRDO
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+this is file contents
+</data>
+<servercmd>
+RETRWEIRDO
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP download with multiple replies at once in RETR
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/blalbla/lululul/126
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD blalbla
+CWD lululul
+EPSV
+TYPE I
+SIZE 126
+RETR 126
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test127 b/tests/data/test127
new file mode 100644
index 000000000..ac46d8d00
--- /dev/null
+++ b/tests/data/test127
@@ -0,0 +1,46 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+RETR
+--disable-epsv
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+moooooooo
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP --disable-epsv
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/path/to/file/127 --disable-epsv
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD path
+CWD to
+CWD file
+PASV
+TYPE I
+SIZE 127
+RETR 127
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test128 b/tests/data/test128
new file mode 100644
index 000000000..743cd126f
--- /dev/null
+++ b/tests/data/test128
@@ -0,0 +1,57 @@
+<testcase>
+<info>
+<keywords>
+FTP
+EPSV
+STOR
+--crlf
+</keywords>
+</info>
+# Server-side
+<reply>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP upload with --crlf
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/128 -T log/upload128 --crlf
+</command>
+<file name="log/upload128">
+file
+with unix newlines
+meant to be
+converted
+with
+the
+--crlf option
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE I
+STOR 128
+QUIT
+</protocol>
+<upload>
+file
+with unix newlines
+meant to be
+converted
+with
+the
+--crlf option
+</upload>
+</verify>
+</testcase>
diff --git a/tests/data/test129 b/tests/data/test129
new file mode 100644
index 000000000..cf1e8391d
--- /dev/null
+++ b/tests/data/test129
@@ -0,0 +1,52 @@
+<testcase>
+<info>
+<keywords>
+FTP
+EPSV
+TYPE A
+RETR
+type=
+</keywords>
+</info>
+# Server-side
+<reply>
+<size>
+37
+</size>
+<data>
+data
+ to
+ see
+that FTP
+works
+ so does it?
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP GET with type=A style ASCII URL and understated server SIZE
+ </name>
+ <command>
+"ftp://%HOSTIP:%FTPPORT/129;type=A"
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE A
+SIZE 129
+RETR 129
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test13 b/tests/data/test13
new file mode 100644
index 000000000..8f997f0af
--- /dev/null
+++ b/tests/data/test13
@@ -0,0 +1,44 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP custom request
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 Read you
+Content-Length: 29
+Deleted: suppose we got a header like this! ;-)
+
+blabla custom request result
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP custom request 'DELETE'
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/want/13 -X DELETE
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+DELETE /want/13 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test130 b/tests/data/test130
new file mode 100644
index 000000000..43ab24c09
--- /dev/null
+++ b/tests/data/test130
@@ -0,0 +1,65 @@
+<testcase>
+<info>
+<keywords>
+FTP
+EPSV
+LIST
+netrc
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+# When doing LIST, we get the default list output hard-coded in the test
+# FTP server
+<datacheck>
+total 20
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
+drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
+-r--r--r-- 1 0 1 35 Jul 16 1996 README
+lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
+dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
+drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
+dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
+drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
+dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+netrc_debug
+</features>
+<server>
+ftp
+</server>
+ <name>
+FTP (optional .netrc; no user/pass) dir list PASV
+ </name>
+ <command>
+--netrc-optional ftp://%HOSTIP:%FTPPORT/
+</command>
+<file name="log/netrc" >
+# the following two lines were created while testing curl
+machine %HOSTIP login user1 password passwd1
+machine %HOSTIP login user2 password passwd2
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER user1
+PASS passwd1
+PWD
+EPSV
+TYPE A
+LIST
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test131 b/tests/data/test131
new file mode 100644
index 000000000..4e9ba6d9a
--- /dev/null
+++ b/tests/data/test131
@@ -0,0 +1,66 @@
+<testcase>
+<info>
+<keywords>
+FTP
+EPSV
+LIST
+netrc
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+#
+# When doing LIST, we get the default list output hard-coded in the test
+# FTP server
+<datacheck>
+total 20
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
+drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
+-r--r--r-- 1 0 1 35 Jul 16 1996 README
+lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
+dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
+drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
+dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
+drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
+dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+netrc_debug
+</features>
+<server>
+ftp
+</server>
+ <name>
+FTP (optional .netrc; user/no pass) dir list PASV
+ </name>
+ <command>
+--netrc-optional ftp://user2@%HOSTIP:%FTPPORT/
+</command>
+<file name="log/netrc" >
+# the following two lines were created while testing curl
+machine %HOSTIP login user1 password passwd1
+machine %HOSTIP login user2 password passwd2
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER user2
+PASS passwd2
+PWD
+EPSV
+TYPE A
+LIST
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test132 b/tests/data/test132
new file mode 100644
index 000000000..2ff39fb9a
--- /dev/null
+++ b/tests/data/test132
@@ -0,0 +1,65 @@
+<testcase>
+<info>
+<keywords>
+FTP
+EPSV
+LIST
+netrc
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+# When doing LIST, we get the default list output hard-coded in the test
+# FTP server
+<datacheck>
+total 20
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
+drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
+-r--r--r-- 1 0 1 35 Jul 16 1996 README
+lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
+dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
+drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
+dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
+drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
+dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+netrc_debug
+</features>
+<server>
+ftp
+</server>
+ <name>
+FTP (optional .netrc; user/passwd supplied) dir list PASV
+ </name>
+ <command>
+--netrc-optional ftp://mary:mark@%HOSTIP:%FTPPORT/
+</command>
+<file name="log/netrc" >
+# the following two lines were created while testing curl
+machine %HOSTIP login user1 password passwd1
+machine %HOSTIP login user2 password passwd2
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER mary
+PASS mark
+PWD
+EPSV
+TYPE A
+LIST
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test133 b/tests/data/test133
new file mode 100644
index 000000000..2e6b2c3a4
--- /dev/null
+++ b/tests/data/test133
@@ -0,0 +1,65 @@
+<testcase>
+<info>
+<keywords>
+FTP
+EPSV
+LIST
+netrc
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+# When doing LIST, we get the default list output hard-coded in the test
+# FTP server
+<datacheck>
+total 20
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
+drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
+-r--r--r-- 1 0 1 35 Jul 16 1996 README
+lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
+dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
+drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
+dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
+drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
+dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+netrc_debug
+</features>
+<server>
+ftp
+</server>
+ <name>
+FTP (compulsory .netrc; ignored user/passwd) dir list PASV
+ </name>
+ <command>
+-n ftp://mary:mark@%HOSTIP:%FTPPORT/
+</command>
+<file name="log/netrc" >
+# the following two lines were created while testing curl
+machine %HOSTIP login user1 password passwd1
+machine %HOSTIP login user2 password passwd2
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER user1
+PASS passwd1
+PWD
+EPSV
+TYPE A
+LIST
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test134 b/tests/data/test134
new file mode 100644
index 000000000..8ff9c1902
--- /dev/null
+++ b/tests/data/test134
@@ -0,0 +1,65 @@
+<testcase>
+<info>
+<keywords>
+FTP
+EPSV
+LIST
+netrc
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+# When doing LIST, we get the default list output hard-coded in the test
+# FTP server
+<datacheck>
+total 20
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
+drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
+-r--r--r-- 1 0 1 35 Jul 16 1996 README
+lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
+dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
+drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
+dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
+drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
+dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+netrc_debug
+</features>
+<server>
+ftp
+</server>
+ <name>
+FTP (optional .netrc; programmatic user/passwd) dir list PASV
+ </name>
+ <command>
+--netrc-optional -u romulus:rhemus ftp://mary:mark@%HOSTIP:%FTPPORT/
+</command>
+<file name="log/netrc" >
+# the following two lines were created while testing curl
+machine %HOSTIP login user1 password passwd1
+machine %HOSTIP login user2 password passwd2
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER romulus
+PASS rhemus
+PWD
+EPSV
+TYPE A
+LIST
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test135 b/tests/data/test135
new file mode 100644
index 000000000..10eb0eacd
--- /dev/null
+++ b/tests/data/test135
@@ -0,0 +1,54 @@
+<testcase>
+<info>
+<keywords>
+FTP
+EPSV
+RETR
+Range
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+0123456789abcdef
+0123456789abcdef
+0123456789abcdef
+0123456789abcdef
+</data>
+<datacheck nonewline="yes">
+0123456789abc
+</datacheck>
+<size>
+64
+</size>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP retrieve a byte-range
+ </name>
+ <command>
+-r 4-16 ftp://%HOSTIP:%FTPPORT/135
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE I
+SIZE 135
+REST 4
+RETR 135
+ABOR
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test136 b/tests/data/test136
new file mode 100644
index 000000000..25940b50d
--- /dev/null
+++ b/tests/data/test136
@@ -0,0 +1,42 @@
+<testcase>
+<info>
+<keywords>
+FTP
+EPSV
+RETR
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+0123456789abcdef
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP with user and no password
+ </name>
+ <command>
+-u user: ftp://%HOSTIP:%FTPPORT/136
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER user
+PASS
+PWD
+EPSV
+TYPE I
+SIZE 136
+RETR 136
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test137 b/tests/data/test137
new file mode 100644
index 000000000..b8e2726a0
--- /dev/null
+++ b/tests/data/test137
@@ -0,0 +1,47 @@
+<testcase>
+<info>
+<keywords>
+FTP
+RETR
+--data-binary
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+this is file contents
+</data>
+<servercmd>
+RETRNOSIZE
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP download without size in RETR string
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/blalbla/lululul/137
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD blalbla
+CWD lululul
+EPSV
+TYPE I
+SIZE 137
+RETR 137
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test138 b/tests/data/test138
new file mode 100644
index 000000000..4eb73e6cf
--- /dev/null
+++ b/tests/data/test138
@@ -0,0 +1,49 @@
+<testcase>
+<info>
+<keywords>
+FTP
+RETR
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+this is file contents
+</data>
+<size>
+-1
+</size>
+<servercmd>
+RETRNOSIZE
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP download without size in RETR string and no SIZE command
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/blalbla/lululul/138
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD blalbla
+CWD lululul
+EPSV
+TYPE I
+SIZE 138
+RETR 138
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test139 b/tests/data/test139
new file mode 100644
index 000000000..15a242b66
--- /dev/null
+++ b/tests/data/test139
@@ -0,0 +1,47 @@
+<testcase>
+<info>
+<keywords>
+FTP
+RETR
+-z
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+this is file contents
+</data>
+<mdtm>
+213 20030409102659
+</mdtm>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP download a newer file with -z
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/blalbla/139 -z "1 jan 1989"
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD blalbla
+MDTM 139
+EPSV
+TYPE I
+SIZE 139
+RETR 139
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test14 b/tests/data/test14
new file mode 100644
index 000000000..21a4865b4
--- /dev/null
+++ b/tests/data/test14
@@ -0,0 +1,44 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP HEAD
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Server: thebest/1.0
+Connection: close
+
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP HEAD with Connection: close
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/want/14 -i --head
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+HEAD /want/14 HTTP/1.1
+User-Agent: curl/7.4.2-pre4 (sparc-sun-solaris2.7) libcurl 7.4.2-pre4
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test140 b/tests/data/test140
new file mode 100644
index 000000000..4d8bc85c7
--- /dev/null
+++ b/tests/data/test140
@@ -0,0 +1,42 @@
+<testcase>
+<info>
+<keywords>
+FTP
+-z
+--data-binary
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+</data>
+<mdtm>
+213 20030409102659
+</mdtm>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP download file with -z, expected to not transfer
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/blalbla/140 -z "1 jan 2004"
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD blalbla
+MDTM 140
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test141 b/tests/data/test141
new file mode 100644
index 000000000..694d87c38
--- /dev/null
+++ b/tests/data/test141
@@ -0,0 +1,52 @@
+<testcase>
+<info>
+<keywords>
+FTP
+NOBODY
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+</data>
+<size>
+42
+</size>
+<mdtm>
+213 20030409102659
+</mdtm>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP download info with -I
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/blalbla/141 -I
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD blalbla
+MDTM 141
+TYPE I
+SIZE 141
+REST 0
+QUIT
+</protocol>
+<stdout>
+Last-Modified: Wed, 09 Apr 2003 10:26:59 GMT
+Content-Length: 42
+Accept-ranges: bytes
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test142 b/tests/data/test142
new file mode 100644
index 000000000..e26aa192a
--- /dev/null
+++ b/tests/data/test142
@@ -0,0 +1,190 @@
+<testcase>
+<info>
+<keywords>
+FTP
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+many parts there are
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP URL with 150 dir levels
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/part1/part2/part3/part4/part5/part6/part7/part8/part9/part10/part11/part12/part13/part14/part15/part16/part17/part18/part19/part20/part21/part22/part23/part24/part25/part26/part27/part28/part29/part30/part31/part32/part33/part34/part35/part36/part37/part38/part39/part40/part41/part42/part43/part44/part45/part46/part47/part48/part49/part50/part51/part52/part53/part54/part55/part56/part57/part58/part59/part60/part61/part62/part63/part64/part65/part66/part67/part68/part69/part70/part71/part72/part73/part74/part75/part76/part77/part78/part79/part80/part81/part82/part83/part84/part85/part86/part87/part88/part89/part90/part91/part92/part93/part94/part95/part96/part97/part98/part99/part100/part101/part102/part103/part104/part105/part106/part107/part108/part109/part110/part111/part112/part113/part114/part115/part116/part117/part118/part119/part120/part121/part122/part123/part124/part125/part126/part127/part128/part129/part130/part131/part132/part133/part134/part135/part136/part137/part138/part139/part140/part141/part142/part143/part144/part145/part146/part147/part148/part149/part150/142
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD part1
+CWD part2
+CWD part3
+CWD part4
+CWD part5
+CWD part6
+CWD part7
+CWD part8
+CWD part9
+CWD part10
+CWD part11
+CWD part12
+CWD part13
+CWD part14
+CWD part15
+CWD part16
+CWD part17
+CWD part18
+CWD part19
+CWD part20
+CWD part21
+CWD part22
+CWD part23
+CWD part24
+CWD part25
+CWD part26
+CWD part27
+CWD part28
+CWD part29
+CWD part30
+CWD part31
+CWD part32
+CWD part33
+CWD part34
+CWD part35
+CWD part36
+CWD part37
+CWD part38
+CWD part39
+CWD part40
+CWD part41
+CWD part42
+CWD part43
+CWD part44
+CWD part45
+CWD part46
+CWD part47
+CWD part48
+CWD part49
+CWD part50
+CWD part51
+CWD part52
+CWD part53
+CWD part54
+CWD part55
+CWD part56
+CWD part57
+CWD part58
+CWD part59
+CWD part60
+CWD part61
+CWD part62
+CWD part63
+CWD part64
+CWD part65
+CWD part66
+CWD part67
+CWD part68
+CWD part69
+CWD part70
+CWD part71
+CWD part72
+CWD part73
+CWD part74
+CWD part75
+CWD part76
+CWD part77
+CWD part78
+CWD part79
+CWD part80
+CWD part81
+CWD part82
+CWD part83
+CWD part84
+CWD part85
+CWD part86
+CWD part87
+CWD part88
+CWD part89
+CWD part90
+CWD part91
+CWD part92
+CWD part93
+CWD part94
+CWD part95
+CWD part96
+CWD part97
+CWD part98
+CWD part99
+CWD part100
+CWD part101
+CWD part102
+CWD part103
+CWD part104
+CWD part105
+CWD part106
+CWD part107
+CWD part108
+CWD part109
+CWD part110
+CWD part111
+CWD part112
+CWD part113
+CWD part114
+CWD part115
+CWD part116
+CWD part117
+CWD part118
+CWD part119
+CWD part120
+CWD part121
+CWD part122
+CWD part123
+CWD part124
+CWD part125
+CWD part126
+CWD part127
+CWD part128
+CWD part129
+CWD part130
+CWD part131
+CWD part132
+CWD part133
+CWD part134
+CWD part135
+CWD part136
+CWD part137
+CWD part138
+CWD part139
+CWD part140
+CWD part141
+CWD part142
+CWD part143
+CWD part144
+CWD part145
+CWD part146
+CWD part147
+CWD part148
+CWD part149
+CWD part150
+EPSV
+TYPE I
+SIZE 142
+RETR 142
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test143 b/tests/data/test143
new file mode 100644
index 000000000..a4df8cbf1
--- /dev/null
+++ b/tests/data/test143
@@ -0,0 +1,44 @@
+<testcase>
+<info>
+<keywords>
+FTP
+RETR
+type=
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+bla bla bla
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP URL with type=a
+ </name>
+ <command>
+"ftp://%HOSTIP:%FTPPORT/%2ftmp/moo/143;type=a"
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD /tmp
+CWD moo
+EPSV
+TYPE A
+SIZE 143
+RETR 143
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test144 b/tests/data/test144
new file mode 100644
index 000000000..4419b09f5
--- /dev/null
+++ b/tests/data/test144
@@ -0,0 +1,49 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PORT
+NLST
+--data-binary
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+</data>
+<servercmd>
+REPLY NLST 450 No files found
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP NLST dir list without contents, using PORT
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/ -P - -l
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+# Strip all valid kinds of PORT and EPRT that curl can send
+<strip>
+^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
+^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
+</strip>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+PORT 127,0,0,1,243,212
+TYPE A
+NLST
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test145 b/tests/data/test145
new file mode 100644
index 000000000..1e80cf8ce
--- /dev/null
+++ b/tests/data/test145
@@ -0,0 +1,51 @@
+<testcase>
+<info>
+<keywords>
+FTP
+NLST
+PORT
+</keywords>
+</info>
+# Server-side
+<reply>
+<servercmd>
+REPLY NLST 550 Have a taste on this!
+</servercmd>
+<data>
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP NLST dir list with weird reply code, using PORT
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/ -P - -l
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+19
+</errorcode>
+# Strip all valid kinds of PORT and EPRT that curl can send
+<strip>
+^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
+^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
+</strip>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+PORT 127,0,0,1,243,212
+TYPE A
+NLST
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test146 b/tests/data/test146
new file mode 100644
index 000000000..3cd4bd5aa
--- /dev/null
+++ b/tests/data/test146
@@ -0,0 +1,55 @@
+<testcase>
+<info>
+<keywords>
+FTP
+RETR
+persistent connection
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+this is file contents
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+persistent FTP with different paths
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/first/dir/here/146 ftp://%HOSTIP:%FTPPORT/146
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+# Strip all valid kinds of PORT and EPRT that curl can send
+<strip>
+^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
+^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
+</strip>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD first
+CWD dir
+CWD here
+EPSV
+TYPE I
+SIZE 146
+RETR 146
+CWD /
+EPSV
+SIZE 146
+RETR 146
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test147 b/tests/data/test147
new file mode 100644
index 000000000..aaa4ca156
--- /dev/null
+++ b/tests/data/test147
@@ -0,0 +1,49 @@
+<testcase>
+# Server-side
+<reply>
+<data>
+foo
+</data>
+<servercmd>
+REPLY CWD 550 I won't allow this on my server
+COUNT CWD 1
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP with --ftp-create-dirs (failing CWD)
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/first/dir/here/147 --ftp-create-dirs
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+# Strip all valid kinds of PORT and EPRT that curl can send
+<strip>
+^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
+^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
+</strip>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD first
+MKD first
+CWD first
+CWD dir
+CWD here
+EPSV
+TYPE I
+SIZE 147
+RETR 147
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test148 b/tests/data/test148
new file mode 100644
index 000000000..de0fa7ab3
--- /dev/null
+++ b/tests/data/test148
@@ -0,0 +1,42 @@
+<testcase>
+# Server-side
+<reply>
+<servercmd>
+REPLY CWD 550 I won't allow this on my server
+REPLY MKD 550 We will have no such thing
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP with --ftp-create-dirs (failing MKD)
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/attempt/to/get/this/148 --ftp-create-dirs
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+# Strip all valid kinds of PORT and EPRT that curl can send
+<strip>
+^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
+^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
+</strip>
+<errorcode>
+9
+</errorcode>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD attempt
+MKD attempt
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test149 b/tests/data/test149
new file mode 100644
index 000000000..f7973f497
--- /dev/null
+++ b/tests/data/test149
@@ -0,0 +1,47 @@
+<testcase>
+# Server-side
+<reply>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP with multiple uploads
+ </name>
+ <command>
+-T log/upload149 ftp://%HOSTIP:%FTPPORT/dir1/149 -T log/upload149 ftp://%HOSTIP:%FTPPORT/dir2/149
+</command>
+<file name="log/upload149">
+send away this contents
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+# Strip all valid kinds of PORT and EPRT that curl can send
+<strip>
+^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
+^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
+</strip>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD dir1
+EPSV
+TYPE I
+STOR 149
+CWD /
+CWD dir2
+EPSV
+STOR 149
+QUIT
+</protocol>
+<file name="log/upload149">
+send away this contents
+</file>
+</verify>
+</testcase>
diff --git a/tests/data/test15 b/tests/data/test15
new file mode 100644
index 000000000..3b1fa4369
--- /dev/null
+++ b/tests/data/test15
@@ -0,0 +1,57 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+--write-out
+</keywords>
+</info>
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.4 200 OK
+Fake: yes
+Fake: yes
+Fake: yes
+Content-Length: 26
+
+Repeated nonsense-headers
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+--write-out test
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/want/15 --write-out "%{url_effective} %{http_code} %{size_download}\n"
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<stdout>
+HTTP/1.4 200 OK
+Fake: yes
+Fake: yes
+Fake: yes
+Content-Length: 26
+
+Repeated nonsense-headers
+http://%HOSTIP:%HTTPPORT/want/15 200 26
+</stdout>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /want/15 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test150 b/tests/data/test150
new file mode 100644
index 000000000..cdd4cf673
--- /dev/null
+++ b/tests/data/test150
@@ -0,0 +1,94 @@
+<testcase>
+
+<!-- Server-side -->
+<reply>
+
+<!-- no <data> in this test since we have NTLM from the start
+
+This is supposed to be returned when the server gets a first
+Authorization: NTLM line passed-in from the client -->
+
+<data1001>
+HTTP/1.1 401 Now gimme that second request of crap
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 34
+WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+
+This is not the real page either!
+</data1001>
+
+# This is supposed to be returned when the server gets the second
+# Authorization: NTLM line passed-in from the client
+<data1002>
+HTTP/1.1 200 Things are fine in server land swsclose
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 32
+
+Finally, this is the real page!
+</data1002>
+
+<datacheck>
+HTTP/1.1 401 Now gimme that second request of crap
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 34
+WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+
+HTTP/1.1 200 Things are fine in server land swsclose
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 32
+
+Finally, this is the real page!
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+<features>
+NTLM
+</features>
+<server>
+http
+</server>
+ <name>
+HTTP with NTLM authorization and --fail
+ </name>
+ <setenv>
+# we force our own host name, in order to make the test machine independent
+CURL_GETHOSTNAME=curlhost
+# we try to use the LD_PRELOAD hack, if not a debug build
+LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
+ </setenv>
+ <command>
+http://%HOSTIP:%HTTPPORT/150 -u testuser:testpass --ntlm --fail
+</command>
+<precheck>
+chkhostname curlhost
+</precheck>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /150 HTTP/1.1
+Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
+User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /150 HTTP/1.1
+Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoKBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyY3VybGhvc3Q=
+User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test151 b/tests/data/test151
new file mode 100644
index 000000000..7fb190884
--- /dev/null
+++ b/tests/data/test151
@@ -0,0 +1,41 @@
+<testcase>
+# Server-side
+<reply>
+<data>
+HTTP/1.0 401 BAD BOY
+Server: swsclose
+Content-Type: text/html
+
+This contains a response code >= 400, so curl shouldn't display this. Even
+though it's a response code that triggers authentication, we're not using
+authentication so we should still fail.
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET with an error code that might trick authentication
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/151
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent: curl/.*
+</strip>
+<protocol>
+GET /151 HTTP/1.1
+User-Agent: curl/7.8.1-pre3 (sparc-sun-solaris2.7) libcurl 7.8.1-pre3 (OpenSSL 0.9.6a) (krb4 enabled)
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test152 b/tests/data/test152
new file mode 100644
index 000000000..c3f4159e8
--- /dev/null
+++ b/tests/data/test152
@@ -0,0 +1,44 @@
+<testcase>
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.0 401 BAD BOY
+Server: swsclose
+Content-Type: text/html
+
+This contains a response code >= 400, so curl shouldn't display this. Even
+though it's a response code that triggers authentication, we're not using
+authentication so we should still fail.
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET with an error code that might trick authentication and --fail
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/152 --fail
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent: curl/.*
+</strip>
+<protocol>
+GET /152 HTTP/1.1
+User-Agent: curl/7.8.1-pre3 (sparc-sun-solaris2.7) libcurl 7.8.1-pre3 (OpenSSL 0.9.6a) (krb4 enabled)
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+<errorcode>
+22
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test153 b/tests/data/test153
new file mode 100644
index 000000000..5a1db3150
--- /dev/null
+++ b/tests/data/test153
@@ -0,0 +1,133 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP Digest auth
+</keywords>
+</info>
+
+# Server-side
+<reply>
+# reply back and ask for Digest auth
+<data1>
+HTTP/1.1 401 Authorization Required swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 26
+
+This is not the real page
+</data1>
+
+# This is supposed to be returned when the server gets a
+# Authorization: Digest line passed-in from the client
+<data1001>
+HTTP/1.1 200 OK
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 23
+
+This IS the real page!
+</data1001>
+
+#
+# This is the second request, and this sends back a response saying that
+# the request contained stale data. We want an update. Set swsbounce to
+# bounce on to data1003 on the second request.
+<data1002>
+HTTP/1.1 401 Authorization re-negotiation please swsbounce
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+WWW-Authenticate: Digest realm="testrealm", algorithm=MD5, nonce="999999", stale=true, qop="auth"
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 25
+
+This is not the real page
+</data1002>
+
+# The second request to the 1002 section will bounce this one back instead
+# thanks to the swsbounce keyword up there
+<data1003>
+HTTP/1.1 200 OK
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 30
+
+This IS the second real page!
+</data1003>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+crypto
+</features>
+ <name>
+HTTP with Digest authorization with stale=true
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/1530001 -u testuser:testpass --digest http://%HOSTIP:%HTTPPORT/1530002
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^Authorization.*cnonce
+^User-Agent:.*
+</strip>
+<protocol>
+GET /1530001 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /1530001 HTTP/1.1
+Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/1530001", response="f4f83139396995bac665f24a1f1055c7"
+User-Agent: curl/7.10.5 (i686-pc-linux-gnu) libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /1530002 HTTP/1.1
+Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/1530002", response="f84511b014fdd0ba6494f42871079c32"
+User-Agent: curl/7.11.0-CVS (i686-pc-linux-gnu) libcurl/7.11.0-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 GSS
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /1530002 HTTP/1.1
+Authorization: Digest username="testuser", realm="testrealm", nonce="999999", uri="/1530002", cnonce="MTA4MzIy", nc="00000001", qop="auth", response="25291c357671604a16c0242f56721c07", algorithm="MD5"
+User-Agent: curl/7.11.0-CVS (i686-pc-linux-gnu) libcurl/7.11.0-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 GSS
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+<stdout>
+HTTP/1.1 401 Authorization Required swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 26
+
+HTTP/1.1 200 OK
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 23
+
+This IS the real page!
+HTTP/1.1 401 Authorization re-negotiation please swsbounce
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+WWW-Authenticate: Digest realm="testrealm", algorithm=MD5, nonce="999999", stale=true, qop="auth"
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 25
+
+HTTP/1.1 200 OK
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 30
+
+This IS the second real page!
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test154 b/tests/data/test154
new file mode 100644
index 000000000..89e2bd51f
--- /dev/null
+++ b/tests/data/test154
@@ -0,0 +1,108 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP PUT
+HTTP Digest auth
+--anyauth
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<servercmd>
+auth_required
+</servercmd>
+<data>
+HTTP/1.1 401 Authorization Required swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
+WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
+WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344"
+Content-Type: text/html; charset=iso-8859-1
+Connection: close
+
+This is not the real page
+</data>
+
+# This is supposed to be returned when the server gets a
+# Authorization: Digest line passed-in from the client
+<data1000>
+HTTP/1.1 200 OK swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 23
+Connection: close
+
+This IS the real page!
+</data1000>
+
+<datacheck>
+HTTP/1.1 401 Authorization Required swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
+WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
+WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344"
+Content-Type: text/html; charset=iso-8859-1
+Connection: close
+
+HTTP/1.1 200 OK swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 23
+Connection: close
+
+This IS the real page!
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+crypto
+</features>
+ <name>
+HTTP PUT with --anyauth authorization (picking Digest)
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/154 -T log/put154 -u testuser:testpass --anyauth
+</command>
+<file name="log/put154">
+This is data we upload with PUT
+a second line
+line three
+four is the number of lines
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+PUT /154 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 85
+Expect: 100-continue
+
+PUT /154 HTTP/1.1
+Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/154", response="b71551e12d1c456e47d8388ecb2edeca"
+User-Agent: curl/7.10.5 (i686-pc-linux-gnu) libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 85
+Expect: 100-continue
+
+This is data we upload with PUT
+a second line
+line three
+four is the number of lines
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test155 b/tests/data/test155
new file mode 100644
index 000000000..891aa35f8
--- /dev/null
+++ b/tests/data/test155
@@ -0,0 +1,131 @@
+<testcase>
+# Server-side
+<reply>
+<servercmd>
+auth_required
+</servercmd>
+<data>
+HTTP/1.1 401 NTLM Authorization Required swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
+WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
+WWW-Authenticate: NTLM
+Content-Type: text/html; charset=iso-8859-1
+Connection: close
+
+moo
+</data>
+
+# This is supposed to be returned when the server gets a first
+# Authorization: NTLM line passed-in from the client
+<data1001>
+HTTP/1.1 401 Type-1 received, send back type-2
+Server: Microsoft-IIS/5.0
+Content-Length: 34
+Content-Type: text/html; charset=iso-8859-1
+WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+
+This is not the real page either!
+</data1001>
+
+# This is supposed to be returned when the server gets the second
+# Authorization: NTLM line passed-in from the client
+<data1002>
+HTTP/1.1 200 Type-3 Recevied and all Things are fine swsclose
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 32
+
+Finally, this is the real page!
+</data1002>
+
+<datacheck>
+HTTP/1.1 401 NTLM Authorization Required swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
+WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
+WWW-Authenticate: NTLM
+Content-Type: text/html; charset=iso-8859-1
+Connection: close
+
+HTTP/1.1 401 Type-1 received, send back type-2
+Server: Microsoft-IIS/5.0
+Content-Length: 34
+Content-Type: text/html; charset=iso-8859-1
+WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+
+HTTP/1.1 200 Type-3 Recevied and all Things are fine swsclose
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 32
+
+Finally, this is the real page!
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+<features>
+NTLM
+</features>
+<server>
+http
+</server>
+ <name>
+HTTP PUT with --anyauth authorization (picking NTLM)
+ </name>
+ <setenv>
+# we force our own host name, in order to make the test machine independent
+CURL_GETHOSTNAME=curlhost
+# we try to use the LD_PRELOAD hack, if not a debug build
+LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
+ </setenv>
+ <command>
+http://%HOSTIP:%HTTPPORT/155 -T log/put155 -u testuser:testpass --anyauth
+</command>
+<precheck>
+chkhostname curlhost
+</precheck>
+<file name="log/put155">
+This is data we upload with PUT
+a second line
+line three
+four is the number of lines
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+PUT /155 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 85
+Expect: 100-continue
+
+PUT /155 HTTP/1.1
+Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 0
+Expect: 100-continue
+
+PUT /155 HTTP/1.1
+Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoKBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyY3VybGhvc3Q=
+User-Agent: curl/7.10.5 (i686-pc-linux-gnu) libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 85
+Expect: 100-continue
+
+This is data we upload with PUT
+a second line
+line three
+four is the number of lines
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test156 b/tests/data/test156
new file mode 100644
index 000000000..0ff5e7e05
--- /dev/null
+++ b/tests/data/test156
@@ -0,0 +1,52 @@
+<testcase>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 No Authorization Required swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+Content-Type: text/html; charset=iso-8859-1
+Connection: close
+
+PUT received fine. Thank you very much
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP PUT with --anyauth (when the server requires none)
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/156 -T log/put156 -u testuser:testpass --anyauth
+</command>
+<file name="log/put156">
+This is data we upload with PUT
+a second line
+line three
+four is the number of lines
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+PUT /156 HTTP/1.1
+User-Agent: curl/7.10.5 (i686-pc-linux-gnu) libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 85
+Expect: 100-continue
+
+This is data we upload with PUT
+a second line
+line three
+four is the number of lines
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test157 b/tests/data/test157
new file mode 100644
index 000000000..872d93b86
--- /dev/null
+++ b/tests/data/test157
@@ -0,0 +1,39 @@
+<testcase>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 No Authorization Required swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+Content-Type: text/html; charset=iso-8859-1
+Connection: close
+
+GET received and served just fine. Thank you very much
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET with --anyauth (when the server requires none)
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/157 -u testuser:testpass --anyauth
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /157 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test158 b/tests/data/test158
new file mode 100644
index 000000000..417238d62
--- /dev/null
+++ b/tests/data/test158
@@ -0,0 +1,50 @@
+<testcase>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 100 Continue swsclose
+Silly-header: yeeeees
+
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP multipart formpost with only a 100 reply
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/158 -F name=daniel
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+^Content-Type: multipart/form-data.*
+^---------------------------.*
+</strip>
+<protocol>
+POST /158 HTTP/1.1
+User-Agent: curl/7.11.2-CVS (i686-pc-linux-gnu) libcurl/7.11.2-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 GSS
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 145
+Expect: 100-continue
+Content-Type: multipart/form-data; boundary=----------------------------4f12fcdaa3bc
+
+------------------------------4f12fcdaa3bc
+Content-Disposition: form-data; name="name"
+
+daniel
+------------------------------4f12fcdaa3bc--
+</protocol>
+<errorcode>
+52
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test159 b/tests/data/test159
new file mode 100644
index 000000000..2b9c83218
--- /dev/null
+++ b/tests/data/test159
@@ -0,0 +1,93 @@
+<testcase>
+# Server-side
+<reply>
+
+<!-- no <data> in this test since we have NTLM from the start
+
+This is supposed to be returned when the server gets a first
+Authorization: NTLM line passed-in from the client -->
+
+<data1001>
+HTTP/1.1 401 Now gimme that second request of crap
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 34
+WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+
+This is not the real page either!
+</data1001>
+
+# This is supposed to be returned when the server gets the second
+# Authorization: NTLM line passed-in from the client
+<data1002>
+HTTP/1.1 200 Things are fine in server land swsclose
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 32
+
+Finally, this is the real page!
+</data1002>
+
+<datacheck>
+HTTP/1.1 401 Now gimme that second request of crap
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 34
+WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+
+HTTP/1.1 200 Things are fine in server land swsclose
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 32
+
+Finally, this is the real page!
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+<features>
+NTLM
+</features>
+<server>
+http
+</server>
+ <name>
+HTTP with NTLM authorization when talking HTTP/1.0
+ </name>
+ <setenv>
+# we force our own host name, in order to make the test machine independent
+CURL_GETHOSTNAME=curlhost
+# we try to use the LD_PRELOAD hack, if not a debug build
+LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
+ </setenv>
+ <command>
+http://%HOSTIP:%HTTPPORT/159 -u testuser:testpass --ntlm -0
+</command>
+<precheck>
+chkhostname curlhost
+</precheck>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /159 HTTP/1.0
+Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
+User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /159 HTTP/1.0
+Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoKBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyY3VybGhvc3Q=
+User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test16 b/tests/data/test16
new file mode 100644
index 000000000..98539bebd
--- /dev/null
+++ b/tests/data/test16
@@ -0,0 +1,52 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP proxy
+HTTP proxy Basic auth
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Type: text/html
+Funny-head: yesyes
+Content-Length: 22
+
+the content goes here
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP with proxy authorization
+ </name>
+ <command>
+ -U fake@user:§§§looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong -x %HOSTIP:%HTTPPORT http://we.want.that.site.com/16
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET http://we.want.that.site.com/16 HTTP/1.1
+Proxy-Authorization: Basic ZmFrZUB1c2VyOqenp2xvb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29uZw==
+Host: we.want.that.site.com
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test160 b/tests/data/test160
new file mode 100644
index 000000000..d6ead5937
--- /dev/null
+++ b/tests/data/test160
@@ -0,0 +1,66 @@
+<testcase>
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 9
+
+surprise
+</data>
+<data1>
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+
+surprise2
+</data1>
+
+<postcmd>
+wait 1
+</postcmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP with delayed close, conn reuse, connection reset and retry
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/want/160 http://%HOSTIP:%HTTPPORT/wantmore/1600001
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<stdout>
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 9
+
+surprise
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+
+surprise2
+</stdout>
+
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /want/160 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /wantmore/1600001 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test161 b/tests/data/test161
new file mode 100644
index 000000000..bc6820ce1
--- /dev/null
+++ b/tests/data/test161
@@ -0,0 +1,41 @@
+<testcase>
+# Server-side
+<reply>
+<data>
+1oooooooooooooooooooooooooooooooooooooooooo2
+</data>
+<size>
+10928
+</size>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP RETR PASV
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/161
+</command>
+</client>
+
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE I
+SIZE 161
+RETR 161
+</protocol>
+<errorcode>
+18
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test162 b/tests/data/test162
new file mode 100644
index 000000000..9b75f7c6b
--- /dev/null
+++ b/tests/data/test162
@@ -0,0 +1,60 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP proxy
+HTTP proxy NTLM auth
+FAILURE
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data1001 nocheck="yes">
+HTTP/1.0 407 BAD BOY
+Proxy-Authenticate: Basic realm="Squid proxy-caching web server"
+Server: swsclose
+Content-Type: text/html
+
+Even though it's the response code that triggers authentication, we're
+using NTLM and the server isn't, so we should fail. We know the server
+isn't because there's no Proxy-Authorization: NTLM header
+</data1001>
+</reply>
+
+# Client-side
+<client>
+<features>
+NTLM
+</features>
+<server>
+http
+</server>
+ <name>
+HTTP GET asking for --proxy-ntlm when some other authentication is required
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/162 --proxy http://%HOSTIP:%HTTPPORT --proxy-user foo:bar --proxy-ntlm --fail
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent: curl/.*
+</strip>
+<protocol>
+GET http://%HOSTIP:%HTTPPORT/162 HTTP/1.1
+Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
+User-Agent: curl/7.8.1-pre3 (sparc-sun-solaris2.7) libcurl 7.8.1-pre3 (OpenSSL 0.9.6a) (krb4 enabled)
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+<errorcode>
+22
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test163 b/tests/data/test163
new file mode 100644
index 000000000..9e8256d00
--- /dev/null
+++ b/tests/data/test163
@@ -0,0 +1,73 @@
+<testcase>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 10
+
+blablabla
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP multipart formpost with contents from a file
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/want/163 -F "name=<log/field163" -F tool=curl
+</command>
+# We create this file before the command is invoked!
+<file name="log/field163">
+contents
+from
+a
+file
+
+newlinens?
+yes please
+
+[tab][CR] too
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^(User-Agent:|Content-Type: multipart/form-data;|------------).*
+</strip>
+<protocol>
+POST /we/want/163 HTTP/1.1
+User-Agent: curl/7.11.2-CVS (i686-pc-linux-gnu) libcurl/7.11.2-CVS OpenSSL/0.9.6b zlib/1.1.4 c-ares/1.0.0
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 304
+Expect: 100-continue
+Content-Type: multipart/form-data; boundary=----------------------------c2d1767eb6ac
+
+------------------------------c2d1767eb6ac
+Content-Disposition: form-data; name="name"
+
+contents
+from
+a
+file
+
+newlinens?
+yes please
+
+[tab][CR] too
+
+------------------------------c2d1767eb6ac
+Content-Disposition: form-data; name="tool"
+
+curl
+------------------------------c2d1767eb6ac--
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test164 b/tests/data/test164
new file mode 100644
index 000000000..baac19626
--- /dev/null
+++ b/tests/data/test164
@@ -0,0 +1,61 @@
+<testcase>
+# Server-side
+# This particular response is an exact excerpt from an actual Apache
+# server when asked for a 0-10,12-15 range (except gt/lt changed to {}
+# to avoid XML escaping problems).
+<reply>
+<data>
+HTTP/1.1 206 Partial Content swsclose
+Date: Sat, 24 Apr 2004 09:24:49 GMT
+Server: Apache/1.3.29 (Unix) mod_throttle/3.1.2 PHP/4.3.4 mod_fastcgi/2.4.0
+Last-Modified: Tue, 23 Mar 2004 08:23:14 GMT
+ETag: "53814a-ec5-405ff3f2"
+Accept-Ranges: bytes
+Content-Length: 187
+Content-Type: multipart/byteranges; boundary=408a326132c
+
+--408a326132c
+Content-type: text/html
+Content-range: bytes 0-10/3781
+
+{html}
+{hea
+
+--408a326132c
+Content-type: text/html
+Content-range: bytes 12-15/3781
+
+}
+{t
+
+--408a326132c--
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP range with multiple ranges
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/want/164 -r 0-10,12-15
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /want/164 HTTP/1.1
+Range: bytes=0-10,12-15
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test165 b/tests/data/test165
new file mode 100644
index 000000000..ddfe1e9dc
--- /dev/null
+++ b/tests/data/test165
@@ -0,0 +1,58 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP proxy
+IDN
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/html
+Funny-head: yesyes
+
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+idn
+</features>
+<setenv>
+CHARSET=ISO8859-1
+</setenv>
+ <name>
+HTTP over proxy with IDN host name
+ </name>
+ <command>
+http://www.åäö.se/page/165 -x %HOSTIP:%HTTPPORT
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET http://www.xn--4cab6c.se/page/165 HTTP/1.1
+Host: www.xn--4cab6c.se
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test166 b/tests/data/test166
new file mode 100644
index 000000000..374be283f
--- /dev/null
+++ b/tests/data/test166
@@ -0,0 +1,54 @@
+<testcase>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 10
+
+blablabla
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP formpost a file with spaces in name
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/want/166 -F "name=@log/fie ld 166"
+</command>
+# We create this file before the command is invoked!
+<file name="log/fie ld 166">
+data inside the file
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^(User-Agent:|Content-Type: multipart/form-data;|------------).*
+</strip>
+<protocol>
+POST /we/want/166 HTTP/1.1
+User-Agent: curl/7.12.0-CVS (i686-pc-linux-gnu) libcurl/7.12.0-CVS OpenSSL/0.9.6b zlib/1.1.4 c-ares/1.2.0 libidn/0.4.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 223
+Expect: 100-continue
+Content-Type: multipart/form-data; boundary=----------------------------b0b3d6d23991
+
+------------------------------b0b3d6d23991
+Content-Disposition: form-data; name="name"; filename="fie ld 166"
+Content-Type: application/octet-stream
+
+data inside the file
+
+------------------------------b0b3d6d23991--
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test167 b/tests/data/test167
new file mode 100644
index 000000000..2ce968db2
--- /dev/null
+++ b/tests/data/test167
@@ -0,0 +1,79 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP proxy
+HTTP proxy Basic auth
+HTTP Digest auth
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 401 Authorization Required swsclose
+WWW-Authenticate: Digest realm="weirdorealm", nonce="12345"
+
+</data>
+
+<data1000>
+HTTP/1.1 200 OK swsclose
+Server: no
+Content-Length: 15
+
+Nice auth sir!
+</data1000>
+
+<datacheck>
+HTTP/1.1 401 Authorization Required swsclose
+WWW-Authenticate: Digest realm="weirdorealm", nonce="12345"
+
+HTTP/1.1 200 OK swsclose
+Server: no
+Content-Length: 15
+
+Nice auth sir!
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+crypto
+</features>
+ <name>
+HTTP with proxy-requiring-Basic to site-requiring-Digest
+ </name>
+ <command>
+http://data.from.server.requiring.digest.hohoho.com/167 --proxy http://%HOSTIP:%HTTPPORT --proxy-user foo:bar --digest --user digest:alot
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent: curl/.*
+</strip>
+<protocol>
+GET http://data.from.server.requiring.digest.hohoho.com/167 HTTP/1.1
+Proxy-Authorization: Basic Zm9vOmJhcg==
+User-Agent: curl/7.12.0-CVS (i686-pc-linux-gnu) libcurl/7.12.0-CVS OpenSSL/0.9.6b zlib/1.1.4 c-ares/1.2.0 libidn/0.4.3
+Host: data.from.server.requiring.digest.hohoho.com
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+GET http://data.from.server.requiring.digest.hohoho.com/167 HTTP/1.1
+Proxy-Authorization: Basic Zm9vOmJhcg==
+Authorization: Digest username="digest", realm="weirdorealm", nonce="12345", uri="/167", response="13c7c02a252cbe1c46d8669898a3be26"
+User-Agent: curl/7.12.0-CVS (i686-pc-linux-gnu) libcurl/7.12.0-CVS OpenSSL/0.9.6b zlib/1.1.4 c-ares/1.2.0 libidn/0.4.3
+Host: data.from.server.requiring.digest.hohoho.com
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test168 b/tests/data/test168
new file mode 100644
index 000000000..e72e93149
--- /dev/null
+++ b/tests/data/test168
@@ -0,0 +1,99 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP proxy
+HTTP proxy Digest auth
+HTTP Digest auth
+</keywords>
+</info>
+
+# Server-side
+<reply>
+
+# this is returned first since we get no proxy-auth
+<data>
+HTTP/1.1 407 Authorization Required to proxy me my dear swsclose
+Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345"
+
+And you should ignore this data.
+</data>
+
+# then this is returned since we get no server-auth
+<data1000>
+HTTP/1.1 401 Authorization to the remote host as well swsbounce swsclose
+WWW-Authenticate: Digest realm="realmweirdo", nonce="123456"
+
+you should ignore this data too
+</data1000>
+
+<data1001>
+HTTP/1.1 200 OK swsclose
+Server: no
+Content-Length: 15
+
+Nice auth sir!
+</data1001>
+
+<datacheck>
+HTTP/1.1 407 Authorization Required to proxy me my dear swsclose
+Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345"
+
+HTTP/1.1 401 Authorization to the remote host as well swsbounce swsclose
+WWW-Authenticate: Digest realm="realmweirdo", nonce="123456"
+
+HTTP/1.1 200 OK swsclose
+Server: no
+Content-Length: 15
+
+Nice auth sir!
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+crypto
+</features>
+ <name>
+HTTP with proxy-requiring-Digest to site-requiring-Digest
+ </name>
+ <command>
+http://data.from.server.requiring.digest.hohoho.com/168 --proxy http://%HOSTIP:%HTTPPORT --proxy-user foo:bar --proxy-digest --digest --user digest:alot
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent: curl/.*
+</strip>
+<protocol>
+GET http://data.from.server.requiring.digest.hohoho.com/168 HTTP/1.1
+User-Agent: curl/7.12.0-CVS (i686-pc-linux-gnu) libcurl/7.12.0-CVS OpenSSL/0.9.6b zlib/1.1.4 c-ares/1.2.0 libidn/0.4.3
+Host: data.from.server.requiring.digest.hohoho.com
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+GET http://data.from.server.requiring.digest.hohoho.com/168 HTTP/1.1
+Proxy-Authorization: Digest username="foo", realm="weirdorealm", nonce="12345", uri="/168", response="fb8608e00ad9239a3dedb14bc8575976"
+User-Agent: curl/7.12.0-CVS (i686-pc-linux-gnu) libcurl/7.12.0-CVS OpenSSL/0.9.6b zlib/1.1.4 c-ares/1.2.0 libidn/0.4.3
+Host: data.from.server.requiring.digest.hohoho.com
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+GET http://data.from.server.requiring.digest.hohoho.com/168 HTTP/1.1
+Proxy-Authorization: Digest username="foo", realm="weirdorealm", nonce="12345", uri="/168", response="fb8608e00ad9239a3dedb14bc8575976"
+Authorization: Digest username="digest", realm="realmweirdo", nonce="123456", uri="/168", response="ca87f2d768a231e2d637a55698d5c416"
+User-Agent: curl/7.12.0-CVS (i686-pc-linux-gnu) libcurl/7.12.0-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 GSS libidn/0.4.3
+Host: data.from.server.requiring.digest.hohoho.com
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test169 b/tests/data/test169
new file mode 100644
index 000000000..f7419e6d0
--- /dev/null
+++ b/tests/data/test169
@@ -0,0 +1,127 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP proxy
+HTTP proxy NTLM auth
+HTTP Digest auth
+</keywords>
+</info>
+
+# Server-side
+<reply>
+
+# this is returned first since we get no proxy-auth
+<data>
+HTTP/1.1 407 Authorization Required to proxy me my dear swsclose
+Proxy-Authenticate: NTLM
+
+And you should ignore this data.
+</data>
+
+# then this is returned since we get no server-auth
+<data1000>
+HTTP/1.1 200 Authorizated fine
+Content-Length: 27
+
+Welcome to the end station
+</data1000>
+
+<data1001>
+HTTP/1.1 407 NTLM type-1 received sending back type-2
+Server: Microsoft-IIS/5.0
+Content-Length: 34
+Content-Type: text/html; charset=iso-8859-1
+Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+
+This is not the real page either!
+</data1001>
+
+# This is supposed to be returned when the server gets the second
+# Authorization: NTLM line passed-in from the client
+<data1002>
+HTTP/1.1 401 You now need to authenticate with the host
+Server: Microsoft-IIS/5.0
+WWW-Authenticate: Digest realm="r e a l m", nonce="abcdef"
+Content-Length: 46
+Content-Type: text/html; charset=iso-8859-1
+
+We have not authenticated with the server yet
+</data1002>
+
+<datacheck>
+HTTP/1.1 407 NTLM type-1 received sending back type-2
+Server: Microsoft-IIS/5.0
+Content-Length: 34
+Content-Type: text/html; charset=iso-8859-1
+Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+
+HTTP/1.1 401 You now need to authenticate with the host
+Server: Microsoft-IIS/5.0
+WWW-Authenticate: Digest realm="r e a l m", nonce="abcdef"
+Content-Length: 46
+Content-Type: text/html; charset=iso-8859-1
+
+HTTP/1.1 200 Authorizated fine
+Content-Length: 27
+
+Welcome to the end station
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+NTLM
+</features>
+ <name>
+HTTP with proxy-requiring-NTLM to site-requiring-Digest
+ </name>
+ <setenv>
+# we force our own host name, in order to make the test machine independent
+CURL_GETHOSTNAME=curlhost
+# we try to use the LD_PRELOAD hack, if not a debug build
+LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
+ </setenv>
+ <command>
+http://data.from.server.requiring.digest.hohoho.com/169 --proxy http://%HOSTIP:%HTTPPORT --proxy-user foo:bar --proxy-ntlm --digest --user digest:alot
+</command>
+<precheck>
+chkhostname curlhost
+</precheck>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent: curl/.*
+</strip>
+<protocol>
+GET http://data.from.server.requiring.digest.hohoho.com/169 HTTP/1.1
+Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
+User-Agent: curl/7.12.0-CVS (i686-pc-linux-gnu) libcurl/7.12.0-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 GSS libidn/0.4.3
+Host: data.from.server.requiring.digest.hohoho.com
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+GET http://data.from.server.requiring.digest.hohoho.com/169 HTTP/1.1
+Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAAAwADAHAAAAAIAAgAcwAAAAAAAAAAAAAABoKBAIP6B+XVQ6vQsx3DfDXUVhd9436GAxPu0IYcl2Z7LxHmNeOAWQ+vxUmhuCFJBUgXCWZvb2N1cmxob3N0
+User-Agent: curl/7.12.0-CVS (i686-pc-linux-gnu) libcurl/7.12.0-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 GSS libidn/0.4.3
+Host: data.from.server.requiring.digest.hohoho.com
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+GET http://data.from.server.requiring.digest.hohoho.com/169 HTTP/1.1
+Authorization: Digest username="digest", realm="r e a l m", nonce="abcdef", uri="/169", response="95d48591985a03c4b49cb962aa7bd3e6"
+User-Agent: curl/7.12.0-CVS (i686-pc-linux-gnu) libcurl/7.12.0-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 GSS libidn/0.4.3
+Host: data.from.server.requiring.digest.hohoho.com
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test17 b/tests/data/test17
new file mode 100644
index 000000000..259580bf5
--- /dev/null
+++ b/tests/data/test17
@@ -0,0 +1,54 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP custom request
+config file
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Funny-head: yesyes
+Content-Length: 27
+
+This is the proof it works
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP with config file on stdin
+ </name>
+ <stdin>
+#
+# Use a silly request without '--':
+request MOOO
+#
+# Set the user-agent using a short-option:
+-A "agent007 license to drill\t"
+#
+# long option *with* '--':
+--max-time 180
+ </stdin>
+ <command>
+-K - %HOSTIP:%HTTPPORT/that.site.com/17
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+MOOO /that.site.com/17 HTTP/1.1
+User-Agent: agent007 license to drill
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test170 b/tests/data/test170
new file mode 100644
index 000000000..a2c221792
--- /dev/null
+++ b/tests/data/test170
@@ -0,0 +1,51 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP POST
+HTTP proxy
+HTTP proxy NTLM auth
+</keywords>
+</info>
+
+# Server-side
+<reply>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+NTLM
+</features>
+ <name>
+HTTP POST with --proxy-ntlm and no SSL with no response
+ </name>
+ <command>
+http://a.galaxy.far.far.away/170 --proxy http://%HOSTIP:%HTTPPORT --proxy-user foo:bar --proxy-ntlm -F "dummy=value"
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent: curl/.*
+</strip>
+<protocol>
+POST http://a.galaxy.far.far.away/170 HTTP/1.1
+Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
+User-Agent: curl/7.12.0-CVS (i686-pc-linux-gnu) libcurl/7.12.0-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 libidn/0.4.3
+Host: a.galaxy.far.far.away
+Accept: */*
+Proxy-Connection: Keep-Alive
+Content-Length: 0
+
+</protocol>
+# 52 is CURLE_GOT_NOTHING
+<errorcode>
+52
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test171 b/tests/data/test171
new file mode 100644
index 000000000..870d236f2
--- /dev/null
+++ b/tests/data/test171
@@ -0,0 +1,58 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP proxy
+cookies
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Tue, 25 Sep 2001 19:37:44 GMT
+Content-Type: text/html
+Set-Cookie: XToken=xt;Domain=.z.x.com;Path=/
+Cache-control: private
+Content-Length: 62
+
+This server reply is for testing a simple cookie test case...
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP, get cookie with dot prefixed full domain
+ </name>
+ <command>
+-c log/jar171 -x %HOSTIP:%HTTPPORT http://z.x.com/171
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET http://z.x.com/171 HTTP/1.1
+Host: z.x.com
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+<file name="log/jar171" mode="text">
+# Netscape HTTP Cookie File
+# http://curl.haxx.se/rfc/cookie_spec.html
+# This file was generated by libcurl! Edit at your own risk.
+
+.z.x.com TRUE / FALSE 0 XToken xt
+</file>
+</verify>
+</testcase>
diff --git a/tests/data/test172 b/tests/data/test172
new file mode 100644
index 000000000..1ab902011
--- /dev/null
+++ b/tests/data/test172
@@ -0,0 +1,56 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+cookies
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Content-Length: 4
+Connection: close
+
+boo
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP with cookies file and custom added cookie
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/want/172 -b log/jar172.txt -b "tool=curl; name=fool"
+</command>
+<file name="log/jar172.txt">
+# Netscape HTTP Cookie File
+# http://curl.haxx.se/rfc/cookie_spec.html
+# This file was generated by libcurl! Edit at your own risk.
+
+.%HOSTIP TRUE /silly/ FALSE 0 ismatch this
+.%HOSTIP TRUE / FALSE 0 partmatch present
+%HOSTIP FALSE /we/want/ FALSE 1391252187 nodomain value
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /we/want/172 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Cookie: nodomain=value; partmatch=present; tool=curl; name=fool
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test173 b/tests/data/test173
new file mode 100644
index 000000000..bf6af0007
--- /dev/null
+++ b/tests/data/test173
@@ -0,0 +1,80 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP POST
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 11
+
+blablabla
+
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP RFC1867-formpost a file from stdin with "faked" filename
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/want/173 -F field1=contents1 -F "fileupload=@-;filename=/dev/null;type=text/x-null;format=x-curl"
+</command>
+
+<stdin>
+line1
+line2
+line3
+line4
+line5
+line6
+line7
+line8
+</stdin>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^(User-Agent:|Content-Type: multipart/form-data;|------------).*
+</strip>
+<protocol>
+POST /we/want/173 HTTP/1.1
+User-Agent: curl/7.12.1-CVS (i686-pc-linux-gnu) libcurl/7.12.1-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 GSS libidn/0.4.6
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 360
+Expect: 100-continue
+Content-Type: multipart/form-data; boundary=----------------------------5dbea401cd8c
+
+------------------------------5dbea401cd8c
+Content-Disposition: form-data; name="field1"
+
+contents1
+------------------------------5dbea401cd8c
+Content-Disposition: form-data; name="fileupload"; filename="/dev/null"
+Content-Type: text/x-null;format=x-curl
+
+line1
+line2
+line3
+line4
+line5
+line6
+line7
+line8
+
+------------------------------5dbea401cd8c--
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test174 b/tests/data/test174
new file mode 100644
index 000000000..fc5ccc189
--- /dev/null
+++ b/tests/data/test174
@@ -0,0 +1,45 @@
+<testcase>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 beng swsclose
+Server: Microsoft-IIS/6.0
+Authentication-Info: Passport1.4 tname=MSPAuth,tname=MSPProf,tname=MSPConsent,tname=MSPSecAuth
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 26
+
+This is not the real page
+</data>
+</reply>
+
+# Client-side
+<client>
+#
+<server>
+http
+</server>
+ <name>
+HTTP POST --anyauth to server not requiring any auth at all
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/174 -u testuser:testpass --anyauth -d "junkelijunk"
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol nonewline="yes">
+POST /174 HTTP/1.1
+User-Agent: curl/7.12.1-CVS (i686-pc-linux-gnu) libcurl/7.12.1-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 GSS libidn/0.4.6
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 11
+Content-Type: application/x-www-form-urlencoded
+
+junkelijunk
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test175 b/tests/data/test175
new file mode 100644
index 000000000..2ee78d508
--- /dev/null
+++ b/tests/data/test175
@@ -0,0 +1,86 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP POST
+HTTP Digest auth
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 beng swsclose swsbounce
+Server: Microsoft-IIS/6.0
+Authentication-Info: Passport1.4 tname=MSPAuth,tname=MSPProf,tname=MSPConsent,tname=MSPSecAuth
+Content-Type: text/html; charset=iso-8859-1
+
+This is not the real page
+</data>
+
+<data1>
+HTTP/1.1 200 moo swsclose
+Server: Microsoft-IIS/6.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 16
+
+content for you
+</data1>
+
+<datacheck>
+HTTP/1.1 200 beng swsclose swsbounce
+Server: Microsoft-IIS/6.0
+Authentication-Info: Passport1.4 tname=MSPAuth,tname=MSPProf,tname=MSPConsent,tname=MSPSecAuth
+Content-Type: text/html; charset=iso-8859-1
+
+HTTP/1.1 200 moo swsclose
+Server: Microsoft-IIS/6.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 16
+
+content for you
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+#
+<server>
+http
+</server>
+<features>
+crypto
+</features>
+ <name>
+HTTP POST --digest to server not requiring any auth at all
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/175 -u auser:apasswd --digest -d "junkelijunk"
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol nonewline="yes">
+POST /175 HTTP/1.1
+User-Agent: curl/7.12.1-CVS (i686-pc-linux-gnu) libcurl/7.12.1-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 GSS libidn/0.4.6
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 0
+Content-Type: application/x-www-form-urlencoded
+
+POST /175 HTTP/1.1
+User-Agent: curl/7.12.1-CVS (i686-pc-linux-gnu) libcurl/7.12.1-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 GSS libidn/0.4.6
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 11
+Content-Type: application/x-www-form-urlencoded
+
+junkelijunk
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test176 b/tests/data/test176
new file mode 100644
index 000000000..d3b220b8c
--- /dev/null
+++ b/tests/data/test176
@@ -0,0 +1,79 @@
+<testcase>
+# Server-side
+<reply>
+# the first request has NTLM type-1 included, and then the 1001 is returned
+<data1001>
+HTTP/1.1 200 beng swsclose swsbounce
+Server: Microsoft-IIS/6.0
+Authentication-Info: Passport1.4 tname=MSPAuth,tname=MSPProf,tname=MSPConsent,tname=MSPSecAuth
+Content-Type: text/html; charset=iso-8859-1
+
+</data1001>
+
+# the second request should be auth-less and then this is returned.
+<data>
+HTTP/1.1 200 moo swsclose
+Server: Microsoft-IIS/6.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 16
+
+content for you
+</data>
+
+<datacheck>
+HTTP/1.1 200 beng swsclose swsbounce
+Server: Microsoft-IIS/6.0
+Authentication-Info: Passport1.4 tname=MSPAuth,tname=MSPProf,tname=MSPConsent,tname=MSPSecAuth
+Content-Type: text/html; charset=iso-8859-1
+
+HTTP/1.1 200 moo swsclose
+Server: Microsoft-IIS/6.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 16
+
+content for you
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+<features>
+NTLM
+</features>
+<server>
+http
+</server>
+ <name>
+HTTP POST --ntlm to server not requiring any auth at all
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/176 -u auser:apasswd --ntlm -d "junkelijunk"
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol nonewline="yes">
+POST /176 HTTP/1.1
+Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
+User-Agent: curl/7.12.1-CVS (i686-pc-linux-gnu) libcurl/7.12.1-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 GSS libidn/0.4.6
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 0
+Content-Type: application/x-www-form-urlencoded
+
+POST /176 HTTP/1.1
+User-Agent: curl/7.12.1-CVS (i686-pc-linux-gnu) libcurl/7.12.1-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 GSS libidn/0.4.6
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 11
+Content-Type: application/x-www-form-urlencoded
+
+junkelijunk
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test177 b/tests/data/test177
new file mode 100644
index 000000000..495dea9b4
--- /dev/null
+++ b/tests/data/test177
@@ -0,0 +1,54 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP POST
+HTTP Digest auth
+followlocation
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 302 *MOVED* swsclose swsbounce
+Server: Microsoft-IIS/6.0
+Location: /mooooo/177
+Content-Type: text/html; charset=iso-8859-1
+
+</data>
+</reply>
+
+# Client-side
+<client>
+#
+<server>
+http
+</server>
+<features>
+crypto
+</features>
+ <name>
+HTTP POST --digest to server doing a 302-location response
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/177 -u auser:apasswd --digest -d "junkelijunk"
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+POST /177 HTTP/1.1
+User-Agent: curl/7.12.1-CVS (i686-pc-linux-gnu) libcurl/7.12.1-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 GSS libidn/0.4.6
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 0
+Content-Type: application/x-www-form-urlencoded
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test178 b/tests/data/test178
new file mode 100644
index 000000000..07f0566e7
--- /dev/null
+++ b/tests/data/test178
@@ -0,0 +1,43 @@
+<testcase>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: -6
+Content-Type: text/html
+Funny-head: yesyes
+
+moooooooooooo
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+simple HTTP GET with negative Content-Length
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/178
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /178 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test179 b/tests/data/test179
new file mode 100644
index 000000000..f8f7811a7
--- /dev/null
+++ b/tests/data/test179
@@ -0,0 +1,57 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP proxy
+cookies
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Server: Microsoft-IIS/4.0
+Date: Tue, 25 Sep 2001 19:37:44 GMT
+Content-Type: text/html
+Connection: close
+Content-Length: 21
+
+This server says moo
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP using proxy and cookies with path checks
+ </name>
+ <command>
+http://supertrooper.fake/c/179 -b log/injar179 -x %HOSTIP:%HTTPPORT
+</command>
+<file name="log/injar179">
+supertrooper.fake FALSE /a FALSE 2139150993 mooo indeed
+supertrooper.fake FALSE /b FALSE 0 moo1 indeed
+supertrooper.fake FALSE /c FALSE 2139150993 moo2 indeed
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET http://supertrooper.fake/c/179 HTTP/1.1
+Host: supertrooper.fake
+Accept: */*
+Proxy-Connection: Keep-Alive
+Cookie: moo2=indeed
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test18 b/tests/data/test18
new file mode 100644
index 000000000..ff65817d1
--- /dev/null
+++ b/tests/data/test18
@@ -0,0 +1,90 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+{} list
+</keywords>
+</info>
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.1 200 OK
+Funny-head: yesyes
+Content-Length: 4
+
+moo
+</data>
+<data2>
+HTTP/1.1 200 OK
+Funny-head: yesyes
+Content-Length: 4
+
+foo
+</data2>
+<data3>
+HTTP/1.1 200 OK
+Funny-head: yesyes
+Content-Length: 4
+
+hoo
+</data3>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+multiple requests using {} in URL
+ </name>
+ <command>
+"%HOSTIP:%HTTPPORT/{18,180002,180003}"
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /18 HTTP/1.1
+User-Agent: curl/7.8.1-pre3 (sparc-sun-solaris2.7) libcurl 7.8.1-pre3 (OpenSSL 0.9.6a) (krb4 enabled)
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /180002 HTTP/1.1
+User-Agent: curl/7.8.1-pre3 (sparc-sun-solaris2.7) libcurl 7.8.1-pre3 (OpenSSL 0.9.6a) (krb4 enabled)
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /180003 HTTP/1.1
+User-Agent: curl/7.8.1-pre3 (sparc-sun-solaris2.7) libcurl 7.8.1-pre3 (OpenSSL 0.9.6a) (krb4 enabled)
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+<stdout>
+--_curl_--%HOSTIP:%HTTPPORT/18
+HTTP/1.1 200 OK
+Funny-head: yesyes
+Content-Length: 4
+
+moo
+--_curl_--%HOSTIP:%HTTPPORT/180002
+HTTP/1.1 200 OK
+Funny-head: yesyes
+Content-Length: 4
+
+foo
+--_curl_--%HOSTIP:%HTTPPORT/180003
+HTTP/1.1 200 OK
+Funny-head: yesyes
+Content-Length: 4
+
+hoo
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test180 b/tests/data/test180
new file mode 100644
index 000000000..c93302e75
--- /dev/null
+++ b/tests/data/test180
@@ -0,0 +1,59 @@
+<testcase>
+<reply>
+<data>
+HTTP/1.0 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+
+blablabla
+
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP 1.0 PUT
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/want/180 -T log/test180.txt --http1.0
+</command>
+<file name="log/test180.txt">
+Weird
+ file
+ to
+ upload
+for
+ testing
+the
+ PUT
+ feature
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+PUT /we/want/180 HTTP/1.0
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 78
+
+Weird
+ file
+ to
+ upload
+for
+ testing
+the
+ PUT
+ feature
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test181 b/tests/data/test181
new file mode 100644
index 000000000..87c5701fd
--- /dev/null
+++ b/tests/data/test181
@@ -0,0 +1,60 @@
+<testcase>
+<reply>
+<data>
+HTTP/1.0 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+
+blablabla
+
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP 1.0 POST
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/want/181 --data-binary @log/test181.txt --http1.0
+</command>
+<file name="log/test181.txt">
+Weird
+ file
+ to
+ upload
+for
+ testing
+the
+ POST
+ feature
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+POST /we/want/181 HTTP/1.0
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 79
+Content-Type: application/x-www-form-urlencoded
+
+Weird
+ file
+ to
+ upload
+for
+ testing
+the
+ POST
+ feature
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test182 b/tests/data/test182
new file mode 100644
index 000000000..272cdee2d
--- /dev/null
+++ b/tests/data/test182
@@ -0,0 +1,37 @@
+<testcase>
+# Server-side
+<reply>
+<data sendzero="yes">
+</data>
+<size>
+0
+</size>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+<name>
+FTP download an empty file
+</name>
+<command>
+ftp://%HOSTIP:%FTPPORT/182
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE I
+SIZE 182
+RETR 182
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test183 b/tests/data/test183
new file mode 100644
index 000000000..f34dc0c98
--- /dev/null
+++ b/tests/data/test183
@@ -0,0 +1,56 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP proxy
+persistent connection
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 4
+
+moo
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET two URLs over a single proxy with persistent connection
+ </name>
+ <command>
+http://deathstar.another.galaxy/183 http://a.galaxy.far.far.away/183 --proxy http://%HOSTIP:%HTTPPORT
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent: curl/.*
+</strip>
+<protocol>
+GET http://deathstar.another.galaxy/183 HTTP/1.1
+User-Agent: curl/7.12.2-CVS (i686-pc-linux-gnu) libcurl/7.12.2-CVS OpenSSL/0.9.6b zlib/1.1.4 libidn/0.4.6
+Host: deathstar.another.galaxy
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+GET http://a.galaxy.far.far.away/183 HTTP/1.1
+User-Agent: curl/7.12.2-CVS (i686-pc-linux-gnu) libcurl/7.12.2-CVS OpenSSL/0.9.6b zlib/1.1.4 libidn/0.4.6
+Host: a.galaxy.far.far.away
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+
+</verify>
+</testcase>
diff --git a/tests/data/test184 b/tests/data/test184
new file mode 100644
index 000000000..e42a393ea
--- /dev/null
+++ b/tests/data/test184
@@ -0,0 +1,75 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP proxy
+followlocation
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 301 OK swsbounce
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 4
+Location: http://yet.another.host/184
+
+moo
+</data>
+<data1>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 4
+
+moo
+</data1>
+<datacheck>
+HTTP/1.1 301 OK swsbounce
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 4
+Location: http://yet.another.host/184
+
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 4
+
+moo
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP replace Host: when following Location: to new host
+ </name>
+ <command>
+http://deathstar.another.galaxy/184 -L -H "Host: another.visitor.stay.a.while.stay.foreeeeeever" --proxy http://%HOSTIP:%HTTPPORT
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent: curl/.*
+</strip>
+<protocol>
+GET http://deathstar.another.galaxy/184 HTTP/1.1
+User-Agent: curl/7.12.2-CVS (i686-pc-linux-gnu) libcurl/7.12.2-CVS OpenSSL/0.9.6b zlib/1.1.4 libidn/0.4.6
+Accept: */*
+Proxy-Connection: Keep-Alive
+Host: another.visitor.stay.a.while.stay.foreeeeeever
+
+GET http://yet.another.host/184 HTTP/1.1
+Host: yet.another.host
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+
+</verify>
+</testcase>
diff --git a/tests/data/test185 b/tests/data/test185
new file mode 100644
index 000000000..01a66f6db
--- /dev/null
+++ b/tests/data/test185
@@ -0,0 +1,75 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP proxy
+followlocation
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 301 OK swsbounce
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 4
+Location: go/west/185
+
+moo
+</data>
+<data1>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 4
+
+moo
+</data1>
+<datacheck>
+HTTP/1.1 301 OK swsbounce
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 4
+Location: go/west/185
+
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 4
+
+moo
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP replace Host: when following Location: on the same host
+ </name>
+ <command>
+http://deathstar.another.galaxy/185 -L -H "Host: another.visitor.stay.a.while.stay.foreeeeeever" --proxy http://%HOSTIP:%HTTPPORT
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent: curl/.*
+</strip>
+<protocol>
+GET http://deathstar.another.galaxy/185 HTTP/1.1
+User-Agent: curl/7.12.2-CVS (i686-pc-linux-gnu) libcurl/7.12.2-CVS OpenSSL/0.9.6b zlib/1.1.4 libidn/0.4.6
+Accept: */*
+Proxy-Connection: Keep-Alive
+Host: another.visitor.stay.a.while.stay.foreeeeeever
+
+GET http://deathstar.another.galaxy/go/west/185 HTTP/1.1
+Accept: */*
+Proxy-Connection: Keep-Alive
+Host: another.visitor.stay.a.while.stay.foreeeeeever
+
+</protocol>
+
+</verify>
+</testcase>
diff --git a/tests/data/test186 b/tests/data/test186
new file mode 100644
index 000000000..5a1b7b9ac
--- /dev/null
+++ b/tests/data/test186
@@ -0,0 +1,56 @@
+<testcase>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 11
+
+blablabla
+
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP RFC1867-type formposting with types on text fields
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/want/186 -F "name=daniel;type=moo/foo" -F "html= <body>hello</body>;type=text/html;charset=verymoo"
+</command>
+# We create this file before the command is invoked!
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^(User-Agent:|Content-Type: multipart/form-data;|------------).*
+</strip>
+<protocol>
+POST /we/want/186 HTTP/1.1
+User-Agent: curl/7.12.2-CVS (i686-pc-linux-gnu) libcurl/7.12.2-CVS OpenSSL/0.9.7d zlib/1.2.1.1 c-ares/1.2.0 libidn/0.5.2
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 321
+Expect: 100-continue
+Content-Type: multipart/form-data; boundary=----------------------------212d9006ceb5
+
+------------------------------212d9006ceb5
+Content-Disposition: form-data; name="name"
+Content-Type: moo/foo
+
+daniel
+------------------------------212d9006ceb5
+Content-Disposition: form-data; name="html"
+Content-Type: text/html;charset=verymoo
+
+ <body>hello</body>
+------------------------------212d9006ceb5--
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test187 b/tests/data/test187
new file mode 100644
index 000000000..b82a6c60e
--- /dev/null
+++ b/tests/data/test187
@@ -0,0 +1,77 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+followlocation
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 301 This is a weirdo text message
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Location: /root/1870002.txt?coolsite=yes
+Connection: close
+
+This server reply is for testing a simple Location: following
+
+</data>
+<data2>
+HTTP/1.1 200 Followed here fine swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 52
+
+If this is received, the location following worked
+
+</data2>
+<datacheck>
+HTTP/1.1 301 This is a weirdo text message
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Location: /root/1870002.txt?coolsite=yes
+Connection: close
+
+HTTP/1.1 200 Followed here fine swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 52
+
+If this is received, the location following worked
+
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP redirect with bad host name separation and slash in parameters
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT?oh=what-weird=test/187 -L
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /?oh=what-weird=test/187 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /root/1870002.txt?coolsite=yes HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test188 b/tests/data/test188
new file mode 100644
index 000000000..030354414
--- /dev/null
+++ b/tests/data/test188
@@ -0,0 +1,78 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+Content-Range
+Resume
+followlocation
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 301 OK swsbounce
+Location: /188
+Content-Length: 2
+
+OK
+</data>
+<data1>
+HTTP/1.1 200 OK
+Connection: close
+Content-Length: 15
+Content-Range: bytes 50-
+
+Actual content
+</data1>
+
+<datacheck>
+HTTP/1.1 301 OK swsbounce
+Location: /188
+Content-Length: 2
+
+HTTP/1.1 200 OK
+Connection: close
+Content-Length: 15
+Content-Range: bytes 50-
+
+Actual content
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET with resume and redirect
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/188 -C 50 -L
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /188 HTTP/1.1
+Range: bytes=50-
+User-Agent: curl/7.6 (sparc-sun-solaris2.7) libcurl 7.6-pre4 (SSL 0.9.6) (krb4 enabled)
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /188 HTTP/1.1
+Range: bytes=50-
+User-Agent: curl/7.12.2-CVS (i686-pc-linux-gnu) libcurl/7.12.2-CVS OpenSSL/0.9.7d zlib/1.2.1.2 libidn/0.5.2
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test189 b/tests/data/test189
new file mode 100644
index 000000000..55485104f
--- /dev/null
+++ b/tests/data/test189
@@ -0,0 +1,69 @@
+<testcase>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 301 OK swsbounce
+Location: /189
+Content-Length: 2
+
+OK
+</data>
+<data1>
+HTTP/1.1 200 OK
+Connection: close
+Content-Length: 15
+
+Actual content
+</data1>
+
+<datacheck>
+HTTP/1.1 301 OK swsbounce
+Location: /189
+Content-Length: 2
+
+HTTP/1.1 200 OK
+Connection: close
+Content-Length: 15
+
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET with resume and redirect (to a page that doesn't resume)
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/189 -C 50 -L
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /189 HTTP/1.1
+Range: bytes=50-
+User-Agent: curl/7.6 (sparc-sun-solaris2.7) libcurl 7.6-pre4 (SSL 0.9.6) (krb4 enabled)
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /189 HTTP/1.1
+Range: bytes=50-
+User-Agent: curl/7.12.2-CVS (i686-pc-linux-gnu) libcurl/7.12.2-CVS OpenSSL/0.9.7d zlib/1.2.1.2 libidn/0.5.2
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+# 33 is CURLE_RANGE_ERROR
+<errorcode>
+33
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test19 b/tests/data/test19
new file mode 100644
index 000000000..dd60b8cf3
--- /dev/null
+++ b/tests/data/test19
@@ -0,0 +1,37 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+connect to non-listen
+FAILURE
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+none
+</server>
+<features>
+http
+</features>
+ <name>
+attempt connect to non-listening socket
+ </name>
+ <command>
+%HOSTIP:60000
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+7
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test190 b/tests/data/test190
new file mode 100644
index 000000000..4789cfa74
--- /dev/null
+++ b/tests/data/test190
@@ -0,0 +1,38 @@
+<testcase>
+# Server-side
+<reply>
+<servercmd>
+DELAY CWD 60
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+<killserver>
+ftp
+</killserver>
+ <name>
+FTP download with strict timeout and slow CWD
+ </name>
+ <command timeout="1">
+ftp://%HOSTIP:%FTPPORT/path/to/file/190 -m %FTPTIME2
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+# 28 is CURLE_OPERATION_TIMEDOUT
+<errorcode>
+28
+</errorcode>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD path
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test191 b/tests/data/test191
new file mode 100644
index 000000000..2c56cc82e
--- /dev/null
+++ b/tests/data/test191
@@ -0,0 +1,35 @@
+<testcase>
+# Server-side
+<reply>
+<data>
+data in file
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP URL with ?-letters in username and password
+ </name>
+ <command>
+"ftp://use%3fr:pass%3fword@%HOSTIP:%FTPPORT/191"
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER use?r
+PASS pass?word
+PWD
+EPSV
+TYPE I
+SIZE 191
+RETR 191
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test192 b/tests/data/test192
new file mode 100644
index 000000000..5f59e1850
--- /dev/null
+++ b/tests/data/test192
@@ -0,0 +1,52 @@
+<testcase>
+#
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 8
+Connection: close
+
+monster
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET -w num_connects with one simple connect
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/192 -w "%{num_connects}\n"
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /192 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+
+<stdout>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 8
+Connection: close
+
+monster
+1
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test193 b/tests/data/test193
new file mode 100644
index 000000000..c5425bb3f
--- /dev/null
+++ b/tests/data/test193
@@ -0,0 +1,82 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+followlocation
+--write-out
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.1 302 OK swsbounce swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 8
+Connection: close
+Location: ./193
+
+monster
+</data>
+<data1 nocheck="yes">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 8
+Connection: close
+
+monster
+</data1>
+
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET -w num_connects with redirected fetch (2 connects)
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/193 -w "%{num_connects}\n" -L
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /193 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /193 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+
+<stdout>
+HTTP/1.1 302 OK swsbounce swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 8
+Connection: close
+Location: ./193
+
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 8
+Connection: close
+
+monster
+2
+</stdout>
+
+</verify>
+</testcase>
diff --git a/tests/data/test194 b/tests/data/test194
new file mode 100644
index 000000000..582f197f7
--- /dev/null
+++ b/tests/data/test194
@@ -0,0 +1,57 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+Content-Range
+Resume
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 416 Requested Range Not Satisfiable swsclose
+Date: Fri, 24 Oct 2003 21:33:12 GMT
+Server: Apache/1.3.19 (Unix) (Red-Hat/Linux) mod_ssl/2.8.1 OpenSSL/0.9.6 PHP/4.3.1
+Last-Modified: Fri, 24 Oct 2003 18:01:23 GMT
+ETag: "ab57a-507-3f9968f3"
+Accept-Ranges: bytes
+Content-Length: 4
+Content-Range: bytes */87
+Content-Type: image/gif
+Connection: close
+
+bad
+</data>
+
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP resume transfer with the whole file already downloaded and --fail
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/want/194 -C 87 --fail
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /want/194 HTTP/1.1
+Range: bytes=87-
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+
+</verify>
+</testcase>
diff --git a/tests/data/test195 b/tests/data/test195
new file mode 100644
index 000000000..788c89a02
--- /dev/null
+++ b/tests/data/test195
@@ -0,0 +1,32 @@
+<testcase>
+# Server-side
+<reply>
+<servercmd>
+REPLY PASS 530 temporarily not available
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP response 530 after PASS, temporarily not allowed access
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/195
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+67
+</errorcode>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test196 b/tests/data/test196
new file mode 100644
index 000000000..b070f38a0
--- /dev/null
+++ b/tests/data/test196
@@ -0,0 +1,35 @@
+<testcase>
+# Server-side
+<reply>
+<servercmd>
+REPLY PASS 430 temporarily not available
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP transient error, retry request once
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/196 --retry 1
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+# 67 is CURLE_LOGIN_DENIED
+<errorcode>
+67
+</errorcode>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+USER anonymous
+PASS ftp@example.com
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test197 b/tests/data/test197
new file mode 100644
index 000000000..062f469f2
--- /dev/null
+++ b/tests/data/test197
@@ -0,0 +1,69 @@
+<testcase>
+#
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.1 503 OK swsbounce
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 21
+
+server not available
+</data>
+<data1 nocheck="yes">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 3
+Connection: close
+
+ok
+</data1>
+
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET --retry on 503 error with output to stdout
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/197 --retry 1000
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /197 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /197 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+
+<stdout>
+HTTP/1.1 503 OK swsbounce
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 21
+
+server not available
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 3
+Connection: close
+
+ok
+</stdout>
+
+</verify>
+</testcase>
diff --git a/tests/data/test198 b/tests/data/test198
new file mode 100644
index 000000000..bb451b545
--- /dev/null
+++ b/tests/data/test198
@@ -0,0 +1,64 @@
+<testcase>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 503 OK swsbounce
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 21
+
+server not available
+</data>
+<data1>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 3
+Connection: close
+
+ok
+</data1>
+
+<datacheck>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 3
+Connection: close
+
+ok
+</datacheck>
+
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET --retry on 503 error with output to file
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/198 --retry 1000
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /198 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /198 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+
+</verify>
+</testcase>
diff --git a/tests/data/test199 b/tests/data/test199
new file mode 100644
index 000000000..c9651bca2
--- /dev/null
+++ b/tests/data/test199
@@ -0,0 +1,52 @@
+<testcase>
+#
+# Server-side
+<reply name="1">
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+-foo-
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP with -d, -G and {}
+ </name>
+ <command>
+-d "foo=moo&moo=poo" "http://%HOSTIP:%HTTPPORT/{199,199}" -G
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /199?foo=moo&moo=poo HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /199?foo=moo&moo=poo HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test2 b/tests/data/test2
new file mode 100644
index 000000000..22b4f1860
--- /dev/null
+++ b/tests/data/test2
@@ -0,0 +1,53 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP Basic auth
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/html
+Funny-head: yesyes
+
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET with user and password
+ </name>
+ <command>
+ -u fake:user http://%HOSTIP:%HTTPPORT/2
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /2 HTTP/1.1
+Authorization: Basic ZmFrZTp1c2Vy
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+<data>
+[insert full protocol verifiction dump here]
+</data>
+</verify>
+</testcase>
diff --git a/tests/data/test20 b/tests/data/test20
new file mode 100644
index 000000000..57fa48dea
--- /dev/null
+++ b/tests/data/test20
@@ -0,0 +1,38 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+FAILURE
+non-existing host
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+none
+</server>
+<features>
+http
+</features>
+ <name>
+attempt connect to non-existing host name
+ </name>
+ <command>
+non-existing-host.haxx.se.
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+6
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test200 b/tests/data/test200
new file mode 100644
index 000000000..8be1de0c7
--- /dev/null
+++ b/tests/data/test200
@@ -0,0 +1,41 @@
+<testcase>
+<info>
+<keywords>
+FILE
+</keywords>
+</info>
+
+<reply>
+<data>
+foo
+ bar
+bar
+ foo
+moo
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+file
+</server>
+ <name>
+basic file:// file
+ </name>
+ <command>
+file://localhost/%PWD/log/test200.txt
+</command>
+<file name="log/test200.txt">
+foo
+ bar
+bar
+ foo
+moo
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+</verify>
+</testcase>
diff --git a/tests/data/test2000 b/tests/data/test2000
new file mode 100644
index 000000000..d3edb16e5
--- /dev/null
+++ b/tests/data/test2000
@@ -0,0 +1,73 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+FILE
+multiprotocol
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data nocheck="yes">
+data
+ to
+ see
+that FTP
+works
+ so does it?
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+ftp
+file
+</server>
+ <name>
+FTP RETR followed by FILE
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/2000 file://localhost/%PWD/log/test2000.txt
+</command>
+<file name="log/test2000.txt">
+foo
+ bar
+bar
+ foo
+moo
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE I
+SIZE 2000
+RETR 2000
+QUIT
+</protocol>
+<stdout>
+data
+ to
+ see
+that FTP
+works
+ so does it?
+foo
+ bar
+bar
+ foo
+moo
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test2001 b/tests/data/test2001
new file mode 100644
index 000000000..68c0df784
--- /dev/null
+++ b/tests/data/test2001
@@ -0,0 +1,109 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+FTP
+PASV
+FILE
+multiprotocol
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data1 nocheck="yes">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+-foo-
+</data1>
+<data2 nocheck="yes">
+data
+ to
+ see
+that FTP
+works
+ so does it?
+</data2>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+ftp
+file
+</server>
+ <name>
+HTTP GET followed by FTP RETR followed by FILE
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/20010001 ftp://%HOSTIP:%FTPPORT/20010002 file://localhost/%PWD/log/test2001.txt
+</command>
+<file name="log/test2001.txt">
+foo
+ bar
+bar
+ foo
+moo
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /20010001 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE I
+SIZE 20010002
+RETR 20010002
+QUIT
+</protocol>
+<stdout>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+-foo-
+data
+ to
+ see
+that FTP
+works
+ so does it?
+foo
+ bar
+bar
+ foo
+moo
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test2002 b/tests/data/test2002
new file mode 100644
index 000000000..f39cd60f1
--- /dev/null
+++ b/tests/data/test2002
@@ -0,0 +1,125 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+FTP
+PASV
+FILE
+TFTP
+TFTP RRQ
+multiprotocol
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data1 nocheck="yes">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+-foo-
+</data1>
+<data2 nocheck="yes">
+data
+ to
+ see
+that FTP
+works
+ so does it?
+</data2>
+<data3 nocheck="yes">
+a chunk of
+data
+returned
+ to TFTP client
+</data3>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+ftp
+file
+tftp
+</server>
+ <name>
+HTTP GET followed by FTP RETR followed by FILE followed by TFTP RRQ
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/20020001 ftp://%HOSTIP:%FTPPORT/20020002 file://localhost/%PWD/log/test2002.txt tftp://%HOSTIP:%TFTPPORT//20020003
+</command>
+<file name="log/test2002.txt">
+foo
+ bar
+bar
+ foo
+moo
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /20020001 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE I
+SIZE 20020002
+RETR 20020002
+opcode: 1
+filename: /20020003
+mode: octet
+QUIT
+</protocol>
+<stdout>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+-foo-
+data
+ to
+ see
+that FTP
+works
+ so does it?
+foo
+ bar
+bar
+ foo
+moo
+a chunk of
+data
+returned
+ to TFTP client
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test2003 b/tests/data/test2003
new file mode 100644
index 000000000..57c0d24e6
--- /dev/null
+++ b/tests/data/test2003
@@ -0,0 +1,162 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+FTP
+PASV
+FILE
+TFTP
+TFTP RRQ
+multiprotocol
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data1 nocheck="yes">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+-foo-
+</data1>
+<data2 nocheck="yes">
+data
+ to
+ see
+that FTP
+works
+ so does it?
+</data2>
+<data3 nocheck="yes">
+a chunk of
+data
+returned
+ to TFTP client
+</data3>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+ftp
+file
+tftp
+</server>
+ <name>
+HTTP GET followed by FTP RETR followed by FILE followed by TFTP RRQ then again in reverse order
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/20030001 ftp://%HOSTIP:%FTPPORT/20030002 file://localhost/%PWD/log/test2003.txt tftp://%HOSTIP:%TFTPPORT//20030003 tftp://%HOSTIP:%TFTPPORT//20030003 file://localhost/%PWD/log/test2003.txt ftp://%HOSTIP:%FTPPORT/20030002 http://%HOSTIP:%HTTPPORT/20030001
+</command>
+<file name="log/test2003.txt">
+foo
+ bar
+bar
+ foo
+moo
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /20030001 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE I
+SIZE 20030002
+RETR 20030002
+opcode: 1
+filename: /20030003
+mode: octet
+opcode: 1
+filename: /20030003
+mode: octet
+EPSV
+SIZE 20030002
+RETR 20030002
+GET /20030001 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+QUIT
+</protocol>
+<stdout>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+-foo-
+data
+ to
+ see
+that FTP
+works
+ so does it?
+foo
+ bar
+bar
+ foo
+moo
+a chunk of
+data
+returned
+ to TFTP client
+a chunk of
+data
+returned
+ to TFTP client
+foo
+ bar
+bar
+ foo
+moo
+data
+ to
+ see
+that FTP
+works
+ so does it?
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+-foo-
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test2004 b/tests/data/test2004
new file mode 100644
index 000000000..bad6f7b90
--- /dev/null
+++ b/tests/data/test2004
@@ -0,0 +1,72 @@
+<testcase>
+<info>
+<keywords>
+TFTP
+TFTP RRQ
+FILE
+SFTP
+SCP
+multiprotocol
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data nocheck="yes">
+Test data file
+for tftp test
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+tftp
+sftp
+</server>
+ <name>
+TFTP RRQ followed by SFTP retrieval followed by FILE followed by SCP retrieval then again in reverse order
+ </name>
+ <command>
+--key curl_client_key --pubkey curl_client_key.pub -u %USER: tftp://%HOSTIP:%TFTPPORT//2004 sftp://%HOSTIP:%SSHPORT%PWD/log/test2004.txt file://localhost/%PWD/log/test2004.txt scp://%HOSTIP:%SSHPORT%PWD/log/test2004.txt file://localhost/%PWD/log/test2004.txt sftp://%HOSTIP:%SSHPORT%PWD/log/test2004.txt tftp://%HOSTIP:%TFTPPORT//2004 --insecure
+</command>
+<file name="log/test2004.txt">
+This is test data
+for several protocols
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+opcode: 1
+filename: /2004
+mode: octet
+opcode: 1
+filename: /2004
+mode: octet
+</protocol>
+<stdout>
+Test data file
+for tftp test
+This is test data
+for several protocols
+This is test data
+for several protocols
+This is test data
+for several protocols
+This is test data
+for several protocols
+This is test data
+for several protocols
+Test data file
+for tftp test
+</stdout>
+<valgrind>
+disable
+</valgrind>
+</verify>
+</testcase>
diff --git a/tests/data/test201 b/tests/data/test201
new file mode 100644
index 000000000..eb2422418
--- /dev/null
+++ b/tests/data/test201
@@ -0,0 +1,27 @@
+<testcase>
+# Server-side
+<reply>
+<data>
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+file
+</server>
+ <name>
+missing file:// file
+ </name>
+ <command>
+file://localhost/%PWD/log/non-existant-file.txt
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+37
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test202 b/tests/data/test202
new file mode 100644
index 000000000..517847064
--- /dev/null
+++ b/tests/data/test202
@@ -0,0 +1,31 @@
+<testcase>
+# Server-side
+<reply>
+<data>
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+file
+</server>
+ <name>
+two file:// URLs to stdout
+ </name>
+ <command>
+file://localhost/%PWD/log/test202.txt FILE://localhost/%PWD/log/test202.txt
+</command>
+<file name="log/test202.txt">
+contents in a single file
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<stdout>
+contents in a single file
+contents in a single file
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test203 b/tests/data/test203
new file mode 100644
index 000000000..c7cdce56e
--- /dev/null
+++ b/tests/data/test203
@@ -0,0 +1,36 @@
+<testcase>
+# Server-side
+<reply>
+<data>
+foo
+ bar
+bar
+ foo
+moo
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+file
+</server>
+ <name>
+file:/path URL with a single slash
+ </name>
+ <command>
+file:%PWD/log/test203.txt
+</command>
+<file name="log/test203.txt">
+foo
+ bar
+bar
+ foo
+moo
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+</verify>
+</testcase>
diff --git a/tests/data/test204 b/tests/data/test204
new file mode 100644
index 000000000..c4e219e98
--- /dev/null
+++ b/tests/data/test204
@@ -0,0 +1,34 @@
+<testcase>
+# no Server-side
+
+# Client-side
+<client>
+<server>
+file
+</server>
+ <name>
+"upload" with file://
+ </name>
+ <command>
+file://localhost/%PWD/log/result204.txt -T log/upload204.txt
+</command>
+<file name="log/upload204.txt">
+data
+in
+file
+to
+write
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<file name="log/result204.txt">
+data
+in
+file
+to
+write
+</file>
+</verify>
+</testcase>
diff --git a/tests/data/test205 b/tests/data/test205
new file mode 100644
index 000000000..edcf7fece
--- /dev/null
+++ b/tests/data/test205
@@ -0,0 +1,31 @@
+<testcase>
+# no Server-side
+
+# Client-side
+<client>
+<server>
+file
+</server>
+ <name>
+"upload" with file://
+ </name>
+ <command>
+file://localhost/%PWD/log/nonexisting/result205.txt -T log/upload205.txt
+</command>
+<file name="log/upload205.txt">
+data
+in
+file
+to
+write
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+# 23 => CURLE_WRITE_ERROR
+<errorcode>
+23
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test206 b/tests/data/test206
new file mode 100644
index 000000000..caf9113f1
--- /dev/null
+++ b/tests/data/test206
@@ -0,0 +1,100 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP CONNECT
+HTTP proxy
+proxytunnel
+HTTP proxy Digest auth
+</keywords>
+</info>
+
+# Server-side
+<reply>
+
+# this is returned first since we get no proxy-auth
+<data>
+HTTP/1.1 407 Authorization Required to proxy me my dear
+Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345"
+
+And you should ignore this data.
+</data>
+
+# this is returned when we get a GET!
+<data2>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 7
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+daniel
+</data2>
+
+# then this is returned when we get proxy-auth
+<data1000>
+HTTP/1.1 200 OK swsbounce
+Server: no
+
+Nice proxy auth sir!
+</data1000>
+
+<datacheck>
+HTTP/1.1 407 Authorization Required to proxy me my dear
+Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345"
+
+HTTP/1.1 200 OK swsbounce
+Server: no
+
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 7
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+daniel
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+crypto
+</features>
+ <name>
+HTTP proxy CONNECT auth Digest
+ </name>
+ <command>
+http://test.remote.haxx.se:206/path/2060002 --proxy http://%HOSTIP:%HTTPPORT --proxy-user silly:person --proxy-digest --proxytunnel
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent: curl/.*
+</strip>
+<protocol>
+CONNECT test.remote.haxx.se:206 HTTP/1.1
+Host: test.remote.haxx.se:206
+Proxy-Connection: Keep-Alive
+
+CONNECT test.remote.haxx.se:206 HTTP/1.1
+Host: test.remote.haxx.se:206
+Proxy-Authorization: Digest username="silly", realm="weirdorealm", nonce="12345", uri="test.remote.haxx.se:206", response="676e0836f3e1c5b31bf29770ef9d8224"
+Proxy-Connection: Keep-Alive
+
+GET /path/2060002 HTTP/1.1
+User-Agent: curl/7.12.3-CVS (i686-pc-linux-gnu) libcurl/7.12.3-CVS OpenSSL/0.9.6b zlib/1.1.4
+Host: test.remote.haxx.se:206
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test207 b/tests/data/test207
new file mode 100644
index 000000000..c2eff632c
--- /dev/null
+++ b/tests/data/test207
@@ -0,0 +1,58 @@
+<testcase>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 funky chunky! swsclose
+Server: fakeit/0.9 fakeitbad/1.0
+Transfer-Encoding: chunked
+Connection: mooo
+
+41
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+
+</data>
+<datacheck>
+HTTP/1.1 200 funky chunky! swsclose
+Server: fakeit/0.9 fakeitbad/1.0
+Transfer-Encoding: chunked
+Connection: mooo
+
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET with chunked Transfer-Encoding closed pre-maturely
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/207
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /207 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+
+# curl: (18) transfer closed with outstanding read data remaining
+# 18 == CURLE_PARTIAL_FILE
+<errorcode>
+18
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test208 b/tests/data/test208
new file mode 100644
index 000000000..a7a99b900
--- /dev/null
+++ b/tests/data/test208
@@ -0,0 +1,75 @@
+<testcase>
+<info>
+<keywords>
+FTP
+HTTP
+HTTP PUT
+HTTP proxy
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.0 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+
+blablabla
+
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+ftp
+</features>
+ <name>
+HTTP PUT to a FTP URL with username+password - over HTTP proxy
+ </name>
+ <command>
+-x http://%HOSTIP:%HTTPPORT ftp://daniel:mysecret@host.com/we/want/208 -T log/test208.txt
+</command>
+<file name="log/test208.txt">
+Weird
+ file
+ to
+ upload
+for
+ testing
+the
+ PUT
+ feature
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+PUT ftp://daniel:mysecret@host.com/we/want/208 HTTP/1.1
+Authorization: Basic ZGFuaWVsOm15c2VjcmV0
+Host: host.com:21
+Accept: */*
+Proxy-Connection: Keep-Alive
+Content-Length: 78
+Expect: 100-continue
+
+Weird
+ file
+ to
+ upload
+for
+ testing
+the
+ PUT
+ feature
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test209 b/tests/data/test209
new file mode 100644
index 000000000..81cdcbd84
--- /dev/null
+++ b/tests/data/test209
@@ -0,0 +1,119 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP CONNECT
+HTTP proxy
+HTTP proxy NTLM auth
+</keywords>
+</info>
+
+# Server-side
+<reply>
+
+# this is returned first since we get no proxy-auth
+<data1001>
+HTTP/1.1 407 Authorization Required to proxy me my dear
+Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+
+And you should ignore this data.
+</data1001>
+
+# This is supposed to be returned when the server gets the second
+# Authorization: NTLM line passed-in from the client
+<data1002>
+HTTP/1.1 200 Things are fine in proxy land
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+
+</data1002>
+
+# this is returned when we get a GET!
+<data2>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 7
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+daniel
+</data2>
+
+# then this is returned when we get proxy-auth
+<data1000>
+HTTP/1.1 200 OK swsbounce
+Server: no
+
+Nice proxy auth sir!
+</data1000>
+
+<datacheck>
+HTTP/1.1 407 Authorization Required to proxy me my dear
+Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+
+HTTP/1.1 200 Things are fine in proxy land
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 7
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+daniel
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+NTLM
+</features>
+ <name>
+HTTP proxy CONNECT auth NTLM
+ </name>
+ <setenv>
+# we force our own host name, in order to make the test machine independent
+CURL_GETHOSTNAME=curlhost
+# we try to use the LD_PRELOAD hack, if not a debug build
+LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
+ </setenv>
+ <command>
+http://test.remote.haxx.se:209/path/2090002 --proxy http://%HOSTIP:%HTTPPORT --proxy-user silly:person --proxy-ntlm --proxytunnel
+</command>
+<precheck>
+chkhostname curlhost
+</precheck>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent: curl/.*
+</strip>
+<protocol>
+CONNECT test.remote.haxx.se:209 HTTP/1.1
+Host: test.remote.haxx.se:209
+Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
+Proxy-Connection: Keep-Alive
+
+CONNECT test.remote.haxx.se:209 HTTP/1.1
+Host: test.remote.haxx.se:209
+Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAABQAFAHAAAAAIAAgAdQAAAAAAAAAAAAAABoKBAKAeQjzKtCQ7ubW8S6MN7B59436GAxPu0CVROwwNBsgxML49gcbAXLT/bU+H5wrS9XNpbGx5Y3VybGhvc3Q=
+Proxy-Connection: Keep-Alive
+
+GET /path/2090002 HTTP/1.1
+User-Agent: curl/7.12.3-CVS (i686-pc-linux-gnu) libcurl/7.12.3-CVS OpenSSL/0.9.6b zlib/1.1.4
+Host: test.remote.haxx.se:209
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test21 b/tests/data/test21
new file mode 100644
index 000000000..8e4e847e0
--- /dev/null
+++ b/tests/data/test21
@@ -0,0 +1,33 @@
+<testcase>
+<info>
+<keywords>
+FAILURE
+multiple HTTP requests
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+use curl with multiple request methods
+ </name>
+ <command>
+-I -d FOOO -F moo=moo localhost
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+2
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test210 b/tests/data/test210
new file mode 100644
index 000000000..83c9b3e7b
--- /dev/null
+++ b/tests/data/test210
@@ -0,0 +1,46 @@
+<testcase>
+# Server-side
+<reply>
+<data>
+data blobb
+</data>
+
+# data is sent to stdout
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+Get two FTP files from the same remote dir: no second CWD
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/a/path/210 ftp://%HOSTIP:%FTPPORT/a/path/210
+</command>
+<stdout>
+data blobb
+data blobb
+</stdout>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD a
+CWD path
+EPSV
+TYPE I
+SIZE 210
+RETR 210
+EPSV
+SIZE 210
+RETR 210
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test211 b/tests/data/test211
new file mode 100644
index 000000000..0214effc8
--- /dev/null
+++ b/tests/data/test211
@@ -0,0 +1,48 @@
+<testcase>
+# Server-side
+<reply>
+<data>
+data blobb
+</data>
+<servercmd>
+REPLY EPSV 500 no such command
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+Get two FTP files with no remote EPSV support
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/a/path/211 ftp://%HOSTIP:%FTPPORT/a/path/211
+</command>
+<stdout>
+data blobb
+data blobb
+</stdout>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD a
+CWD path
+EPSV
+PASV
+TYPE I
+SIZE 211
+RETR 211
+PASV
+SIZE 211
+RETR 211
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test212 b/tests/data/test212
new file mode 100644
index 000000000..8a10abfba
--- /dev/null
+++ b/tests/data/test212
@@ -0,0 +1,57 @@
+<testcase>
+# Server-side
+<reply>
+<data>
+data blobb
+</data>
+<servercmd>
+REPLY EPRT 500 no such command
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+# EPRT is only sent when IPv6 is enabled
+<features>
+ipv6
+</features>
+ <name>
+Get two FTP files with no remote EPRT support
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/a/path/212 ftp://%HOSTIP:%FTPPORT/a/path/212 -P -
+</command>
+<stdout>
+data blobb
+data blobb
+</stdout>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+# Strip the addresses and port number but leave the rest
+<strippart>
+s/^(EPRT \|1\|)\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|/$1/
+s/^(PORT )\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}/$1/
+</strippart>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD a
+CWD path
+EPRT |1|
+PORT
+TYPE I
+SIZE 212
+RETR 212
+PORT
+SIZE 212
+RETR 212
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test213 b/tests/data/test213
new file mode 100644
index 000000000..bb7763bb6
--- /dev/null
+++ b/tests/data/test213
@@ -0,0 +1,122 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP POST
+HTTP CONNECT
+HTTP proxy
+HTTP proxy NTLM auth
+</keywords>
+</info>
+
+# Server-side
+<reply>
+
+# this is returned first since we get no proxy-auth
+<data1001>
+HTTP/1.1 407 Authorization Required to proxy me my dear
+Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+
+And you should ignore this data.
+</data1001>
+
+# This is supposed to be returned when the server gets the second
+# Authorization: NTLM line passed-in from the client
+<data1002>
+HTTP/1.1 200 Things are fine in proxy land
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+
+</data1002>
+
+# this is returned when we get a GET!
+<data2>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 7
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+daniel
+</data2>
+
+# then this is returned when we get proxy-auth
+<data1000>
+HTTP/1.1 200 OK swsbounce
+Server: no
+
+Nice proxy auth sir!
+</data1000>
+
+<datacheck>
+HTTP/1.1 407 Authorization Required to proxy me my dear
+Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+
+HTTP/1.1 200 Things are fine in proxy land
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 7
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+daniel
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+NTLM
+</features>
+ <name>
+HTTP 1.0 proxy CONNECT auth NTLM and then POST
+ </name>
+ <setenv>
+# we force our own host name, in order to make the test machine independent
+CURL_GETHOSTNAME=curlhost
+# we try to use the LD_PRELOAD hack, if not a debug build
+LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
+ </setenv>
+ <command>
+http://test.remote.haxx.se:213/path/2130002 --proxy1.0 http://%HOSTIP:%HTTPPORT --proxy-user silly:person --proxy-ntlm --proxytunnel -d "postit"
+</command>
+<precheck>
+chkhostname curlhost
+</precheck>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent: curl/.*
+</strip>
+<protocol nonewline="yes">
+CONNECT test.remote.haxx.se:213 HTTP/1.0
+Host: test.remote.haxx.se:213
+Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
+Proxy-Connection: Keep-Alive
+
+CONNECT test.remote.haxx.se:213 HTTP/1.0
+Host: test.remote.haxx.se:213
+Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAABQAFAHAAAAAIAAgAdQAAAAAAAAAAAAAABoKBAKAeQjzKtCQ7ubW8S6MN7B59436GAxPu0CVROwwNBsgxML49gcbAXLT/bU+H5wrS9XNpbGx5Y3VybGhvc3Q=
+Proxy-Connection: Keep-Alive
+
+POST /path/2130002 HTTP/1.1
+User-Agent: curl/7.12.3-CVS (i686-pc-linux-gnu) libcurl/7.12.3-CVS OpenSSL/0.9.6b zlib/1.1.4
+Host: test.remote.haxx.se:213
+Accept: */*
+Content-Length: 6
+Content-Type: application/x-www-form-urlencoded
+
+postit
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test214 b/tests/data/test214
new file mode 100644
index 000000000..e12dfbfe1
--- /dev/null
+++ b/tests/data/test214
@@ -0,0 +1,44 @@
+<testcase>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 6
+Content-Type: text/html
+Funny-head: yesyes
+
+-foo-
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP URL with escaped { and }
+ </name>
+<command>
+"http://%HOSTIP:%HTTPPORT/\{\}\/214"
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /{}\/214 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+
+</verify>
+</testcase>
diff --git a/tests/data/test215 b/tests/data/test215
new file mode 100644
index 000000000..500581789
--- /dev/null
+++ b/tests/data/test215
@@ -0,0 +1,52 @@
+<testcase>
+# Server-side
+<reply>
+# When doing LIST, we get the default list output hard-coded in the test
+# FTP server
+<datacheck>
+total 20
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
+drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
+-r--r--r-- 1 0 1 35 Jul 16 1996 README
+lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
+dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
+drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
+dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
+drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
+dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+Get two FTP dir listings from the same remote dir: no second CWD
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/a/path/215/ ftp://%HOSTIP:%FTPPORT/a/path/215/
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD a
+CWD path
+CWD 215
+EPSV
+TYPE A
+LIST
+EPSV
+LIST
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test216 b/tests/data/test216
new file mode 100644
index 000000000..a8264ce5b
--- /dev/null
+++ b/tests/data/test216
@@ -0,0 +1,39 @@
+<testcase>
+# Server-side
+<reply>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP upload two files to the same dir
+ </name>
+ <command>
+-T log/upload.216 ftp://%HOSTIP:%FTPPORT/a/path/216/ -T log/upload.216 ftp://%HOSTIP:%FTPPORT/a/path/216/%2e%2eanotherup
+</command>
+<file name="log/upload.216">
+upload this file twice
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD a
+CWD path
+CWD 216
+EPSV
+TYPE I
+STOR upload.216
+EPSV
+STOR ..anotherup
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test217 b/tests/data/test217
new file mode 100644
index 000000000..f28800853
--- /dev/null
+++ b/tests/data/test217
@@ -0,0 +1,60 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP CONNECT
+HTTP proxy
+proxytunnel
+followlocation
+--write-out
+</keywords>
+</info>
+
+# Server-side
+<reply>
+
+# this is returned first since we get no proxy-auth
+<data nocheck="yes">
+HTTP/1.1 405 Method Not Allowed swsclose
+
+And you should ignore this data.
+</data>
+
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP proxy CONNECT to proxy returning 405
+ </name>
+ <command>
+http://test.remote.haxx.se:217/path/2170002 --proxy http://%HOSTIP:%HTTPPORT --proxytunnel -w "%{http_code} %{http_connect}\n"
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent: curl/.*
+</strip>
+<protocol>
+CONNECT test.remote.haxx.se:217 HTTP/1.1
+Host: test.remote.haxx.se:217
+Proxy-Connection: Keep-Alive
+
+</protocol>
+# CURLE_RECV_ERROR
+<errorcode>
+56
+</errorcode>
+<stdout>
+HTTP/1.1 405 Method Not Allowed swsclose
+
+000 405
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test218 b/tests/data/test218
new file mode 100644
index 000000000..dc146fc0d
--- /dev/null
+++ b/tests/data/test218
@@ -0,0 +1,52 @@
+<testcase>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.0 200 OK
+Server: test-server/fake
+Content-Type: text/html
+Content-Length: 6
+
+blaha
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP PUT from a file but enforce chunked transfer-encoding
+ </name>
+ <command>
+ -T log/file218 -H "Transfer-Encoding: chunked" http://%HOSTIP:%HTTPPORT/218
+</command>
+<file name="log/file218">
+just some tiny teeny contents
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+PUT /218 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Transfer-Encoding: chunked
+Expect: 100-continue
+
+1e
+just some tiny teeny contents
+
+0
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test22 b/tests/data/test22
new file mode 100644
index 000000000..734379e87
--- /dev/null
+++ b/tests/data/test22
@@ -0,0 +1,46 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP PUT
+long URL
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Funny-head: yesyes
+Content-Length: 27
+
+This is the proof it works
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+get HTTP with URL > 10000 bytes
+ </name>
+ <command>
+%HOSTIP:%HTTPPORT/`perl -e "print \"a\" x 10000;"`/22
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent: curl/.*
+</strip>
+<protocol>
+GET /aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/22 HTTP/1.1
+User-Agent: curl/7.4.2 (sparc-sun-solaris2.7) libcurl 7.4.2 (SSL 0.9.6)
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test220 b/tests/data/test220
new file mode 100644
index 000000000..2fb0b8a6a
--- /dev/null
+++ b/tests/data/test220
@@ -0,0 +1,68 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+compressed
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data base64="yes">
+SFRUUC8xLjEgMjAwIE9LDQpEYXRlOiBNb24sIDI5IE5vdiAyMDA0IDIxOjU2OjUzIEdNVA0KU2Vy
+dmVyOiBBcGFjaGUvMS4zLjMxIChEZWJpYW4gR05VL0xpbnV4KSBtb2RfZ3ppcC8xLjMuMjYuMWEg
+UEhQLzQuMy45LTEgbW9kX3NzbC8yLjguMjAgT3BlblNTTC8wLjkuN2QgbW9kX3BlcmwvMS4yOQ0K
+VmFyeTogQWNjZXB0LUVuY29kaW5nDQpDb250ZW50LVR5cGU6IHRleHQvaHRtbDsgY2hhcnNldD1J
+U08tODg1OS0xDQpDb250ZW50LUVuY29kaW5nOiBHWklQDQpDb250ZW50LUxlbmd0aDogNDQNCg0K
+H4sICHmeq0EAA2xhbGFsYQDLycxLVTDkUsgB0UZcChCGMRcACgJxYBgAAAA=
+</data>
+
+<datacheck>
+HTTP/1.1 200 OK
+Date: Mon, 29 Nov 2004 21:56:53 GMT
+Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29
+Vary: Accept-Encoding
+Content-Type: text/html; charset=ISO-8859-1
+Content-Encoding: GZIP
+Content-Length: 44
+
+line 1
+ line 2
+ line 3
+</datacheck>
+
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+libz
+</features>
+<server>
+http
+</server>
+ <name>
+HTTP GET gzip compressed content
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/220 --compressed
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /220 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Accept-Encoding: deflate, gzip
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test221 b/tests/data/test221
new file mode 100644
index 000000000..95edb4990
--- /dev/null
+++ b/tests/data/test221
@@ -0,0 +1,71 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+compressed
+FAILURE
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data base64="yes">
+SFRUUC8xLjEgMjAwIE9LDQpEYXRlOiBNb24sIDI5IE5vdiAyMDA0IDIxOjU2OjUzIEdNVA0KU2Vy
+dmVyOiBBcGFjaGUvMS4zLjMxIChEZWJpYW4gR05VL0xpbnV4KSBtb2RfZ3ppcC8xLjMuMjYuMWEg
+UEhQLzQuMy45LTEgbW9kX3NzbC8yLjguMjAgT3BlblNTTC8wLjkuN2QgbW9kX3BlcmwvMS4yOQ0K
+VmFyeTogQWNjZXB0LUVuY29kaW5nDQpDb250ZW50LVR5cGU6IHRleHQvaHRtbDsgY2hhcnNldD1J
+U08tODg1OS0xDQpDb250ZW50LUVuY29kaW5nOiBnemlwDQpDb250ZW50LUxlbmd0aDogNDENCg0K
+CHmeq0EAA2xhbGFsYQDLycxLVTDkUsgB0UZcChCGMRcACgJxYBgAAAA=
+</data>
+
+# I removed the first three bytes of the gzip compressed contents
+
+<datacheck>
+HTTP/1.1 200 OK
+Date: Mon, 29 Nov 2004 21:56:53 GMT
+Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29
+Vary: Accept-Encoding
+Content-Type: text/html; charset=ISO-8859-1
+Content-Encoding: gzip
+Content-Length: 41
+
+</datacheck>
+
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+libz
+</features>
+<server>
+http
+</server>
+ <name>
+HTTP GET gzip compressed content with broken gzip header
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/221 --compressed
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /221 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Accept-Encoding: deflate, gzip
+
+</protocol>
+<errorcode>
+61
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test222 b/tests/data/test222
new file mode 100644
index 000000000..a4594869e
--- /dev/null
+++ b/tests/data/test222
@@ -0,0 +1,199 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+compressed
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data base64="yes">
+SFRUUC8xLjEgMjAwIE9LDQpEYXRlOiBNb24sIDI5IE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TTP/1.1 200 OK
+Date: Mon, 29 Nov 2004 21:56:53 GMT
+Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29
+Vary: Accept-Encoding
+Content-Type: text/html; charset=ISO-8859-1
+Content-Encoding: deflate
+Content-Length: 1305
+
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE project-listing SYSTEM "http://freshmeat.net/backend/fm-projects-0.4.dtd">
+<project-listing>
+ <project>
+ <project_id>1612</project_id>
+ <date_added>1998-08-21 04:01:29</date_added>
+ <date_updated>2004-10-18 02:22:23</date_updated>
+ <projectname_short>curl</projectname_short>
+ <projectname_full>curl and libcurl</projectname_full>
+ <desc_short>Command line tool and library for client-side URL transfers.</desc_short>
+ <desc_full>curl and libcurl is a tool for transferring files
+using URL syntax. It supports HTTP, HTTPS, FTP,
+FTPS, DICT, TELNET, LDAP, FILE, and GOPHER, as
+well as HTTP-post, HTTP-put, cookies, FTP upload,
+resumed transfers, passwords, portnumbers, SSL
+certificates, Kerberos, and proxies. It is powered
+by libcurl, the client-side URL transfer library.
+There are bindings to libcurl for over 20
+languages and environments.
+</desc_full>
+ <vitality_score>5784.57</vitality_score>
+ <vitality_percent>3.16</vitality_percent>
+ <vitality_rank>169</vitality_rank>
+ <popularity_score>6594.54</popularity_score>
+ <popularity_percent>13.81</popularity_percent>
+ <popularity_rank>105</popularity_rank>
+ <rating>8.50</rating>
+ <rating_count>21</rating_count>
+ <rating_rank>183</rating_rank>
+ <subscriptions>323</subscriptions>
+ <branch_name>Default</branch_name>
+ <url_project_page>http://freshmeat.net/projects/curl/</url_project_page>
+ <url_homepage>http://freshmeat.net/redir/curl/1612/url_homepage/</url_homepage>
+ <url_tgz>http://freshmeat.net/redir/curl/1612/url_tgz/</url_tgz>
+ <url_bz2>http://freshmeat.net/redir/curl/1612/url_bz2/</url_bz2>
+ <url_zip>http://freshmeat.net/redir/curl/1612/url_zip/</url_zip>
+ <url_changelog>http://freshmeat.net/redir/curl/1612/url_changelog/</url_changelog>
+ <url_rpm>http://freshmeat.net/redir/curl/1612/url_rpm/</url_rpm>
+ <url_deb>http://freshmeat.net/redir/curl/1612/url_deb/</url_deb>
+ <url_osx>http://freshmeat.net/redir/curl/1612/url_osx/</url_osx>
+ <url_bsdport>http://freshmeat.net/redir/curl/1612/url_bsdport/</url_bsdport>
+ <url_purchase></url_purchase>
+ <url_cvs>http://freshmeat.net/redir/curl/1612/url_cvs/</url_cvs>
+ <url_list>http://freshmeat.net/redir/curl/1612/url_list/</url_list>
+ <url_mirror>http://freshmeat.net/redir/curl/1612/url_mirror/</url_mirror>
+ <url_demo></url_demo>
+ <license>MIT/X Consortium License</license>
+ <latest_release>
+ <latest_release_version>7.12.2</latest_release_version>
+ <latest_release_id>176085</latest_release_id>
+ <latest_release_date>2004-10-18 02:22:23</latest_release_date>
+ </latest_release>
+ <screenshot_thumb></screenshot_thumb>
+ <authors>
+ <author>
+ <author_name>Daniel Stenberg</author_name>
+ <author_url>http://freshmeat.net/~bagder/</author_url>
+ <author_role>Owner</author_role>
+ </author>
+ </authors>
+ <descriminators>
+ <trove_id>12</trove_id>
+ <trove_id>226</trove_id>
+ <trove_id>3</trove_id>
+ <trove_id>2</trove_id>
+ <trove_id>188</trove_id>
+ <trove_id>216</trove_id>
+ <trove_id>200</trove_id>
+ <trove_id>220</trove_id>
+ <trove_id>164</trove_id>
+ <trove_id>90</trove_id>
+ <trove_id>89</trove_id>
+ <trove_id>809</trove_id>
+ <trove_id>150</trove_id>
+ <trove_id>224</trove_id>
+ <trove_id>900</trove_id>
+ <trove_id>839</trove_id>
+ </descriminators>
+ <dependencies>
+ <dependency type="recommended">
+ <dependency_release_id>0</dependency_release_id>
+ <dependency_branch_id>7464</dependency_branch_id>
+ <dependency_project_id>7464</dependency_project_id>
+ <dependency_project_title>OpenSSL (Default)</dependency_project_title>
+ </dependency>
+ <dependency type="optional">
+ <dependency_release_id>0</dependency_release_id>
+ <dependency_branch_id>0</dependency_branch_id>
+ <dependency_project_id>7443</dependency_project_id>
+ <dependency_project_title>OpenLDAP</dependency_project_title>
+ </dependency>
+ <dependency type="optional">
+ <dependency_release_id>0</dependency_release_id>
+ <dependency_branch_id>0</dependency_branch_id>
+ <dependency_project_id>12351</dependency_project_id>
+ <dependency_project_title>zlib</dependency_project_title>
+ </dependency>
+ <dependency type="optional">
+ <dependency_release_id>0</dependency_release_id>
+ <dependency_branch_id>0</dependency_branch_id>
+ <dependency_project_id>32047</dependency_project_id>
+ <dependency_project_title>Heimdal</dependency_project_title>
+ </dependency>
+ <dependency type="optional">
+ <dependency_release_id>0</dependency_release_id>
+ <dependency_branch_id>0</dependency_branch_id>
+ <dependency_project_id>44532</dependency_project_id>
+ <dependency_project_title>c-ares</dependency_project_title>
+ </dependency>
+ </dependencies>
+ </project>
+</project-listing>
+</datacheck>
+
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+libz
+</features>
+<server>
+http
+</server>
+ <name>
+HTTP GET deflate compressed content
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/222 --compressed
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /222 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Accept-Encoding: deflate, gzip
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test223 b/tests/data/test223
new file mode 100644
index 000000000..196e78c80
--- /dev/null
+++ b/tests/data/test223
@@ -0,0 +1,92 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+compressed
+FAILURE
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+# this deflate chunk has three bytes removed from the beginning
+<data base64="yes">
+SFRUUC8xLjEgMjAwIE9LDQpEYXRlOiBNb24sIDI5IE5vdiAyMDA0IDIxOjU2OjUzIEdNVA0KU2Vy
+dmVyOiBBcGFjaGUvMS4zLjMxICh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.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29
+Vary: Accept-Encoding
+Content-Type: text/html; charset=ISO-8859-1
+Content-Encoding: deflate
+Content-Length: 1305
+
+</datacheck>
+
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+libz
+</features>
+<server>
+http
+</server>
+ <name>
+HTTP GET deflate compressed content with broken deflate header
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/223 --compressed
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /223 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Accept-Encoding: deflate, gzip
+
+</protocol>
+<errorcode>
+61
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test224 b/tests/data/test224
new file mode 100644
index 000000000..1c8ad2380
--- /dev/null
+++ b/tests/data/test224
@@ -0,0 +1,104 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+compressed
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data base64="yes">
+SFRUUC8xLjEgMjAwIE9LDQpEYXRlOiBNb24sIDI5IE5vdiAyMDA0IDIxOjU2OjUzIEdNVA0KU2Vy
+dmVyOiBBcGFjaGUvMS4zLjMxIChEZWJpYW4gR05VL0xpbnV4KSBtb2RfZ3ppcC8xLjMuMjYuMWEg
+UEhQLzQuMy45LTEgbW9kX3NzbC8yLjguMjAgT3BlblNTTC8wLjkuN2QgbW9kX3BlcmwvMS4yOQ0K
+VmFyeTogQWNjZXB0LUVuY29kaW5nDQpDb250ZW50LVR5cGU6IHRleHQvaHRtbDsgY2hhcnNldD1J
+U08tODg1OS0xDQpDb250ZW50LUVuY29kaW5nOiBnemlwDQpDb250ZW50LUxlbmd0aDogMjE4Ng0K
+DQofiwgcv7yrQQIDMAB0aGlzIGlzIGFuIGV4dHJhIGZpZWxkIHRoYXQgbXVzdCBiZSByZW1vdmVk
+X19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text/html; charset=ISO-8859-1
+Content-Encoding: gzip
+Content-Length: 2186
+
+uncompressed gzip data with long gzip header
+</datacheck>
+
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+libz
+</features>
+<server>
+http
+</server>
+ <name>
+HTTP GET gzip compressed content with huge comment and extra field
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/224 --compressed
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /224 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Accept-Encoding: deflate, gzip
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test225 b/tests/data/test225
new file mode 100644
index 000000000..a6447125d
--- /dev/null
+++ b/tests/data/test225
@@ -0,0 +1,28 @@
+<testcase>
+<info>
+<keywords>
+FTP
+FAILURE
+</keywords>
+</info>
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP %0a-code in URL's name part
+ </name>
+ <command>
+ftp://bad%0auser:passwd@%HOSTIP:%FTPPORT/225%0a
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+# 3 == CURLE_URL_MALFORMAT
+<errorcode>
+3
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test226 b/tests/data/test226
new file mode 100644
index 000000000..9fc4bda3d
--- /dev/null
+++ b/tests/data/test226
@@ -0,0 +1,29 @@
+<testcase>
+<info>
+<keywords>
+FTP
+FAILURE
+</keywords>
+</info>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP %0d-code in URL's CWD part
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/226%0d
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+# 3 == CURLE_URL_MALFORMAT
+<errorcode>
+3
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test227 b/tests/data/test227
new file mode 100644
index 000000000..523fa0253
--- /dev/null
+++ b/tests/data/test227
@@ -0,0 +1,58 @@
+<testcase>
+<info>
+<keywords>
+FTP
+post-quote
+pre-quote
+quote
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+data
+ to
+ see
+that FTP
+works
+ so does it?
+</data>
+<servercmd>
+REPLY EPSV 500 no such command
+REPLY FAIL 500 this might not be a failure!
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP with quote ops
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/227 -Q "NOOP 1" -Q "+NOOP 2" -Q "-NOOP 3" -Q "*FAIL" -Q "+*FAIL HARD"
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+NOOP 1
+FAIL
+EPSV
+PASV
+TYPE I
+NOOP 2
+FAIL HARD
+SIZE 227
+RETR 227
+NOOP 3
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test228 b/tests/data/test228
new file mode 100644
index 000000000..f581583f3
--- /dev/null
+++ b/tests/data/test228
@@ -0,0 +1,52 @@
+<testcase>
+<info>
+<keywords>
+FTP
+ACCT
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+data
+ to
+ see
+that FTP
+works
+ so does it?
+</data>
+<servercmd>
+REPLY PASS 332 please provide account name
+REPLY ACCT 230 thank you
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP RETR with ACCT
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/228 --ftp-account "one count"
+</command>
+</client>
+
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+ACCT one count
+PWD
+EPSV
+TYPE I
+SIZE 228
+RETR 228
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test229 b/tests/data/test229
new file mode 100644
index 000000000..d337468ac
--- /dev/null
+++ b/tests/data/test229
@@ -0,0 +1,41 @@
+<testcase>
+<info>
+<keywords>
+FTP
+ACCT
+FAILURE
+</keywords>
+</info>
+# Server-side
+<reply>
+<servercmd>
+REPLY PASS 332 please provide account name
+REPLY ACCT 532 bluah!
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP RETR with bad ACCT
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/229 --ftp-account "one count"
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+ACCT one count
+</protocol>
+<errorcode>
+11
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test23 b/tests/data/test23
new file mode 100644
index 000000000..46872e82e
--- /dev/null
+++ b/tests/data/test23
@@ -0,0 +1,33 @@
+<testcase>
+<info>
+<keywords>
+unsupported protocol
+FAILURE
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+unsupported protocol:// URL
+ </name>
+ <command>
+htfp://%HOSTIP:%HTTPPORT/none.htfml
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+1
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test231 b/tests/data/test231
new file mode 100644
index 000000000..912ea4125
--- /dev/null
+++ b/tests/data/test231
@@ -0,0 +1,32 @@
+<testcase>
+# Server-side
+<reply>
+# 16 bytes to check
+<datacheck>
+B01234567
+C01234567
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+file
+</server>
+ <name>
+file:// with resume
+ </name>
+ <command>
+file://localhost/%PWD/log/test231.txt -C 10-
+</command>
+<file name="log/test231.txt">
+A01234567
+B01234567
+C01234567
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+</verify>
+</testcase>
diff --git a/tests/data/test233 b/tests/data/test233
new file mode 100644
index 000000000..d165da952
--- /dev/null
+++ b/tests/data/test233
@@ -0,0 +1,94 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP proxy
+HTTP Basic auth
+HTTP proxy Basic auth
+followlocation
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 302 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/html
+Funny-head: yesyes
+Location: http://goto.second.host.now/2330002
+Content-Length: 8
+Connection: close
+
+contents
+</data>
+<data2>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/html
+Funny-head: yesyes
+Content-Length: 9
+
+contents
+</data2>
+
+<datacheck>
+HTTP/1.1 302 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/html
+Funny-head: yesyes
+Location: http://goto.second.host.now/2330002
+Content-Length: 8
+Connection: close
+
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/html
+Funny-head: yesyes
+Content-Length: 9
+
+contents
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP, proxy, site+proxy auth and Location: to new host
+ </name>
+ <command>
+http://first.host.it.is/we/want/that/page/233 -x %HOSTIP:%HTTPPORT --user iam:myself --proxy-user testing:this --location
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET http://first.host.it.is/we/want/that/page/233 HTTP/1.1
+Proxy-Authorization: Basic dGVzdGluZzp0aGlz
+Authorization: Basic aWFtOm15c2VsZg==
+Host: first.host.it.is
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+GET http://goto.second.host.now/2330002 HTTP/1.1
+Proxy-Authorization: Basic dGVzdGluZzp0aGlz
+Host: goto.second.host.now
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test234 b/tests/data/test234
new file mode 100644
index 000000000..d8c708109
--- /dev/null
+++ b/tests/data/test234
@@ -0,0 +1,97 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP proxy
+HTTP proxy Basic auth
+followlocation
+--location-trusted
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 302 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/html
+Funny-head: yesyes
+Location: http://goto.second.host.now/2340002
+Content-Length: 8
+Connection: close
+
+contents
+</data>
+<data2>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/html
+Funny-head: yesyes
+Content-Length: 9
+
+contents
+</data2>
+
+<datacheck>
+HTTP/1.1 302 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/html
+Funny-head: yesyes
+Location: http://goto.second.host.now/2340002
+Content-Length: 8
+Connection: close
+
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/html
+Funny-head: yesyes
+Content-Length: 9
+
+contents
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP, proxy, site+proxy auth and Location: to new host using location-trusted
+ </name>
+ <command>
+http://first.host.it.is/we/want/that/page/234 -x %HOSTIP:%HTTPPORT --user iam:myself --proxy-user testing:this --location-trusted
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET http://first.host.it.is/we/want/that/page/234 HTTP/1.1
+Proxy-Authorization: Basic dGVzdGluZzp0aGlz
+Authorization: Basic aWFtOm15c2VsZg==
+Host: first.host.it.is
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+GET http://goto.second.host.now/2340002 HTTP/1.1
+Proxy-Authorization: Basic dGVzdGluZzp0aGlz
+Authorization: Basic aWFtOm15c2VsZg==
+Host: goto.second.host.now
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test235 b/tests/data/test235
new file mode 100644
index 000000000..ee843f141
--- /dev/null
+++ b/tests/data/test235
@@ -0,0 +1,42 @@
+<testcase>
+# Server-side
+<reply>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP resumed upload but no file present remotely
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/235 -T log/upload235 -C -
+</command>
+<file name="log/upload235">
+this is the *****crap******** that we're gonna upload
+
+worx?
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE I
+SIZE 235
+STOR 235
+QUIT
+</protocol>
+<upload>
+this is the *****crap******** that we're gonna upload
+
+worx?
+</upload>
+</verify>
+</testcase>
diff --git a/tests/data/test236 b/tests/data/test236
new file mode 100644
index 000000000..20d047038
--- /dev/null
+++ b/tests/data/test236
@@ -0,0 +1,47 @@
+<testcase>
+
+# Server-side
+<reply>
+<servercmd>
+REPLY SIZE 550 access to this file is very much denied
+REPLY APPE 550 I said: access to this file is very much denied
+REPLY STOR 550 I said: access to this file is very much denied
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP resume upload but denied access to remote file
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/236 -T log/file236.txt -C -
+</command>
+<file name="log/file236.txt">
+Test data
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE I
+SIZE 236
+STOR 236
+QUIT
+</protocol>
+
+# (25) Failed FTP upload: 550
+<errorcode>
+25
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test237 b/tests/data/test237
new file mode 100644
index 000000000..9675a1e44
--- /dev/null
+++ b/tests/data/test237
@@ -0,0 +1,42 @@
+<testcase>
+# Server-side
+<reply>
+<servercmd>
+REPLY PASV 227 Entering Passiv Mode (1216,256,2,127,127,127)
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP getting bad host in 227-response to PASV
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/237 --disable-epsv
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+# The bogus address used here is chosen specifically so that when processed on
+# certain hosts with buggy resolver code, the resulting address (192.0.2.127)
+# is from an address block that is guaranteed never to be assigned (RFC3330).
+<verify>
+# curl: (15) Can't resolve new host 1216.256.2.127:32639
+# 15 => CURLE_FTP_CANT_GET_HOST
+# some systems just don't fail on the illegal host name/address but instead
+# moves on and attempt to connect to... yes, to what?
+# 7= CURLE_COULDNT_CONNECT
+<errorcode>
+15, 7
+</errorcode>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+PASV
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test238 b/tests/data/test238
new file mode 100644
index 000000000..6397e3b27
--- /dev/null
+++ b/tests/data/test238
@@ -0,0 +1,41 @@
+<testcase>
+# Server-side
+<reply>
+<servercmd>
+REPLY EPSV 229 Entering Passiv Mode (|||1000000|)
+REPLY PASV 227 Entering Passiv Mode (1216,256,2,127,127,127)
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP getting bad port in response to EPSV and in response to PASV
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/238
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+# curl: (15) Can't resolve new host 1216.256.2.127:32639
+# 15 => CURLE_FTP_CANT_GET_HOST
+# some systems just don't fail on the illegal host name/address but instead
+# moves on and attempt to connect to... yes, to what?
+# 7= CURLE_COULDNT_CONNECT
+<errorcode>
+7, 15
+</errorcode>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+PASV
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test239 b/tests/data/test239
new file mode 100644
index 000000000..2748100fb
--- /dev/null
+++ b/tests/data/test239
@@ -0,0 +1,100 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP POST
+HTTP proxy
+HTTP proxy NTLM auth
+</keywords>
+</info>
+
+# Server-side
+<reply>
+
+# this is returned first since we get no proxy-auth
+<data1001>
+HTTP/1.1 407 Authorization Required to proxy me my dear
+Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+Content-Length: 34
+
+Hey you, authenticate or go away!
+</data1001>
+
+# This is supposed to be returned when the server gets the second
+# Authorization: NTLM line passed-in from the client
+<data1002>
+HTTP/1.1 200 Things are fine in proxy land swsclose
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 42
+
+Contents of that page you requested, sir.
+</data1002>
+
+<datacheck>
+HTTP/1.1 407 Authorization Required to proxy me my dear
+Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+Content-Length: 34
+
+HTTP/1.1 200 Things are fine in proxy land swsclose
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 42
+
+Contents of that page you requested, sir.
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+NTLM
+</features>
+ <name>
+HTTP proxy-auth NTLM and then POST
+ </name>
+ <setenv>
+# we force our own host name, in order to make the test machine independent
+CURL_GETHOSTNAME=curlhost
+# we try to use the LD_PRELOAD hack, if not a debug build
+LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
+ </setenv>
+ <command>
+http://%HOSTIP:%HTTPPORT/239 --proxy http://%HOSTIP:%HTTPPORT --proxy-user silly:person --proxy-ntlm -d "postit"
+</command>
+<precheck>
+chkhostname curlhost
+</precheck>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent: curl/.*
+</strip>
+<protocol nonewline="yes">
+POST http://%HOSTIP:%HTTPPORT/239 HTTP/1.1
+Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
+User-Agent: curl/7.13.2-CVS (i686-pc-linux-gnu) libcurl/7.13.2-CVS OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Proxy-Connection: Keep-Alive
+Content-Length: 0
+Content-Type: application/x-www-form-urlencoded
+
+POST http://%HOSTIP:%HTTPPORT/239 HTTP/1.1
+Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAABQAFAHAAAAAIAAgAdQAAAAAAAAAAAAAABoKBAKAeQjzKtCQ7ubW8S6MN7B59436GAxPu0CVROwwNBsgxML49gcbAXLT/bU+H5wrS9XNpbGx5Y3VybGhvc3Q=
+User-Agent: curl/7.13.2-CVS (i686-pc-linux-gnu) libcurl/7.13.2-CVS OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Proxy-Connection: Keep-Alive
+Content-Length: 6
+Content-Type: application/x-www-form-urlencoded
+
+postit
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test24 b/tests/data/test24
new file mode 100644
index 000000000..7985f43b7
--- /dev/null
+++ b/tests/data/test24
@@ -0,0 +1,47 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.0 404 BAD BOY
+Content-Type: text/html
+
+This silly page doesn't reaaaaaly exist so you should not get it.
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET fail silently on HTTP error return
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/24 --fail
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent: curl/.*
+</strip>
+<protocol>
+GET /24 HTTP/1.1
+User-Agent: curl/7.8.1-pre3 (sparc-sun-solaris2.7) libcurl 7.8.1-pre3 (OpenSSL 0.9.6a) (krb4 enabled)
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+<errorcode>
+22
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test240 b/tests/data/test240
new file mode 100644
index 000000000..cd8594d63
--- /dev/null
+++ b/tests/data/test240
@@ -0,0 +1,58 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+IPv6
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+-foo-
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+ipv6
+</features>
+<server>
+http-ipv6
+</server>
+ <name>
+HTTP-IPv6 GET
+ </name>
+ <command>
+-g "http://%HOST6IP:%HTTP6PORT/240"
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:
+</strip>
+<protocol>
+GET /240 HTTP/1.1
+Host: %HOST6IP:%HTTP6PORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test241 b/tests/data/test241
new file mode 100644
index 000000000..46eae1f72
--- /dev/null
+++ b/tests/data/test241
@@ -0,0 +1,56 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+IPv6
+IPv6-hostname
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 6
+
+hello
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+ipv6
+</features>
+<server>
+http-ipv6
+</server>
+ <name>
+HTTP-IPv6 GET (using ip6-localhost)
+ </name>
+ <command>
+-g "http://ip6-localhost:%HTTP6PORT/241"
+</command>
+<precheck>
+./server/resolve --ipv6 ip6-localhost
+</precheck>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:
+</strip>
+<protocol>
+GET /241 HTTP/1.1
+Host: ip6-localhost:%HTTP6PORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test242 b/tests/data/test242
new file mode 100644
index 000000000..01d40bdd7
--- /dev/null
+++ b/tests/data/test242
@@ -0,0 +1,54 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+IPv6
+HTTP Basic auth
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 6
+Connection: close
+
+hello
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+ipv6
+</features>
+<server>
+http-ipv6
+</server>
+ <name>
+HTTP-IPv6 GET with username+password in URL
+ </name>
+ <command>
+-g "http://foobar:barfoo@%HOST6IP:%HTTP6PORT/242"
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:
+</strip>
+<protocol>
+GET /242 HTTP/1.1
+Authorization: Basic Zm9vYmFyOmJhcmZvbw==
+Host: %HOST6IP:%HTTP6PORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test243 b/tests/data/test243
new file mode 100644
index 000000000..d53a43798
--- /dev/null
+++ b/tests/data/test243
@@ -0,0 +1,129 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP proxy
+HTTP proxy NTLM auth
+--proxy-anyauth
+</keywords>
+</info>
+
+# Server-side
+<reply>
+
+<data>
+HTTP/1.1 407 Authorization Required swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+Proxy-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
+Proxy-Authenticate: Basic realm="gimme all yer s3cr3ts"
+Proxy-Authenticate: NTLM
+Content-Type: text/html; charset=iso-8859-1
+Connection: close
+
+This is not the real page
+</data>
+
+# this is returned first since we get no proxy-auth
+<data1001>
+HTTP/1.1 407 Authorization Required to proxy me my dear
+Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+Content-Length: 34
+
+Hey you, authenticate or go away!
+</data1001>
+
+# This is supposed to be returned when the server gets the second
+# Authorization: NTLM line passed-in from the client
+<data1002>
+HTTP/1.1 200 Things are fine in proxy land swsclose
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 42
+
+Contents of that page you requested, sir.
+</data1002>
+
+<datacheck>
+HTTP/1.1 407 Authorization Required swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+Proxy-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
+Proxy-Authenticate: Basic realm="gimme all yer s3cr3ts"
+Proxy-Authenticate: NTLM
+Content-Type: text/html; charset=iso-8859-1
+Connection: close
+
+HTTP/1.1 407 Authorization Required to proxy me my dear
+Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+Content-Length: 34
+
+HTTP/1.1 200 Things are fine in proxy land swsclose
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 42
+
+Contents of that page you requested, sir.
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+NTLM
+</features>
+ <name>
+HTTP POST with --proxy-anyauth, picking NTLM
+ </name>
+ <setenv>
+# we force our own host name, in order to make the test machine independent
+CURL_GETHOSTNAME=curlhost
+# we try to use the LD_PRELOAD hack, if not a debug build
+LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
+ </setenv>
+ <command>
+http://%HOSTIP:%HTTPPORT/243 --proxy http://%HOSTIP:%HTTPPORT --proxy-user silly:person --proxy-anyauth -d "postit"
+</command>
+<precheck>
+chkhostname curlhost
+</precheck>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent: curl/.*
+</strip>
+<protocol nonewline="yes">
+POST http://%HOSTIP:%HTTPPORT/243 HTTP/1.1
+User-Agent: curl/7.13.2-CVS (i686-pc-linux-gnu) libcurl/7.13.2-CVS OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Proxy-Connection: Keep-Alive
+Content-Length: 6
+Content-Type: application/x-www-form-urlencoded
+
+postitPOST http://%HOSTIP:%HTTPPORT/243 HTTP/1.1
+Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
+User-Agent: curl/7.13.2-CVS (i686-pc-linux-gnu) libcurl/7.13.2-CVS OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Proxy-Connection: Keep-Alive
+Content-Length: 0
+Content-Type: application/x-www-form-urlencoded
+
+POST http://%HOSTIP:%HTTPPORT/243 HTTP/1.1
+Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAABQAFAHAAAAAIAAgAdQAAAAAAAAAAAAAABoKBAKAeQjzKtCQ7ubW8S6MN7B59436GAxPu0CVROwwNBsgxML49gcbAXLT/bU+H5wrS9XNpbGx5Y3VybGhvc3Q=
+User-Agent: curl/7.13.2-CVS (i686-pc-linux-gnu) libcurl/7.13.2-CVS OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Proxy-Connection: Keep-Alive
+Content-Length: 6
+Content-Type: application/x-www-form-urlencoded
+
+postit
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test245 b/tests/data/test245
new file mode 100644
index 000000000..8ad45d3a1
--- /dev/null
+++ b/tests/data/test245
@@ -0,0 +1,87 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP POST
+HTTP Digest auth
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 401 authentication please swsbounce
+Server: Microsoft-IIS/6.0
+WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 0
+
+</data>
+<data1000>
+HTTP/1.1 200 A OK
+Server: Microsoft-IIS/6.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 3
+
+ok
+</data1000>
+
+<datacheck>
+HTTP/1.1 401 authentication please swsbounce
+Server: Microsoft-IIS/6.0
+WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 0
+
+HTTP/1.1 200 A OK
+Server: Microsoft-IIS/6.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 3
+
+ok
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+#
+<server>
+http
+</server>
+<features>
+crypto
+</features>
+ <name>
+HTTP POST --digest
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/245 -u auser:apasswd --digest -d "junkelijunk"
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol nonewline="yes">
+POST /245 HTTP/1.1
+User-Agent: curl/7.12.1-CVS (i686-pc-linux-gnu) libcurl/7.12.1-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 GSS libidn/0.4.6
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 0
+Content-Type: application/x-www-form-urlencoded
+
+POST /245 HTTP/1.1
+Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/245", response="379a439b1737ba257c1d2f103914b18b"
+User-Agent: curl/7.13.2-CVS (i686-pc-linux-gnu) libcurl/7.13.2-CVS OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 11
+Content-Type: application/x-www-form-urlencoded
+
+junkelijunk
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test246 b/tests/data/test246
new file mode 100644
index 000000000..b92c17a8b
--- /dev/null
+++ b/tests/data/test246
@@ -0,0 +1,97 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP POST
+HTTP Digest auth
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 100 Continue
+Server: Microsoft-IIS/5.0
+Date: Sun, 03 Apr 2005 14:57:45 GMT
+X-Powered-By: ASP.NET
+
+HTTP/1.1 401 authentication please swsbounce
+Server: Microsoft-IIS/6.0
+WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 0
+
+</data>
+<data1000>
+HTTP/1.1 200 A OK
+Server: Microsoft-IIS/6.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 3
+
+ok
+</data1000>
+
+<datacheck>
+HTTP/1.1 100 Continue
+Server: Microsoft-IIS/5.0
+Date: Sun, 03 Apr 2005 14:57:45 GMT
+X-Powered-By: ASP.NET
+
+HTTP/1.1 401 authentication please swsbounce
+Server: Microsoft-IIS/6.0
+WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 0
+
+HTTP/1.1 200 A OK
+Server: Microsoft-IIS/6.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 3
+
+ok
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+#
+<server>
+http
+</server>
+<features>
+crypto
+</features>
+ <name>
+HTTP POST --digest with server doing a 100 before 401 response
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/246 -u auser:apasswd --digest -d "junkelijunk"
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol nonewline="yes">
+POST /246 HTTP/1.1
+User-Agent: curl/7.12.1-CVS (i686-pc-linux-gnu) libcurl/7.12.1-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 GSS libidn/0.4.6
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 0
+Content-Type: application/x-www-form-urlencoded
+
+POST /246 HTTP/1.1
+Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/246", response="761e6fc9a760c39d587092e8d840e740"
+User-Agent: curl/7.13.2-CVS (i686-pc-linux-gnu) libcurl/7.13.2-CVS OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 11
+Content-Type: application/x-www-form-urlencoded
+
+junkelijunk
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test247 b/tests/data/test247
new file mode 100644
index 000000000..66c674e98
--- /dev/null
+++ b/tests/data/test247
@@ -0,0 +1,41 @@
+<testcase>
+<reply>
+<mdtm>
+213 20030409102659
+</mdtm>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP upload time condition evaluates TRUE => skip upload
+ </name>
+<file name="log/test247.txt">
+data
+ to
+ see
+that FTP
+works
+ so does it?
+</file>
+ <command>
+ftp://%HOSTIP:%FTPPORT/247 -T log/test247.txt -z "apr 1 2005 08:00:00"
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<upload>
+</upload>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+MDTM 247
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test248 b/tests/data/test248
new file mode 100644
index 000000000..814b1d714
--- /dev/null
+++ b/tests/data/test248
@@ -0,0 +1,50 @@
+<testcase>
+<reply>
+<mdtm>
+213 20050409102659
+</mdtm>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP upload time condition evaluates FALSE => upload anyway
+ </name>
+<file name="log/test248.txt">
+data
+ to
+ see
+that FTP
+works
+ so does it?
+</file>
+ <command>
+ftp://%HOSTIP:%FTPPORT/248 -T log/test248.txt -z "apr 1 2005 08:00:00"
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<upload>
+data
+ to
+ see
+that FTP
+works
+ so does it?
+</upload>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+MDTM 248
+EPSV
+TYPE I
+STOR 248
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test249 b/tests/data/test249
new file mode 100644
index 000000000..69df5becd
--- /dev/null
+++ b/tests/data/test249
@@ -0,0 +1,47 @@
+<testcase>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 304 Not Modified swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 1910 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 677777
+Connection: close
+Content-Type: text/html
+
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP 304 response with "illegal" Content-Length: header
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/249 -z "dec 12 12:00:00 1999 GMT"
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /249 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+If-Modified-Since: Sun, 12 Dec 1999 12:00:00 GMT
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test25 b/tests/data/test25
new file mode 100644
index 000000000..15030ae92
--- /dev/null
+++ b/tests/data/test25
@@ -0,0 +1,116 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+followlocation
+--max-redirs
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 301 This is a weirdo text message
+Server: test-server/fake
+Location: data/reply/25
+Content-Length: 32
+Connection: close
+
+Redirect to the same URL again!
+</data>
+<datacheck>
+HTTP/1.1 301 This is a weirdo text message
+Server: test-server/fake
+Location: data/reply/25
+Content-Length: 32
+Connection: close
+
+HTTP/1.1 301 This is a weirdo text message
+Server: test-server/fake
+Location: data/reply/25
+Content-Length: 32
+Connection: close
+
+HTTP/1.1 301 This is a weirdo text message
+Server: test-server/fake
+Location: data/reply/25
+Content-Length: 32
+Connection: close
+
+HTTP/1.1 301 This is a weirdo text message
+Server: test-server/fake
+Location: data/reply/25
+Content-Length: 32
+Connection: close
+
+HTTP/1.1 301 This is a weirdo text message
+Server: test-server/fake
+Location: data/reply/25
+Content-Length: 32
+Connection: close
+
+HTTP/1.1 301 This is a weirdo text message
+Server: test-server/fake
+Location: data/reply/25
+Content-Length: 32
+Connection: close
+
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+looping HTTP Location: following with --max-redirs
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/want/25 -L --max-redirs 5
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent: curl/.*
+</strip>
+<protocol>
+GET /want/25 HTTP/1.1
+User-Agent: curl/7.8.1-pre3 (sparc-sun-solaris2.7) libcurl 7.8.1-pre3 (OpenSSL 0.9.6a) (krb4 enabled)
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /want/data/reply/25 HTTP/1.1
+User-Agent: curl/7.8.1-pre3 (sparc-sun-solaris2.7) libcurl 7.8.1-pre3 (OpenSSL 0.9.6a) (krb4 enabled)
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /want/data/reply/data/reply/25 HTTP/1.1
+User-Agent: curl/7.8.1-pre3 (sparc-sun-solaris2.7) libcurl 7.8.1-pre3 (OpenSSL 0.9.6a) (krb4 enabled)
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /want/data/reply/data/reply/data/reply/25 HTTP/1.1
+User-Agent: curl/7.8.1-pre3 (sparc-sun-solaris2.7) libcurl 7.8.1-pre3 (OpenSSL 0.9.6a) (krb4 enabled)
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /want/data/reply/data/reply/data/reply/data/reply/25 HTTP/1.1
+User-Agent: curl/7.8.1-pre3 (sparc-sun-solaris2.7) libcurl 7.8.1-pre3 (OpenSSL 0.9.6a) (krb4 enabled)
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /want/data/reply/data/reply/data/reply/data/reply/data/reply/25 HTTP/1.1
+User-Agent: curl/7.8.1-pre3 (sparc-sun-solaris2.7) libcurl 7.8.1-pre3 (OpenSSL 0.9.6a) (krb4 enabled)
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+
+<errorcode>
+47
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test250 b/tests/data/test250
new file mode 100644
index 000000000..2c99c46ee
--- /dev/null
+++ b/tests/data/test250
@@ -0,0 +1,52 @@
+<testcase>
+#
+# Server-side
+<reply>
+# When doing LIST, we get the default list output hard-coded in the test
+# FTP server
+<datacheck>
+total 20
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
+drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
+-r--r--r-- 1 0 1 35 Jul 16 1996 README
+lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
+dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
+drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
+dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
+drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
+dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
+</datacheck>
+<servercmd>
+SLOWDOWN
+</servercmd>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP dir list PASV with slow response
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE A
+LIST
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test251 b/tests/data/test251
new file mode 100644
index 000000000..73ee09ee0
--- /dev/null
+++ b/tests/data/test251
@@ -0,0 +1,54 @@
+<testcase>
+# Server-side
+<reply>
+# When doing LIST, we get the default list output hard-coded in the test
+# FTP server
+<datacheck>
+total 20
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
+drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
+-r--r--r-- 1 0 1 35 Jul 16 1996 README
+lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
+dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
+drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
+dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
+drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
+dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
+</datacheck>
+<servercmd>
+SLOWDOWN
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP dir list, PORT with specified IP and slow response
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/ -P %CLIENTIP
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+# Strip all valid kinds of PORT and EPRT that curl can send
+<strip>
+^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
+^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
+</strip>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+PORT 127,0,0,1,243,212
+TYPE A
+LIST
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test252 b/tests/data/test252
new file mode 100644
index 000000000..b3f4966a1
--- /dev/null
+++ b/tests/data/test252
@@ -0,0 +1,59 @@
+<testcase>
+<info>
+<keywords>
+FTP-ipv6
+IPv6
+EPSV
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+# When doing LIST, we get the default list output hard-coded in the test
+# FTP server
+<datacheck>
+total 20
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
+drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
+-r--r--r-- 1 0 1 35 Jul 16 1996 README
+lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
+dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
+drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
+dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
+drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
+dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+ipv6
+</features>
+<server>
+ftp-ipv6
+</server>
+ <name>
+FTP IPv6 dir list PASV
+ </name>
+ <command>
+-g "ftp://%HOST6IP:%FTP6PORT/"
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE A
+LIST
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test253 b/tests/data/test253
new file mode 100644
index 000000000..9be5f3d60
--- /dev/null
+++ b/tests/data/test253
@@ -0,0 +1,62 @@
+<testcase>
+<info>
+<keywords>
+FTP-ipv6
+IPv6
+EPRT
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+# When doing LIST, we get the default list output hard-coded in the test
+# FTP server
+<datacheck>
+total 20
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
+drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
+-r--r--r-- 1 0 1 35 Jul 16 1996 README
+lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
+dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
+drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
+dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
+drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
+dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+ipv6
+</features>
+<server>
+ftp-ipv6
+</server>
+ <name>
+FTP IPv6 dir list with EPRT
+ </name>
+ <command>
+-g "ftp://%HOST6IP:%FTP6PORT/" -P -
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strippart>
+s/^(EPRT \|2\|::1\|)(.*)/$1/
+</strippart>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPRT |2|::1|
+TYPE A
+LIST
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test254 b/tests/data/test254
new file mode 100644
index 000000000..571b033f7
--- /dev/null
+++ b/tests/data/test254
@@ -0,0 +1,60 @@
+<testcase>
+<info>
+<keywords>
+FTP-ipv6
+IPv6
+EPSV
+--disable-epsv
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+# When doing LIST, we get the default list output hard-coded in the test
+# FTP server
+<datacheck>
+total 20
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
+drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
+-r--r--r-- 1 0 1 35 Jul 16 1996 README
+lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
+dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
+drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
+dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
+drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
+dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+ipv6
+</features>
+<server>
+ftp-ipv6
+</server>
+ <name>
+FTP IPv6 dir list PASV and --disable-epsv
+ </name>
+ <command>
+-g "ftp://%HOST6IP:%FTP6PORT/" --disable-epsv
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE A
+LIST
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test255 b/tests/data/test255
new file mode 100644
index 000000000..cc50c95e4
--- /dev/null
+++ b/tests/data/test255
@@ -0,0 +1,63 @@
+<testcase>
+<info>
+<keywords>
+FTP-ipv6
+IPv6
+EPRT
+--disable-eprt
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+# When doing LIST, we get the default list output hard-coded in the test
+# FTP server
+<datacheck>
+total 20
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
+drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
+-r--r--r-- 1 0 1 35 Jul 16 1996 README
+lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
+dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
+drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
+dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
+drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
+dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+ipv6
+</features>
+<server>
+ftp-ipv6
+</server>
+ <name>
+FTP IPv6 dir list with EPRT and --disable-eprt
+ </name>
+ <command>
+-g "ftp://%HOST6IP:%FTP6PORT/" -P - --disable-eprt
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strippart>
+s/^(EPRT \|2\|::1\|)(.*)/$1/
+</strippart>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPRT |2|::1|
+TYPE A
+LIST
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test256 b/tests/data/test256
new file mode 100644
index 000000000..5f8323b67
--- /dev/null
+++ b/tests/data/test256
@@ -0,0 +1,64 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP proxy
+Resume
+FAILURE
+</keywords>
+</info>
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.0 200 Mooo
+Date: Mon, 13 Nov 2000 13:41:09 GMT
+Server: myown/1.0
+Connection: close
+
+todelooooo lalalala yada yada, we know nothing about ranges ;-)
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP resume request over proxy with auth without server supporting it
+ </name>
+ <command option="no-output">
+-x http://%HOSTIP:%HTTPPORT http://%HOSTIP:%HTTPPORT/want/256 -C - --no-include -o log/fewl.txt -U daniel:stenberg
+</command>
+<file name="log/fewl.txt">
+This text is here to simulate a partly downloaded file to resume
+download on.
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+33
+</errorcode>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET http://%HOSTIP:%HTTPPORT/want/256 HTTP/1.1
+Proxy-Authorization: Basic ZGFuaWVsOnN0ZW5iZXJn
+Range: bytes=78-
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+
+# the download target file must remain untouched
+<file name="log/fewl.txt">
+This text is here to simulate a partly downloaded file to resume
+download on.
+</file>
+</verify>
+</testcase>
diff --git a/tests/data/test257 b/tests/data/test257
new file mode 100644
index 000000000..c211c2f47
--- /dev/null
+++ b/tests/data/test257
@@ -0,0 +1,115 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP proxy
+HTTP Basic auth
+followlocation
+netrc
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 301 This is a weirdo text message swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Location: http://anotherone.com/2570002
+Connection: close
+
+This server reply is for testing a simple Location: following
+
+</data>
+<data2>
+HTTP/1.1 302 Followed here fine swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Location: http://athird.com/2570003
+
+If this is received, the location following worked
+
+</data2>
+<data3>
+HTTP/1.1 200 Followed here fine swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 52
+
+If this is received, the location following worked
+
+</data3>
+<datacheck>
+HTTP/1.1 301 This is a weirdo text message swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Location: http://anotherone.com/2570002
+Connection: close
+
+HTTP/1.1 302 Followed here fine swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Location: http://athird.com/2570003
+
+HTTP/1.1 200 Followed here fine swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 52
+
+If this is received, the location following worked
+
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<features>
+netrc_debug
+</features>
+<server>
+http
+</server>
+ <name>
+HTTP Location: following with --netrc-optional
+ </name>
+ <command>
+http://supersite.com/want/257 -L -x http://%HOSTIP:%HTTPPORT --netrc-optional
+</command>
+
+# netrc auth for two out of three sites:
+<file name="log/netrc">
+machine supersite.com login user1 password passwd1
+machine anotherone.com login user2 password passwd2
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET http://supersite.com/want/257 HTTP/1.1
+Authorization: Basic dXNlcjE6cGFzc3dkMQ==
+User-Agent: curl/7.14.0-CVS (i686-pc-linux-gnu) libcurl/7.14.0-CVS OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13
+Host: supersite.com
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+GET http://anotherone.com/2570002 HTTP/1.1
+Authorization: Basic dXNlcjI6cGFzc3dkMg==
+User-Agent: curl/7.14.0-CVS (i686-pc-linux-gnu) libcurl/7.14.0-CVS OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13
+Host: anotherone.com
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+GET http://athird.com/2570003 HTTP/1.1
+User-Agent: curl/7.14.0-CVS (i686-pc-linux-gnu) libcurl/7.14.0-CVS OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13
+Host: athird.com
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test258 b/tests/data/test258
new file mode 100644
index 000000000..0d95dec0a
--- /dev/null
+++ b/tests/data/test258
@@ -0,0 +1,134 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP FORMPOST
+HTTP replaced headers
+HTTP proxy
+HTTP proxy Digest auth
+--proxy-anyauth
+</keywords>
+
+</info>
+# Server-side
+<reply>
+# The stupid test server doesn't response anything at all until the full
+# request has been sent, and then of course the full POST has already been
+# sent!
+<data>
+HTTP/1.1 407 no, tell me who you are first swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Proxy-Authenticate: Digest realm="many secrets", nonce="911"
+Proxy-Connection: close
+Content-Length: 0
+
+</data>
+<data1000>
+HTTP/1.1 200 A OK
+Server: Microsoft-IIS/6.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 3
+
+ok
+</data1000>
+<datacheck>
+HTTP/1.1 407 no, tell me who you are first swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Proxy-Authenticate: Digest realm="many secrets", nonce="911"
+Proxy-Connection: close
+Content-Length: 0
+
+HTTP/1.1 200 A OK
+Server: Microsoft-IIS/6.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 3
+
+ok
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+crypto
+</features>
+ <name>
+HTTP POST multipart without Expect: header using proxy anyauth (Digest)
+ </name>
+ <command>
+-x http://%HOSTIP:%HTTPPORT http://remotehost:54321/we/want/258 -F name=daniel -F tool=curl -F file=@log/test258.txt -H "Expect:" -U uuuser:pppassword --proxy-anyauth
+</command>
+# We create this file before the command is invoked!
+<file name="log/test258.txt">
+foo-
+This is a moo-
+bar
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^(User-Agent:|Content-Type: multipart/form-data;|------).*
+</strip>
+<protocol>
+POST http://remotehost:54321/we/want/258 HTTP/1.1
+User-Agent: curl/7.10.4 (i686-pc-linux-gnu) libcurl/7.10.4 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: remotehost:54321
+Accept: */*
+Proxy-Connection: Keep-Alive
+Content-Length: 409
+Content-Type: multipart/form-data; boundary=----------------------------7c633d5c27ce
+
+------------------------------7c633d5c27ce
+Content-Disposition: form-data; name="name"
+
+daniel
+------------------------------7c633d5c27ce
+Content-Disposition: form-data; name="tool"
+
+curl
+------------------------------7c633d5c27ce
+Content-Disposition: form-data; name="file"; filename="test258.txt"
+Content-Type: text/plain
+
+foo-
+This is a moo-
+bar
+
+------------------------------7c633d5c27ce--
+POST http://remotehost:54321/we/want/258 HTTP/1.1
+User-Agent: curl/7.10.4 (i686-pc-linux-gnu) libcurl/7.10.4 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Proxy-Authorization: Digest username="uuuser", realm="many secrets", nonce="911", uri="/we/want/258", response="2501654ca391f0b5c8c12a1da77e34cd"
+Host: remotehost:54321
+Accept: */*
+Proxy-Connection: Keep-Alive
+Content-Length: 409
+Content-Type: multipart/form-data; boundary=----------------------------7c633d5c27ce
+
+------------------------------7c633d5c27ce
+Content-Disposition: form-data; name="name"
+
+daniel
+------------------------------7c633d5c27ce
+Content-Disposition: form-data; name="tool"
+
+curl
+------------------------------7c633d5c27ce
+Content-Disposition: form-data; name="file"; filename="test258.txt"
+Content-Type: text/plain
+
+foo-
+This is a moo-
+bar
+
+------------------------------7c633d5c27ce--
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test259 b/tests/data/test259
new file mode 100644
index 000000000..b9d8ef12b
--- /dev/null
+++ b/tests/data/test259
@@ -0,0 +1,132 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP FORMPOST
+HTTP proxy
+HTTP proxy Digest auth
+--proxy-anyauth
+</keywords>
+</info>
+# Server-side
+<reply>
+# The stupid test server doesn't response anything at all until the full
+# request has been sent, and then of course the full POST has already been
+# sent!
+<data>
+HTTP/1.1 407 no, tell me who you are first
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Proxy-Authenticate: Digest realm="many secrets", nonce="911"
+Content-Length: 0
+
+</data>
+<data1000>
+HTTP/1.1 200 A OK
+Server: Microsoft-IIS/6.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 3
+
+ok
+</data1000>
+<datacheck>
+HTTP/1.1 407 no, tell me who you are first
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Proxy-Authenticate: Digest realm="many secrets", nonce="911"
+Content-Length: 0
+
+HTTP/1.1 200 A OK
+Server: Microsoft-IIS/6.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 3
+
+ok
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+crypto
+</features>
+ <name>
+HTTP POST multipart with Expect: header using proxy anyauth (Digest)
+ </name>
+ <command>
+-x http://%HOSTIP:%HTTPPORT http://remotehost:54321/we/want/259 -F name=daniel -F tool=curl -F file=@log/test259.txt -U uuuser:pppassword --proxy-anyauth
+</command>
+# We create this file before the command is invoked!
+<file name="log/test259.txt">
+foo-
+This is a moo-
+bar
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^(User-Agent:|Content-Type: multipart/form-data;|------).*
+</strip>
+<protocol>
+POST http://remotehost:54321/we/want/259 HTTP/1.1
+User-Agent: curl/7.10.4 (i686-pc-linux-gnu) libcurl/7.10.4 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: remotehost:54321
+Accept: */*
+Proxy-Connection: Keep-Alive
+Content-Length: 409
+Expect: 100-continue
+Content-Type: multipart/form-data; boundary=----------------------------7c633d5c27ce
+
+------------------------------7c633d5c27ce
+Content-Disposition: form-data; name="name"
+
+daniel
+------------------------------7c633d5c27ce
+Content-Disposition: form-data; name="tool"
+
+curl
+------------------------------7c633d5c27ce
+Content-Disposition: form-data; name="file"; filename="test259.txt"
+Content-Type: text/plain
+
+foo-
+This is a moo-
+bar
+
+------------------------------7c633d5c27ce--
+POST http://remotehost:54321/we/want/259 HTTP/1.1
+User-Agent: curl/7.10.4 (i686-pc-linux-gnu) libcurl/7.10.4 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Proxy-Authorization: Digest username="uuuser", realm="many secrets", nonce="911", uri="/we/want/259", response="b479994d13e60f3aa192a67c5892ddc5"
+Host: remotehost:54321
+Accept: */*
+Proxy-Connection: Keep-Alive
+Content-Length: 409
+Expect: 100-continue
+Content-Type: multipart/form-data; boundary=----------------------------7c633d5c27ce
+
+------------------------------7c633d5c27ce
+Content-Disposition: form-data; name="name"
+
+daniel
+------------------------------7c633d5c27ce
+Content-Disposition: form-data; name="tool"
+
+curl
+------------------------------7c633d5c27ce
+Content-Disposition: form-data; name="file"; filename="test259.txt"
+Content-Type: text/plain
+
+foo-
+This is a moo-
+bar
+
+------------------------------7c633d5c27ce--
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test26 b/tests/data/test26
new file mode 100644
index 000000000..072dbf7d3
--- /dev/null
+++ b/tests/data/test26
@@ -0,0 +1,45 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.0 200 Mooo swsclose
+Server: test-server/fake
+Connection: close
+
+*flopp*
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+specify more -o than URLs
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/want/26 -o - -o -
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent: curl.*
+</strip>
+<protocol>
+GET /want/26 HTTP/1.1
+User-Agent: curl/7.8.1-pre3 (sparc-sun-solaris2.7) libcurl 7.8.1-pre3 (OpenSSL 0.9.6a) (krb4 enabled)
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test260 b/tests/data/test260
new file mode 100644
index 000000000..589e86e8a
--- /dev/null
+++ b/tests/data/test260
@@ -0,0 +1,55 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+-foo-
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET URL without slash but with questionmark
+ </name>
+ <command>
+"http://%HOSTIP:%HTTPPORT?260"
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /?260 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test261 b/tests/data/test261
new file mode 100644
index 000000000..e3639bfe9
--- /dev/null
+++ b/tests/data/test261
@@ -0,0 +1,48 @@
+<testcase>
+<info>
+<keywords>
+FTP
+EPSV
+RETR
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+hepp
+</data>
+<servercmd>
+REPLY TYPE 226 Kind of on the positive side!
+</servercmd>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP RETR with 226 response code to TYPE
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/261
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE I
+SIZE 261
+RETR 261
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test262 b/tests/data/test262
new file mode 100644
index 000000000..4c28f22d7
--- /dev/null
+++ b/tests/data/test262
Binary files differ
diff --git a/tests/data/test263 b/tests/data/test263
new file mode 100644
index 000000000..5088141f5
--- /dev/null
+++ b/tests/data/test263
@@ -0,0 +1,54 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+IPv6
+HTTP proxy
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 6
+Content-Type: text/html
+
+hello
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+ipv6
+</features>
+<server>
+http-ipv6
+</server>
+ <name>
+HTTP-IPv6 GET with proxy specified using IPv6-numerical address
+ </name>
+ <command>
+-g -x "http://%HOST6IP:%HTTP6PORT" http://veryveryremotesite.com/263
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:
+</strip>
+<protocol>
+GET http://veryveryremotesite.com/263 HTTP/1.1
+Host: veryveryremotesite.com
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test264 b/tests/data/test264
new file mode 100644
index 000000000..3cfb4d88d
--- /dev/null
+++ b/tests/data/test264
@@ -0,0 +1,49 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP proxy
+HTTP proxy Basic auth
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Type: text/html
+Content-Length: 26
+
+the content would go here
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP with proxy string including http:// and user+password
+ </name>
+ <command>
+http://we.want.that.site.com/264 -x http://f%61ke:user@%HOSTIP:%HTTPPORT
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET http://we.want.that.site.com/264 HTTP/1.1
+Proxy-Authorization: Basic ZmFrZTp1c2Vy
+Host: we.want.that.site.com
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test265 b/tests/data/test265
new file mode 100644
index 000000000..18d20a60a
--- /dev/null
+++ b/tests/data/test265
@@ -0,0 +1,125 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP POST
+HTTP CONNECT
+HTTP proxy
+HTTP proxy NTLM auth
+</keywords>
+</info>
+
+# Server-side
+<reply>
+
+# this is returned first since we get no proxy-auth
+<data1001>
+HTTP/1.0 407 Authorization Required to proxy me my dear
+Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+Content-Length: 1033
+
+And you should ignore this data.
+QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQz
+</data1001>
+
+# This is supposed to be returned when the server gets the second
+# Authorization: NTLM line passed-in from the client
+<data1002>
+HTTP/1.1 200 Things are fine in proxy land
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+
+</data1002>
+
+# this is returned when we get a GET!
+<data2>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 7
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+daniel
+</data2>
+
+# then this is returned when we get proxy-auth
+<data1000>
+HTTP/1.1 200 OK swsbounce
+Server: no
+
+Nice proxy auth sir!
+</data1000>
+
+<datacheck>
+HTTP/1.0 407 Authorization Required to proxy me my dear
+Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+Content-Length: 1033
+
+HTTP/1.1 200 Things are fine in proxy land
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 7
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+daniel
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+NTLM
+</features>
+ <name>
+HTTP proxy CONNECT auth NTLM and then POST, response-body in the 407
+ </name>
+ <setenv>
+# we force our own host name, in order to make the test machine independent
+CURL_GETHOSTNAME=curlhost
+# we try to use the LD_PRELOAD hack, if not a debug build
+LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
+ </setenv>
+ <command>
+http://test.remote.haxx.se:265/path/2650002 --proxy http://%HOSTIP:%HTTPPORT --proxy-user silly:person --proxy-ntlm --proxytunnel -d "postit"
+</command>
+<precheck>
+chkhostname curlhost
+</precheck>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent: curl/.*
+</strip>
+<protocol nonewline="yes">
+CONNECT test.remote.haxx.se:265 HTTP/1.1
+Host: test.remote.haxx.se:265
+Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
+Proxy-Connection: Keep-Alive
+
+CONNECT test.remote.haxx.se:265 HTTP/1.1
+Host: test.remote.haxx.se:265
+Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAABQAFAHAAAAAIAAgAdQAAAAAAAAAAAAAABoKBAKAeQjzKtCQ7ubW8S6MN7B59436GAxPu0CVROwwNBsgxML49gcbAXLT/bU+H5wrS9XNpbGx5Y3VybGhvc3Q=
+Proxy-Connection: Keep-Alive
+
+POST /path/2650002 HTTP/1.1
+User-Agent: curl/7.12.3-CVS (i686-pc-linux-gnu) libcurl/7.12.3-CVS OpenSSL/0.9.6b zlib/1.1.4
+Host: test.remote.haxx.se:265
+Accept: */*
+Content-Length: 6
+Content-Type: application/x-www-form-urlencoded
+
+postit
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test266 b/tests/data/test266
new file mode 100644
index 000000000..d520be0f4
--- /dev/null
+++ b/tests/data/test266
@@ -0,0 +1,78 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+chunked Transfer-Encoding
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 funky chunky!
+Server: fakeit/0.9 fakeitbad/1.0
+Transfer-Encoding: chunked
+Trailer: chunky-trailer
+Connection: mooo
+
+40
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+30
+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+21;heresatest=moooo
+cccccccccccccccccccccccccccccccc
+
+0
+chunky-trailer: header data
+
+</data>
+<datacheck>
+HTTP/1.1 200 funky chunky!
+Server: fakeit/0.9 fakeitbad/1.0
+Transfer-Encoding: chunked
+Trailer: chunky-trailer
+Connection: mooo
+
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccc
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET with chunked Transfer-Encoding and chunked trailer
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/266 -D log/heads266
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /266 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+<file name="log/heads266">
+HTTP/1.1 200 funky chunky!
+Server: fakeit/0.9 fakeitbad/1.0
+Transfer-Encoding: chunked
+Trailer: chunky-trailer
+Connection: mooo
+
+chunky-trailer: header data
+</file>
+</verify>
+
+</testcase>
diff --git a/tests/data/test267 b/tests/data/test267
new file mode 100644
index 000000000..479031c46
--- /dev/null
+++ b/tests/data/test267
@@ -0,0 +1,109 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP POST
+HTTP NTLM auth
+</keywords>
+</info>
+# Server-side
+<reply>
+
+<!-- no <data> in this test since we have NTLM from the start
+
+This is supposed to be returned when the server gets a first
+Authorization: NTLM line passed-in from the client -->
+
+<data1001>
+HTTP/1.1 401 Now gimme that second request of crap
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 34
+WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+
+This is not the real page either!
+</data1001>
+
+# This is supposed to be returned when the server gets the second
+# Authorization: NTLM line passed-in from the client
+<data1002>
+HTTP/1.1 200 Things are fine in server land swsclose
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 32
+
+Finally, this is the real page!
+</data1002>
+
+<datacheck>
+HTTP/1.1 401 Now gimme that second request of crap
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 34
+WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+
+HTTP/1.1 200 Things are fine in server land swsclose
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 32
+
+Finally, this is the real page!
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+<features>
+NTLM
+</features>
+<server>
+http
+</server>
+ <name>
+HTTP POST with NTLM authorization and added custom headers
+ </name>
+ <setenv>
+# we force our own host name, in order to make the test machine independent
+CURL_GETHOSTNAME=curlhost
+# we try to use the LD_PRELOAD hack, if not a debug build
+LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
+ </setenv>
+ <command>
+http://%HOSTIP:%HTTPPORT/267 -u testuser:testpass --ntlm -d "data" -H "Header1: yes" -H "Header2: no"
+</command>
+<precheck>
+chkhostname curlhost
+</precheck>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol nonewline="yes">
+POST /267 HTTP/1.1
+Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
+User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Header1: yes
+Header2: no
+Content-Length: 0
+Content-Type: application/x-www-form-urlencoded
+
+POST /267 HTTP/1.1
+Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoKBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyY3VybGhvc3Q=
+User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Header1: yes
+Header2: no
+Content-Length: 4
+Content-Type: application/x-www-form-urlencoded
+
+data
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test268 b/tests/data/test268
new file mode 100644
index 000000000..c9c7311ab
--- /dev/null
+++ b/tests/data/test268
@@ -0,0 +1,57 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP POST
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.0 200 OK
+Server: test-server/fake
+Content-Type: text/html
+Content-Length: 0
+
+this is data even though Content-Length is set to zero
+</data>
+<datacheck>
+HTTP/1.0 200 OK
+Server: test-server/fake
+Content-Type: text/html
+Content-Length: 0
+
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP POST a non-existing file
+ </name>
+ <command>
+ -d @nonesuchfile http://%HOSTIP:%HTTPPORT/268
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+POST /268 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 0
+Content-Type: application/x-www-form-urlencoded
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test269 b/tests/data/test269
new file mode 100644
index 000000000..6b7159b0b
--- /dev/null
+++ b/tests/data/test269
@@ -0,0 +1,53 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Accept-Ranges: bytes
+Content-Length: 677654
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+muahahaha
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP --ignore-content-length
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/269 --ignore-content-length
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /269 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test27 b/tests/data/test27
new file mode 100644
index 000000000..5ae2ffd4f
--- /dev/null
+++ b/tests/data/test27
@@ -0,0 +1,56 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+cookies
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 Mooo swsclose
+Connection: close
+Set-Cookie: path=/; thewinneris=nowayyouwin;
+Content-Length: 8
+
+*flopp*
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+Get same cookie page several times
+ </name>
+ <command>
+"http://%HOSTIP:%HTTPPORT/want/{27,27,27}" -b none
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent: curl.*
+</strip>
+<protocol>
+GET /want/27 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /want/27 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Cookie: thewinneris=nowayyouwin
+
+GET /want/27 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Cookie: thewinneris=nowayyouwin
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test270 b/tests/data/test270
new file mode 100644
index 000000000..f4eea970e
--- /dev/null
+++ b/tests/data/test270
@@ -0,0 +1,50 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+RETR
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+data
+ to
+ see
+that FTP
+works
+ so does it?
+</data>
+<servercmd>
+PASVBADIP
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP RETR PASV --ftp-skip-pasv-ip
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/270 --ftp-skip-pasv-ip --disable-epsv
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+PASV
+TYPE I
+SIZE 270
+RETR 270
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test271 b/tests/data/test271
new file mode 100644
index 000000000..af5a6c603
--- /dev/null
+++ b/tests/data/test271
@@ -0,0 +1,43 @@
+<testcase>
+<info>
+<keywords>
+TFTP
+TFTP RRQ
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+a chunk of
+data
+returned
+ to client
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+tftp
+</server>
+ <name>
+TFTP retrieve
+ </name>
+ <command>
+tftp://%HOSTIP:%TFTPPORT//271 --trace-ascii log/traceit
+</command>
+</client>
+
+#
+# Verify pseudo protocol after the test has been "shot"
+<verify>
+<protocol>
+opcode: 1
+filename: /271
+mode: octet
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test272 b/tests/data/test272
new file mode 100644
index 000000000..f728a2a8c
--- /dev/null
+++ b/tests/data/test272
@@ -0,0 +1,40 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+RETR
+</keywords>
+</info>
+# Server-side
+<reply>
+<mdtm>
+213 20040101121212
+</mdtm>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP timed conditioned get file with identical time stamp
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/272 -z "2004 jan 1 12:12:12 UTC"
+</command>
+
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+MDTM 272
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test273 b/tests/data/test273
new file mode 100644
index 000000000..bb2372522
--- /dev/null
+++ b/tests/data/test273
@@ -0,0 +1,83 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP Digest auth
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 401 Authorization Required swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"
+WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"
+Content-Type: text/html; charset=iso-8859-1
+
+This is not the real page
+</data>
+
+# This is supposed to be returned when the server gets a
+# Authorization: Digest line passed-in from the client
+<data1000>
+HTTP/1.1 200 OK swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 23
+
+This IS the real page!
+</data1000>
+
+<datacheck>
+HTTP/1.1 401 Authorization Required swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"
+WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"
+Content-Type: text/html; charset=iso-8859-1
+
+HTTP/1.1 200 OK swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 23
+
+This IS the real page!
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+crypto
+</features>
+ <name>
+HTTP with two Digest authorization headers
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/273 -u testuser:testpass --digest
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /273 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /273 HTTP/1.1
+Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/273", response="576ae57b1db0039f8c0de43ef58e49e3"
+User-Agent: curl/7.10.5 (i686-pc-linux-gnu) libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test274 b/tests/data/test274
new file mode 100644
index 000000000..579341c82
--- /dev/null
+++ b/tests/data/test274
@@ -0,0 +1,52 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+followlocation
+--max-redirs
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 301 This is a weirdo text message swsclose
+Server: test-server/fake
+Location: data/reply/25
+Content-Length: 0
+Connection: close
+
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP Location: following with --max-redirs 0
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/want/274 -L --max-redirs 0
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent: curl/.*
+</strip>
+<protocol>
+GET /want/274 HTTP/1.1
+User-Agent: curl/7.8.1-pre3 (sparc-sun-solaris2.7) libcurl 7.8.1-pre3 (OpenSSL 0.9.6a) (krb4 enabled)
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+
+<errorcode>
+47
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test275 b/tests/data/test275
new file mode 100644
index 000000000..145c163b3
--- /dev/null
+++ b/tests/data/test275
@@ -0,0 +1,78 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP CONNECT
+HTTP Basic auth
+HTTP proxy
+HTTP proxy Basic auth
+proxytunnel
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Type: text/html
+Content-Length: 9
+
+contents
+</data>
+<datacheck>
+HTTP/1.1 200 Mighty fine indeed
+
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Type: text/html
+Content-Length: 9
+
+contents
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP CONNECT with proxytunnel getting two URLs from the same host
+ </name>
+ <command>
+http://remotesite.com/we/want/that/page/275 -p -x %HOSTIP:%HTTPPORT --user iam:myself --proxy-user youare:yourself http://remotesite.com/we/want/that/page/275
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+CONNECT remotesite.com:80 HTTP/1.1
+Host: remotesite.com:80
+Proxy-Authorization: Basic eW91YXJlOnlvdXJzZWxm
+User-Agent: curl/7.10.7-pre2 (i686-pc-linux-gnu) libcurl/7.10.7-pre2 OpenSSL/0.9.7a zlib/1.1.3
+Proxy-Connection: Keep-Alive
+
+GET /we/want/that/page/275 HTTP/1.1
+Authorization: Basic aWFtOm15c2VsZg==
+Host: remotesite.com
+Accept: */*
+
+GET /we/want/that/page/275 HTTP/1.1
+Authorization: Basic aWFtOm15c2VsZg==
+Host: remotesite.com
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test276 b/tests/data/test276
new file mode 100644
index 000000000..34e2235e1
--- /dev/null
+++ b/tests/data/test276
@@ -0,0 +1,76 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+followlocation
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 301 This is a weirdo text message swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Location: data/2760002.txt?coolsite=http://anotherurl/?a_second/2760002
+Connection: close
+
+This server reply is for testing a simple Location: following
+
+</data>
+<data2>
+HTTP/1.1 200 Followed here fine swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 52
+
+If this is received, the location following worked
+
+</data2>
+<datacheck>
+HTTP/1.1 301 This is a weirdo text message swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Location: data/2760002.txt?coolsite=http://anotherurl/?a_second/2760002
+Connection: close
+
+HTTP/1.1 200 Followed here fine swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 52
+
+If this is received, the location following worked
+
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP Location: following with multiple question marks in URLs
+ </name>
+ <command>
+"http://%HOSTIP:%HTTPPORT/want?uri=http://anything/276?secondq/276" -L
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /want?uri=http://anything/276?secondq/276 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /data/2760002.txt?coolsite=http://anotherurl/?a_second/2760002 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test277 b/tests/data/test277
new file mode 100644
index 000000000..18e419850
--- /dev/null
+++ b/tests/data/test277
@@ -0,0 +1,59 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP FORMPOST
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 11
+
+blablabla
+
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP RFC1867-type formposting with custom Content-Type
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/want/277 -F name=daniel -H "Content-Type: text/info"
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<strippart>
+s/^------------------------------[a-z0-9]*/------------------------------/
+s/boundary=----------------------------[a-z0-9]*/boundary=----------------------------/
+</strippart>
+<protocol>
+POST /want/277 HTTP/1.1
+User-Agent: curl/7.10.4 (i686-pc-linux-gnu) libcurl/7.10.4 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 145
+Expect: 100-continue
+Content-Type: text/info; boundary=----------------------------
+
+------------------------------
+Content-Disposition: form-data; name="name"
+
+daniel
+--------------------------------
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test278 b/tests/data/test278
new file mode 100644
index 000000000..6c57822b7
--- /dev/null
+++ b/tests/data/test278
@@ -0,0 +1,49 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP proxy
+HTTP proxy Basic auth
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Type: text/html
+Content-Length: 27
+
+the content would go here
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP with proxy string including http:// and user+empty password
+ </name>
+ <command>
+http://we.want.that.site.com/278 -x http://f%61ke:@%HOSTIP:%HTTPPORT
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET http://we.want.that.site.com/278 HTTP/1.1
+Proxy-Authorization: Basic ZmFrZTo=
+Host: we.want.that.site.com
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test279 b/tests/data/test279
new file mode 100644
index 000000000..5a1938cb3
--- /dev/null
+++ b/tests/data/test279
@@ -0,0 +1,50 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP proxy
+HTTP proxy Basic auth
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Type: text/html
+Content-Length: 27
+
+the content would go here
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP with proxy string including http:// and user only
+ </name>
+ <command>
+http://we.want.that.site.com/279 -x http://f%61ke@%HOSTIP:%HTTPPORT
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET http://we.want.that.site.com/279 HTTP/1.1
+Proxy-Authorization: Basic ZmFrZTo=
+Host: we.want.that.site.com
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test28 b/tests/data/test28
new file mode 100644
index 000000000..1f80d5f48
--- /dev/null
+++ b/tests/data/test28
@@ -0,0 +1,75 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 301 This is a weirdo text message swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Location: /online/1,1795,Welcome,00.html/280002.txt?logout=TRUE
+Connection: close
+
+This server reply is for testing a simple Location: following
+
+</data>
+<data2>
+HTTP/1.1 200 Followed here fine swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 52
+
+If this is received, the location following worked
+
+</data2>
+<datacheck>
+HTTP/1.1 301 This is a weirdo text message swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Location: /online/1,1795,Welcome,00.html/280002.txt?logout=TRUE
+Connection: close
+
+HTTP/1.1 200 Followed here fine swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 52
+
+If this is received, the location following worked
+
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP Location: following with extra spaces in header
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/want/28 -L
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /want/28 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /online/1,1795,Welcome,00.html/280002.txt?logout=TRUE HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test280 b/tests/data/test280
new file mode 100644
index 000000000..c16999376
--- /dev/null
+++ b/tests/data/test280
@@ -0,0 +1,63 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+LIST
+--ftp-alternative-to-user
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+# When doing LIST, we get the default list output hard-coded in the test
+# FTP server
+<datacheck>
+total 20
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
+drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
+-r--r--r-- 1 0 1 35 Jul 16 1996 README
+lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
+dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
+drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
+dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
+drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
+dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
+</datacheck>
+<servercmd>
+REPLY USER 530 We don't like USER commands
+COUNT USER 1
+</servercmd>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP --ftp-alternative-to-user on USER failure
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/280/ --ftp-alternative-to-user "USER replacement"
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+USER replacement
+PASS ftp@example.com
+PWD
+CWD 280
+EPSV
+TYPE A
+LIST
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test281 b/tests/data/test281
new file mode 100644
index 000000000..d399fc05b
--- /dev/null
+++ b/tests/data/test281
@@ -0,0 +1,65 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP PUT
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 100 Continue
+
+HTTP/1.1 401 Bad Auth swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+WWW-Authenticate: Basic Realm=authenticate
+Server: test-server/fake
+</data>
+<datacheck>
+HTTP/1.1 100 Continue
+
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP PUT from file with 100 + 401 responses and -f without auth given
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/want/281 -f -T log/test281.txt
+</command>
+<file name="log/test281.txt">
+Weird
+ file
+ to
+ upload
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+22
+</errorcode>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+PUT /we/want/281 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 38
+Expect: 100-continue
+
+Weird
+ file
+ to
+ upload
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test282 b/tests/data/test282
new file mode 100644
index 000000000..aa8aba5a2
--- /dev/null
+++ b/tests/data/test282
@@ -0,0 +1,45 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK swsclose
+
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET with no response body or headers
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/282
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /282 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test283 b/tests/data/test283
new file mode 100644
index 000000000..922de51e0
--- /dev/null
+++ b/tests/data/test283
@@ -0,0 +1,36 @@
+<testcase>
+<info>
+<keywords>
+TFTP
+TFTP RRQ
+FAILURE
+</keywords>
+</info>
+
+#
+# Client-side
+<client>
+<server>
+tftp
+</server>
+ <name>
+TFTP retrieve on invalid file
+ </name>
+ <command>
+tftp://%HOSTIP:%TFTPPORT//invalid-file --trace-ascii log/traceit
+</command>
+</client>
+
+#
+# Verify pseudo protocol after the test has been "shot"
+<verify>
+<errorcode>
+69
+</errorcode>
+<protocol>
+opcode: 1
+filename: /invalid-file
+mode: octet
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test284 b/tests/data/test284
new file mode 100644
index 000000000..0c2a66560
--- /dev/null
+++ b/tests/data/test284
@@ -0,0 +1,67 @@
+<testcase>
+<info>
+<keywords>
+TFTP
+TFTP RRQ
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+A chunk of data which exactly fits into
+a 512 byte TFTP block, testing a boundary
+condition in the TFTP receive code.
+789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+tftp
+</server>
+ <name>
+TFTP retrieve of boundary case 512 byte file
+ </name>
+ <command>
+tftp://%HOSTIP:%TFTPPORT//284 --trace-ascii log/traceit
+</command>
+</client>
+
+#
+# Verify pseudo protocol after the test has been "shot"
+<verify>
+<protocol>
+opcode: 1
+filename: /284
+mode: octet
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test285 b/tests/data/test285
new file mode 100644
index 000000000..75a19991d
--- /dev/null
+++ b/tests/data/test285
@@ -0,0 +1,44 @@
+<testcase>
+<info>
+<keywords>
+TFTP
+TFTP WRQ
+</keywords>
+</info>
+
+#
+# Client-side
+<client>
+<server>
+tftp
+</server>
+ <name>
+TFTP send
+ </name>
+ <command>
+-T log/test285.txt tftp://%HOSTIP:%TFTPPORT// --trace-ascii log/traceit
+</command>
+<file name="log/test285.txt">
+a chunk of
+data
+sent
+ to server
+</file>
+</client>
+
+#
+# Verify pseudo protocol after the test has been "shot"
+<verify>
+<upload>
+a chunk of
+data
+sent
+ to server
+</upload>
+<protocol>
+opcode: 2
+filename: /test285.txt
+mode: octet
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test286 b/tests/data/test286
new file mode 100644
index 000000000..841ee1e2a
--- /dev/null
+++ b/tests/data/test286
@@ -0,0 +1,92 @@
+<testcase>
+<info>
+<keywords>
+TFTP
+TFTP WRQ
+</keywords>
+</info>
+
+#
+# Client-side
+<client>
+<server>
+tftp
+</server>
+ <name>
+TFTP send of boundary case 512 byte file
+ </name>
+ <command>
+-T log/test286.txt tftp://%HOSTIP:%TFTPPORT// --trace-ascii log/traceit
+</command>
+<file name="log/test286.txt">
+A chunk of data which exactly fits into
+a 512 byte TFTP block, testing a boundary
+condition in the TFTP transmit code.
+89ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+</file>
+</client>
+
+#
+# Verify pseudo protocol after the test has been "shot"
+<verify>
+<upload>
+A chunk of data which exactly fits into
+a 512 byte TFTP block, testing a boundary
+condition in the TFTP transmit code.
+89ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+123456789ABCDEF
+</upload>
+<protocol>
+opcode: 2
+filename: /test286.txt
+mode: octet
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test287 b/tests/data/test287
new file mode 100644
index 000000000..30f5834d5
--- /dev/null
+++ b/tests/data/test287
@@ -0,0 +1,54 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP CONNECT
+HTTP proxy
+proxytunnel
+</keywords>
+</info>
+
+# Server-side
+<reply>
+
+# this is returned first since we get no proxy-auth
+<data nocheck="yes">
+HTTP/1.1 405 Method Not Allowed swsclose
+
+And you should ignore this data.
+</data>
+
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP proxy CONNECT with custom User-Agent header
+ </name>
+ <command>
+http://test.remote.haxx.se:287/path/287 -H "User-Agent: looser/2007" --proxy http://%HOSTIP:%HTTPPORT --proxytunnel
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+CONNECT test.remote.haxx.se:287 HTTP/1.1
+Host: test.remote.haxx.se:287
+Proxy-Connection: Keep-Alive
+User-Agent: looser/2007
+
+</protocol>
+# CURLE_RECV_ERROR
+<errorcode>
+56
+</errorcode>
+<stdout>
+HTTP/1.1 405 Method Not Allowed swsclose
+
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test288 b/tests/data/test288
new file mode 100644
index 000000000..da691451a
--- /dev/null
+++ b/tests/data/test288
@@ -0,0 +1,42 @@
+<testcase>
+# Server-side
+<reply>
+<data>
+foo
+ bar
+bar
+ foo
+moo
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+none
+</server>
+<features>
+file
+</features>
+ <name>
+file:// with (unsupported) proxy, authentication and range
+ </name>
+<setenv>
+all_proxy=http://fake:user@%HOSTIP:%HTTPPORT/
+</setenv>
+ <command>
+file://localhost/%PWD/log/test288.txt
+</command>
+<file name="log/test288.txt">
+foo
+ bar
+bar
+ foo
+moo
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+</verify>
+</testcase>
diff --git a/tests/data/test289 b/tests/data/test289
new file mode 100644
index 000000000..2720e2e9c
--- /dev/null
+++ b/tests/data/test289
@@ -0,0 +1,30 @@
+<testcase>
+<info>
+<keywords>
+FTP
+STOR
+Resume
+FAILURE
+</keywords>
+</info>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP resume upload but denied access to local file
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/289 -T log/illegal-nonexistent-file -C -
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+26
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test29 b/tests/data/test29
new file mode 100644
index 000000000..9a7bd9ef9
--- /dev/null
+++ b/tests/data/test29
@@ -0,0 +1,52 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+timeout
+FAILURE
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+
+_data_result_data_
+</data>
+<postcmd>
+wait 10
+</postcmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP with 2 secs timeout
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/want/29 -m 2
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /want/29 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+<errorcode>
+28
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test290 b/tests/data/test290
new file mode 100644
index 000000000..6078a2ac7
--- /dev/null
+++ b/tests/data/test290
@@ -0,0 +1,43 @@
+<testcase>
+<info>
+<keywords>
+FTP
+--max-filesize
+</keywords>
+</info>
+# Server-side
+<reply>
+<size>
+85
+</size>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP download maximum filesize exceeded
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/290 --max-filesize 30
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+63
+</errorcode>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE I
+SIZE 290
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test291 b/tests/data/test291
new file mode 100644
index 000000000..18e039e4f
--- /dev/null
+++ b/tests/data/test291
@@ -0,0 +1,47 @@
+<testcase>
+<info>
+<keywords>
+FTP
+RETR
+--max-filesize
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+data
+ to
+ see
+that FTP
+works
+ so does it?
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP download maximum filesize not exceeded
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/291 --max-filesize 100
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE I
+SIZE 291
+RETR 291
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test292 b/tests/data/test292
new file mode 100644
index 000000000..800e8d178
--- /dev/null
+++ b/tests/data/test292
@@ -0,0 +1,56 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+--max-filesize
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+-foo-
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET with maximum filesize not exceeded
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/292 --max-filesize 1000
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /292 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test293 b/tests/data/test293
new file mode 100644
index 000000000..d75fc9a3c
--- /dev/null
+++ b/tests/data/test293
@@ -0,0 +1,60 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+--max-filesize
+FAILURE
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+-foo-
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET with maximum filesize exceeded
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/293 --max-filesize 2
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+63
+</errorcode>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /293 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test294 b/tests/data/test294
new file mode 100644
index 000000000..4d7f2b8e9
--- /dev/null
+++ b/tests/data/test294
@@ -0,0 +1,64 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+LIST
+ACCT
+--ftp-account
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+# When doing LIST, we get the default list output hard-coded in the test
+# FTP server
+<datacheck>
+total 20
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
+drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
+-r--r--r-- 1 0 1 35 Jul 16 1996 README
+lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
+dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
+drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
+dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
+drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
+dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
+</datacheck>
+<servercmd>
+REPLY PASS 332 Give me an ACCT now
+REPLY ACCT 230 Thank-you for the ACCT
+</servercmd>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP --ftp-account on ACCT request
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/294/ --ftp-account "data for acct"
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+ACCT data for acct
+PWD
+CWD 294
+EPSV
+TYPE A
+LIST
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test295 b/tests/data/test295
new file mode 100644
index 000000000..5b1ddcf6b
--- /dev/null
+++ b/tests/data/test295
@@ -0,0 +1,45 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+LIST
+ACCT
+FAILURE
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<servercmd>
+REPLY PASS 332 Give me an ACCT now
+REPLY PWD 530 No ACCT, go away
+</servercmd>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP ACCT request without --ftp-account
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/295/
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+67
+</errorcode>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test296 b/tests/data/test296
new file mode 100644
index 000000000..2008c8bfd
--- /dev/null
+++ b/tests/data/test296
@@ -0,0 +1,48 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+CWD
+--ftp-method
+multicwd
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+bla bla bla
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP CWD with --ftp-method multicwd
+ </name>
+ <command>
+--ftp-method multicwd ftp://%HOSTIP:%FTPPORT/first/second/third/296
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD first
+CWD second
+CWD third
+EPSV
+TYPE I
+SIZE 296
+RETR 296
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test297 b/tests/data/test297
new file mode 100644
index 000000000..36573f8b9
--- /dev/null
+++ b/tests/data/test297
@@ -0,0 +1,46 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+CWD
+--ftp-method
+singlecwd
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+bla bla bla
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP CWD with --ftp-method singlecwd
+ </name>
+ <command>
+--ftp-method singlecwd ftp://%HOSTIP:%FTPPORT/first/second/third/297
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD first/second/third
+EPSV
+TYPE I
+SIZE 297
+RETR 297
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test298 b/tests/data/test298
new file mode 100644
index 000000000..80913e84b
--- /dev/null
+++ b/tests/data/test298
@@ -0,0 +1,45 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+CWD
+--ftp-method
+nocwd
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+bla bla bla
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP CWD with --ftp-method nocwd
+ </name>
+ <command>
+--ftp-method nocwd ftp://%HOSTIP:%FTPPORT/first/second/third/298
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE I
+SIZE first/second/third/298
+RETR first/second/third/298
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test299 b/tests/data/test299
new file mode 100644
index 000000000..a557a14c7
--- /dev/null
+++ b/tests/data/test299
@@ -0,0 +1,53 @@
+<testcase>
+<info>
+<keywords>
+FTP
+HTTP
+CURLOPT_USERPWD
+HTTP proxy
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.0 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+
+blablabla
+
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+ftp
+</features>
+ <name>
+FTP over HTTP proxy with user:pass not in url
+ </name>
+ <command>
+-x http://%HOSTIP:%HTTPPORT -u michal:aybabtu ftp://host.com/we/want/299
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET ftp://michal:aybabtu@host.com/we/want/299 HTTP/1.1
+Authorization: Basic bWljaGFsOmF5YmFidHU=
+Host: host.com:21
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test3 b/tests/data/test3
new file mode 100644
index 000000000..2167b2a49
--- /dev/null
+++ b/tests/data/test3
@@ -0,0 +1,60 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP POST
+HTTP Basic auth
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.0 200 OK
+Server: test-server/fake
+Content-Type: text/html
+Content-Length: 0
+
+this is data even though Content-Length is set to zero
+</data>
+<datacheck>
+HTTP/1.0 200 OK
+Server: test-server/fake
+Content-Type: text/html
+Content-Length: 0
+
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP POST with auth and contents but with content-length set to 0
+ </name>
+ <command>
+ -d "fooo=mooo&pooo=clue&doo=%20%20%20++++" -u "fake:-user" http://%HOSTIP:%HTTPPORT/3
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol nonewline="yes">
+POST /3 HTTP/1.1
+Authorization: Basic ZmFrZTotdXNlcg==
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 37
+Content-Type: application/x-www-form-urlencoded
+
+fooo=mooo&pooo=clue&doo=%20%20%20++++
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test30 b/tests/data/test30
new file mode 100644
index 000000000..70b8005f5
--- /dev/null
+++ b/tests/data/test30
@@ -0,0 +1,43 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+FAILURE
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP with no data in server reply
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/want/30
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /want/30 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+<errorcode>
+52
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test300 b/tests/data/test300
new file mode 100644
index 000000000..7b4222d12
--- /dev/null
+++ b/tests/data/test300
@@ -0,0 +1,52 @@
+<testcase>
+<info>
+<keywords>
+HTTPS
+HTTP GET
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 7
+
+MooMoo
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+SSL
+</features>
+<server>
+https
+</server>
+ <name>
+simple HTTPS GET
+ </name>
+ <command>
+-k https://%HOSTIP:%HTTPSPORT/300
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /300 HTTP/1.1
+Host: %HOSTIP:%HTTPSPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test301 b/tests/data/test301
new file mode 100644
index 000000000..d5974ce69
--- /dev/null
+++ b/tests/data/test301
@@ -0,0 +1,57 @@
+<testcase>
+<info>
+<keywords>
+HTTPS
+HTTP GET
+HTTP Basic auth
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Type: text/html
+Funny-head: yesyes
+
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+SSL
+</features>
+<server>
+https
+</server>
+ <name>
+HTTPS GET with user and password
+ </name>
+ <command>
+-k -u fake:user https://%HOSTIP:%HTTPSPORT/301
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /301 HTTP/1.1
+Authorization: Basic ZmFrZTp1c2Vy
+Host: %HOSTIP:%HTTPSPORT
+Accept: */*
+
+</protocol>
+<data>
+[insert full protocol verifiction dump here]
+</data>
+</verify>
+</testcase>
diff --git a/tests/data/test302 b/tests/data/test302
new file mode 100644
index 000000000..1223f1c33
--- /dev/null
+++ b/tests/data/test302
@@ -0,0 +1,40 @@
+<testcase>
+<info>
+<keywords>
+HTTPS
+HTTP GET
+HTTP CONNECT
+HTTP proxy
+FAILURE
+</keywords>
+</info>
+
+# Client-side
+<client>
+<features>
+SSL
+</features>
+<server>
+https
+</server>
+ <name>
+HTTPS GET over HTTP proxy fails
+ </name>
+ <command>
+-k -U fake:user -x %HOSTIP:%HTTPPORT https://bad.fakeurl-to.test/slash/302
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+56
+</errorcode>
+<strip>
+^User-Agent:.*
+</strip>
+<data>
+</data>
+</verify>
+</testcase>
diff --git a/tests/data/test303 b/tests/data/test303
new file mode 100644
index 000000000..01dd9ebb1
--- /dev/null
+++ b/tests/data/test303
@@ -0,0 +1,55 @@
+<testcase>
+<info>
+<keywords>
+HTTPS
+HTTP GET
+timeout
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+
+_data_result_data_
+</data>
+<postcmd>
+wait 20
+</postcmd>
+</reply>
+
+# Client-side
+<client>
+<features>
+SSL
+</features>
+<server>
+https
+</server>
+ <name>
+HTTPS with 8 secs timeout
+ </name>
+ <command>
+-k https://%HOSTIP:%HTTPSPORT/want/303 -m 8
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /want/303 HTTP/1.1
+Host: %HOSTIP:%HTTPSPORT
+Accept: */*
+
+</protocol>
+<errorcode>
+28
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test304 b/tests/data/test304
new file mode 100644
index 000000000..fedf18ff5
--- /dev/null
+++ b/tests/data/test304
@@ -0,0 +1,72 @@
+<testcase>
+<info>
+<keywords>
+HTTPS
+HTTP POST
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 10
+
+blablabla
+</data>
+</reply>
+
+# Client-side
+<client>
+<features>
+SSL
+</features>
+<server>
+https
+</server>
+ <name>
+HTTPS multipart formpost
+ </name>
+ <command>
+-k https://%HOSTIP:%HTTPSPORT/we/want/304 -F name=daniel -F tool=curl -F file=@log/test304.txt
+</command>
+# We create this file before the command is invoked!
+<file name="log/test304.txt">
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^(User-Agent:|Content-Type: multipart/form-data;|------).*
+</strip>
+<protocol>
+POST /we/want/304 HTTP/1.1
+User-Agent: curl/7.10.4 (i686-pc-linux-gnu) libcurl/7.10.4 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPSPORT
+Accept: */*
+Content-Length: 1386
+Expect: 100-continue
+Content-Type: multipart/form-data; boundary=----------------------------c3b2ef7f0bb8
+
+------------------------------c3b2ef7f0bb8
+Content-Disposition: form-data; name="name"
+
+daniel
+------------------------------c3b2ef7f0bb8
+Content-Disposition: form-data; name="tool"
+
+curl
+------------------------------c3b2ef7f0bb8
+Content-Disposition: form-data; name="file"; filename="test304.txt"
+Content-Type: text/plain
+
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+
+------------------------------c3b2ef7f0bb8--
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test305 b/tests/data/test305
new file mode 100644
index 000000000..858a0040e
--- /dev/null
+++ b/tests/data/test305
@@ -0,0 +1,35 @@
+<testcase>
+<info>
+<keywords>
+HTTPS
+HTTP GET
+FAILURE
+</keywords>
+</info>
+
+# Client-side
+<client>
+<features>
+SSL
+</features>
+<server>
+https
+</server>
+ <name>
+insecure HTTPS without permission
+ </name>
+ <command>
+https://%HOSTIP:%HTTPSPORT/want/305 --cacert moooo
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<errorcode>
+77
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test306 b/tests/data/test306
new file mode 100644
index 000000000..95d4cef35
--- /dev/null
+++ b/tests/data/test306
@@ -0,0 +1,65 @@
+<testcase>
+<info>
+<keywords>
+HTTPS
+HTTP GET
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+No headers at all, just data swsclose
+
+Let's get
+
+a little
+
+so that
+
+we
+
+have
+
+some
+
+test
+
+data to
+
+verify
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+SSL
+</features>
+<server>
+https
+</server>
+ <name>
+HTTPS GET, receive no headers only data!
+ </name>
+ <command>
+-k https://%HOSTIP:%HTTPSPORT/306
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /306 HTTP/1.1
+Host: %HOSTIP:%HTTPSPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test307 b/tests/data/test307
new file mode 100644
index 000000000..03c2b3c2d
--- /dev/null
+++ b/tests/data/test307
@@ -0,0 +1,56 @@
+<testcase>
+<info>
+<keywords>
+HTTPS
+HTTP GET
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Tue, 16 Jan 2007 18:00:14 GMT
+Server: test-server/fake
+Content-Length: 7
+
+MooMoo
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+OpenSSL
+</features>
+<server>
+https
+</server>
+<precheck>
+perl %SRCDIR/libtest/test307.pl %CURL
+</precheck>
+
+ <name>
+simple HTTPS GET with openssl engine
+ </name>
+ <command>
+--engine openssl -k https://%HOSTIP:%HTTPSPORT/307
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /307 HTTP/1.1
+Host: %HOSTIP:%HTTPSPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test308 b/tests/data/test308
new file mode 100644
index 000000000..d20556a19
--- /dev/null
+++ b/tests/data/test308
@@ -0,0 +1,34 @@
+<testcase>
+<info>
+<keywords>
+HTTPS
+HTTP GET
+FAILURE
+</keywords>
+</info>
+
+#
+# Client-side
+<client>
+<features>
+OpenSSL
+</features>
+<server>
+https
+</server>
+ <name>
+simple HTTPS GET with invalid crypto engine
+ </name>
+ <command>
+--engine invalid-crypto-engine-xyzzy -k https://%HOSTIP:%HTTPSPORT/308
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+53
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test309 b/tests/data/test309
new file mode 100644
index 000000000..dd0431206
--- /dev/null
+++ b/tests/data/test309
@@ -0,0 +1,86 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTPS
+HTTP GET
+followlocation
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 301 This is a weirdo text message swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Location: https://127.0.0.1:8991/data/3090002.txt?coolsite=yes
+Connection: close
+
+This server reply is for testing a simple Location: following to HTTPS URL
+
+</data>
+<data2>
+HTTP/1.1 200 Followed here fine swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 52
+
+If this is received, the location following worked
+
+</data2>
+<datacheck>
+HTTP/1.1 301 This is a weirdo text message swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Location: https://127.0.0.1:8991/data/3090002.txt?coolsite=yes
+Connection: close
+
+HTTP/1.1 200 Followed here fine swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 52
+
+If this is received, the location following worked
+
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<features>
+SSL
+</features>
+<server>
+http
+https
+</server>
+ <name>
+HTTP Location: redirect to HTTPS URL
+ </name>
+ <command>
+-k http://%HOSTIP:%HTTPPORT/want/309 -L
+</command>
+# The data section doesn't do variable substitution, so we must assert this
+<precheck>
+perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP' ne '127.0.0.1' || '%HTTPSPORT' ne '8991' );"
+</precheck>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /want/309 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /data/3090002.txt?coolsite=yes HTTP/1.1
+Host: %HOSTIP:%HTTPSPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test31 b/tests/data/test31
new file mode 100644
index 000000000..d06bc1180
--- /dev/null
+++ b/tests/data/test31
@@ -0,0 +1,78 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+cookies
+cookiejar
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 4
+Content-Type: text/html
+Funny-head: yesyes
+Set-Cookie: foobar=name; domain=anything.com; path=/ ; secure
+Set-Cookie:ismatch=this ; domain=127.0.0.1; path=/silly/
+Set-Cookie: partmatch=present; domain=127.0.0.1 ; path=/;
+Set-Cookie:eat=this; domain=moo.foo.moo;
+Set-Cookie: eat=this-too; domain=.foo.moo;
+Set-Cookie: nodomainnovalue
+Set-Cookie: nodomain=value; expires=Fri Feb 2 11:56:27 GMT 2035
+Set-Cookie: novalue; domain=reallysilly
+Set-Cookie: test=yes; domain=foo.com; expires=Sat Feb 2 11:56:27 GMT 2030
+Set-Cookie: test2=yes; domain=se; expires=Sat Feb 2 11:56:27 GMT 2030
+Set-Cookie: magic=yessir; path=/silly/; HttpOnly
+Set-Cookie: blexp=yesyes; domain=.0.0.1; domain=.0.0.1; expiry=totally bad;
+
+boo
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP with weirdly formatted cookies and cookiejar storage
+ </name>
+# Explicitly set the time zone to a known good one, in case the user is
+# using one of the 'right' zones that take into account leap seconds
+# which causes the cookie expiry times to be different.
+<setenv>
+TZ=GMT
+</setenv>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/want/31 -b none -c log/jar31.txt
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /we/want/31 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+<file name="log/jar31.txt" mode="text">
+# Netscape HTTP Cookie File
+# http://curl.haxx.se/rfc/cookie_spec.html
+# This file was generated by libcurl! Edit at your own risk.
+
+.127.0.0.1 TRUE /silly/ FALSE 0 ismatch this
+.127.0.0.1 TRUE / FALSE 0 partmatch present
+127.0.0.1 FALSE /we/want/ FALSE 2054030187 nodomain value
+#HttpOnly_127.0.0.1 FALSE /silly/ FALSE 0 magic yessir
+.0.0.1 TRUE /we/want/ FALSE 0 blexp yesyes
+</file>
+</verify>
+</testcase>
diff --git a/tests/data/test310 b/tests/data/test310
new file mode 100644
index 000000000..e7a9379ab
--- /dev/null
+++ b/tests/data/test310
@@ -0,0 +1,57 @@
+<testcase>
+<info>
+<keywords>
+HTTPS
+HTTP GET
+PEM certificate
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 7
+
+MooMoo
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+SSL
+</features>
+<server>
+https Server-localhost-sv.pem
+</server>
+ <name>
+simple HTTPS GET
+ </name>
+ <command>
+--cacert %SRCDIR/certs/EdelCurlRoot-ca.crt https://localhost:%HTTPSPORT/310
+</command>
+# Ensure that we're running on localhost because we're checking the host name
+<precheck>
+perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );"
+</precheck>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /310 HTTP/1.1
+Host: localhost:%HTTPSPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test311 b/tests/data/test311
new file mode 100644
index 000000000..0465ed1d3
--- /dev/null
+++ b/tests/data/test311
@@ -0,0 +1,43 @@
+<testcase>
+<info>
+<keywords>
+HTTPS
+HTTP GET
+PEM certificate
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+SSL
+</features>
+<server>
+https Server-localhost0h-sv.pem
+</server>
+ <name>
+HTTPS wrong subjectAltName but right CN
+ </name>
+ <command>
+--cacert %SRCDIR/certs/EdelCurlRoot-ca.crt https://localhost:%HTTPSPORT/311
+</command>
+# Ensure that we're running on localhost because we're checking the host name
+<precheck>
+perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );"
+</precheck>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+51
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test312 b/tests/data/test312
new file mode 100644
index 000000000..af4422f43
--- /dev/null
+++ b/tests/data/test312
@@ -0,0 +1,43 @@
+<testcase>
+<info>
+<keywords>
+HTTPS
+HTTP GET
+PEM certificate
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+SSL
+</features>
+<server>
+https Server-localhost.nn-sv.pem
+</server>
+ <name>
+HTTPS GET to localhost and null-prefixed CN cert
+ </name>
+ <command>
+--cacert %SRCDIR/certs/EdelCurlRoot-ca.crt https://localhost:%HTTPSPORT/312
+</command>
+# Ensure that we're running on localhost because we're checking the host name
+<precheck>
+perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );"
+</precheck>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+51
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test313 b/tests/data/test313
new file mode 100644
index 000000000..c54495a88
--- /dev/null
+++ b/tests/data/test313
@@ -0,0 +1,39 @@
+<testcase>
+<info>
+<keywords>
+HTTPS
+HTTP GET
+PEM certificate
+CRL
+</keywords>
+</info>
+
+#
+# Client-side
+<client>
+<features>
+SSL
+</features>
+<server>
+https Server-localhost-sv.pem
+</server>
+ <name>
+CRL test
+ </name>
+ <command>
+--cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --crlfile %SRCDIR/certs/Server-localhost-sv.crl https://localhost:%HTTPSPORT/313
+</command>
+# Ensure that we're running on localhost because we're checking the host name
+<precheck>
+perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );"
+</precheck>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+60
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test32 b/tests/data/test32
new file mode 100644
index 000000000..992ffcbcf
--- /dev/null
+++ b/tests/data/test32
@@ -0,0 +1,56 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+-G
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+-foo-
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP with -d and -G
+ </name>
+ <command>
+-d "foo=moo&moo=poo" http://%HOSTIP:%HTTPPORT/32 -G
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /32?foo=moo&moo=poo HTTP/1.1
+User-Agent: curl/7.9.5 (i686-pc-linux-gnu) libcurl 7.9.5-cvs (OpenSSL 0.9.5) (ipv6 enabled)
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test33 b/tests/data/test33
new file mode 100644
index 000000000..82cf80b30
--- /dev/null
+++ b/tests/data/test33
@@ -0,0 +1,64 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP PUT
+Resume
+Content-Range
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 OK swsclose
+
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP PUT with resume
+ </name>
+<file name="log/test33.txt">
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+012345678
+</file>
+ <command>
+http://%HOSTIP:%HTTPPORT/33 -Tlog/test33.txt -C 50
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+PUT /33 HTTP/1.1
+Content-Range: bytes 50-99/100
+User-Agent: curl/7.6 (sparc-sun-solaris2.7) libcurl 7.6-pre4 (SSL 0.9.6) (krb4 enabled)
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 50
+Expect: 100-continue
+
+012345678
+012345678
+012345678
+012345678
+012345678
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test34 b/tests/data/test34
new file mode 100644
index 000000000..a332b8c4b
--- /dev/null
+++ b/tests/data/test34
@@ -0,0 +1,66 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+chunked Transfer-Encoding
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 funky chunky!
+Server: fakeit/0.9 fakeitbad/1.0
+Transfer-Encoding: chunked
+Connection: mooo
+
+40
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+30
+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+21;heresatest=moooo
+cccccccccccccccccccccccccccccccc
+
+0
+
+</data>
+<datacheck>
+HTTP/1.1 200 funky chunky!
+Server: fakeit/0.9 fakeitbad/1.0
+Transfer-Encoding: chunked
+Connection: mooo
+
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccc
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET with chunked Transfer-Encoding
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/34
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /34 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+
+</testcase>
diff --git a/tests/data/test35 b/tests/data/test35
new file mode 100644
index 000000000..85733a456
--- /dev/null
+++ b/tests/data/test35
Binary files differ
diff --git a/tests/data/test350 b/tests/data/test350
new file mode 100644
index 000000000..9c22d307c
--- /dev/null
+++ b/tests/data/test350
@@ -0,0 +1,57 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+LIST
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+# When doing LIST, we get the default list output hard-coded in the test
+# FTP server
+<datacheck>
+total 20
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
+drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
+-r--r--r-- 1 0 1 35 Jul 16 1996 README
+lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
+dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
+drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
+dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
+drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
+dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP root dir list multicwd
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT// --ftp-method multicwd
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD /
+EPSV
+TYPE A
+LIST
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test351 b/tests/data/test351
new file mode 100644
index 000000000..5d44a647f
--- /dev/null
+++ b/tests/data/test351
@@ -0,0 +1,56 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+LIST
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+# When doing LIST, we get the default list output hard-coded in the test
+# FTP server
+<datacheck>
+total 20
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
+drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
+-r--r--r-- 1 0 1 35 Jul 16 1996 README
+lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
+dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
+drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
+dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
+drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
+dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP root dir list nocwd
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT// --ftp-method nocwd
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE A
+LIST /
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test352 b/tests/data/test352
new file mode 100644
index 000000000..d86889448
--- /dev/null
+++ b/tests/data/test352
@@ -0,0 +1,57 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+LIST
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+# When doing LIST, we get the default list output hard-coded in the test
+# FTP server
+<datacheck>
+total 20
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
+drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
+-r--r--r-- 1 0 1 35 Jul 16 1996 README
+lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
+dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
+drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
+dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
+drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
+dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP root dir list singlecwd
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT// --ftp-method singlecwd
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD /
+EPSV
+TYPE A
+LIST
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test353 b/tests/data/test353
new file mode 100644
index 000000000..417b8c3ea
--- /dev/null
+++ b/tests/data/test353
@@ -0,0 +1,56 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+LIST
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+# When doing LIST, we get the default list output hard-coded in the test
+# FTP server
+<datacheck>
+total 20
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
+drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
+-r--r--r-- 1 0 1 35 Jul 16 1996 README
+lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
+dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
+drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
+dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
+drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
+dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP home dir list singlecwd
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/ --ftp-method singlecwd
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE A
+LIST
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test354 b/tests/data/test354
new file mode 100644
index 000000000..a6949328a
--- /dev/null
+++ b/tests/data/test354
@@ -0,0 +1,50 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+RETR
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+data
+ to
+ see
+that FTP
+works
+ so does it?
+</data>
+<servercmd>
+REPLY USER 200 fine, proceed without password
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP without password
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/354
+</command>
+
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PWD
+EPSV
+TYPE I
+SIZE 354
+RETR 354
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test36 b/tests/data/test36
new file mode 100644
index 000000000..4e3fd8c87
--- /dev/null
+++ b/tests/data/test36
@@ -0,0 +1,66 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+chunked Transfer-Encoding
+FAILURE
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 funky chunky!
+Server: fakeit/0.9 fakeitbad/1.0
+Transfer-Encoding: chunked
+Connection: mooo
+
+2
+a
+
+ILLEGAL
+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+</data>
+<datacheck>
+HTTP/1.1 200 funky chunky!
+Server: fakeit/0.9 fakeitbad/1.0
+Transfer-Encoding: chunked
+Connection: mooo
+
+a
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET with bad chunked Transfer-Encoding
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/36
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+56
+</errorcode>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /36 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+
+</testcase>
diff --git a/tests/data/test37 b/tests/data/test37
new file mode 100644
index 000000000..768762300
--- /dev/null
+++ b/tests/data/test37
@@ -0,0 +1,47 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+FAILURE
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET with nothing returned from server
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/37
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+52
+</errorcode>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /37 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+
+</testcase>
diff --git a/tests/data/test38 b/tests/data/test38
new file mode 100644
index 000000000..75155866d
--- /dev/null
+++ b/tests/data/test38
@@ -0,0 +1,61 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+Resume
+FAILURE
+</keywords>
+</info>
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.0 200 Mooo
+Date: Mon, 13 Nov 2000 13:41:09 GMT
+Server: myown/1.0
+Connection: close
+
+todelooooo lalalala yada yada, we know nothing about ranges ;-)
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP resume request without server supporting it
+ </name>
+ <command option="no-output">
+http://%HOSTIP:%HTTPPORT/want/38 -C - --no-include -o log/fewl.txt
+</command>
+<file name="log/fewl.txt">
+This text is here to simulate a partly downloaded file to resume
+download on.
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+33
+</errorcode>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /want/38 HTTP/1.1
+Range: bytes=78-
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+
+# the download target file must remain untouched
+<file name="log/fewl.txt">
+This text is here to simulate a partly downloaded file to resume
+download on.
+</file>
+</verify>
+</testcase>
diff --git a/tests/data/test39 b/tests/data/test39
new file mode 100644
index 000000000..2c8da3364
--- /dev/null
+++ b/tests/data/test39
@@ -0,0 +1,91 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP FORMPOST
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 10
+
+blablabla
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP RFC1867-type formposting with filename= and type=
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/want/39 -F name=daniel -F tool=curl --form-string "str1=@literal" --form-string "str2=<verbatim;type=xxx/yyy" -F "file=@log/test39.txt;type=moo/foobar;filename=fakerfile" -F file2=@log/test39.txt
+</command>
+# We create this file before the command is invoked!
+<file name="log/test39.txt">
+foo bar
+This is a bar foo
+bar
+foo
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^(User-Agent:|Content-Type: multipart/form-data;|-------).*
+</strip>
+<protocol>
+POST /we/want/39 HTTP/1.1
+User-Agent: curl/7.10.4 (i686-pc-linux-gnu) libcurl/7.10.4 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 810
+Expect: 100-continue
+Content-Type: multipart/form-data; boundary=----------------------------24e78000bd32
+
+------------------------------24e78000bd32
+Content-Disposition: form-data; name="name"
+
+daniel
+------------------------------24e78000bd32
+Content-Disposition: form-data; name="tool"
+
+curl
+------------------------------24e78000bd32
+Content-Disposition: form-data; name="str1"
+
+@literal
+------------------------------24e78000bd32
+Content-Disposition: form-data; name="str2"
+
+<verbatim;type=xxx/yyy
+------------------------------24e78000bd32
+Content-Disposition: form-data; name="file"; filename="fakerfile"
+Content-Type: moo/foobar
+
+foo bar
+This is a bar foo
+bar
+foo
+
+------------------------------24e78000bd32
+Content-Disposition: form-data; name="file2"; filename="test39.txt"
+Content-Type: text/plain
+
+foo bar
+This is a bar foo
+bar
+foo
+
+------------------------------24e78000bd32--
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test4 b/tests/data/test4
new file mode 100644
index 000000000..ce6bfc8f0
--- /dev/null
+++ b/tests/data/test4
@@ -0,0 +1,51 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP added headers
+HTTP replaced headers
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/html
+Funny-head: yesyes
+
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+Replaced internal and added custom HTTP headers
+ </name>
+ <command>
+ -H "extra-header: here" -H "Accept: replaced" http://%HOSTIP:%HTTPPORT/4
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /4 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+extra-header: here
+Accept: replaced
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test40 b/tests/data/test40
new file mode 100644
index 000000000..b56ff7587
--- /dev/null
+++ b/tests/data/test40
@@ -0,0 +1,74 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+followlocation
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 302 OK swsclose
+Location: ../moo.html/?name=d a niel&testcase=/400002
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+
+</data>
+<data2>
+HTTP/1.1 200 OK swsclose
+Location: this should be ignored
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+
+body
+</data2>
+<datacheck>
+HTTP/1.1 302 OK swsclose
+Location: ../moo.html/?name=d a niel&testcase=/400002
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+
+HTTP/1.1 200 OK swsclose
+Location: this should be ignored
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+
+body
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP redirect with whitespace after ? (and conversion)
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/are/all/twits/40 -L
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /we/are/all/twits/40 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /we/are/all/moo.html/?name=d+a+niel&testcase=/400002 HTTP/1.1
+User-Agent: curl/7.10 (i686-pc-linux-gnu) libcurl/7.10 OpenSSL/0.9.6c ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test400 b/tests/data/test400
new file mode 100644
index 000000000..75d59791e
--- /dev/null
+++ b/tests/data/test400
@@ -0,0 +1,61 @@
+<testcase>
+<info>
+<keywords>
+FTPS
+PASV
+LIST
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+# When doing LIST, we get the default list output hard-coded in the test
+# FTPS server
+<datacheck>
+total 20
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
+drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
+-r--r--r-- 1 0 1 35 Jul 16 1996 README
+lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
+dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
+drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
+dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
+drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
+dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+SSL
+</features>
+<server>
+ftps
+</server>
+ <name>
+FTPS dir list PASV unencrypted data
+ </name>
+ <command>
+-k --ftp-ssl-control ftps://%HOSTIP:%FTPSPORT/
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PBSZ 0
+PROT C
+PWD
+EPSV
+TYPE A
+LIST
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test401 b/tests/data/test401
new file mode 100644
index 000000000..cb01c1c2c
--- /dev/null
+++ b/tests/data/test401
@@ -0,0 +1,56 @@
+<testcase>
+<info>
+<keywords>
+FTPS
+EPSV
+STOR
+</keywords>
+</info>
+
+# Client-side
+<client>
+<features>
+SSL
+</features>
+<server>
+ftps
+</server>
+ <name>
+FTPS PASV upload file
+ </name>
+<file name="log/test401.txt">
+data
+ to
+ see
+that FTPS
+works
+ so does it?
+</file>
+ <command>
+-k --ftp-ssl-control ftps://%HOSTIP:%FTPSPORT/401 -T log/test401.txt
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<upload>
+data
+ to
+ see
+that FTPS
+works
+ so does it?
+</upload>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PBSZ 0
+PROT C
+PWD
+EPSV
+TYPE I
+STOR 401
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test402 b/tests/data/test402
new file mode 100644
index 000000000..272c4e309
--- /dev/null
+++ b/tests/data/test402
@@ -0,0 +1,35 @@
+<testcase>
+<info>
+<keywords>
+FTPS
+FAILURE
+</keywords>
+</info>
+
+# Client-side
+<client>
+<features>
+SSL
+</features>
+<server>
+ftp
+</server>
+ <name>
+FTP SSL required on non-SSL server
+ </name>
+ <command>
+-k --ftp-ssl-reqd ftp://%HOSTIP:%FTPPORT/402
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+64
+</errorcode>
+<protocol>
+AUTH SSL
+AUTH TLS
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test403 b/tests/data/test403
new file mode 100644
index 000000000..2b8ff5e29
--- /dev/null
+++ b/tests/data/test403
@@ -0,0 +1,64 @@
+<testcase>
+<info>
+<keywords>
+FTPS
+PASV
+LIST
+CCC
+FAILURE
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+# When doing LIST, we get the default list output hard-coded in the test
+# FTPS server
+<datacheck>
+total 20
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
+drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
+-r--r--r-- 1 0 1 35 Jul 16 1996 README
+lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
+dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
+drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
+dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
+drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
+dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+SSL
+</features>
+<server>
+ftps
+</server>
+ <name>
+FTPS with CCC not supported by server
+ </name>
+ <command>
+-k --ftp-ssl-control --ftp-ssl-ccc ftps://%HOSTIP:%FTPSPORT/
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PBSZ 0
+PROT C
+CCC
+PWD
+EPSV
+TYPE A
+LIST
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test404 b/tests/data/test404
new file mode 100644
index 000000000..97666302b
--- /dev/null
+++ b/tests/data/test404
@@ -0,0 +1,31 @@
+<testcase>
+<info>
+<keywords>
+FTPS
+FAILURE
+</keywords>
+</info>
+
+# Client-side
+<client>
+<features>
+SSL
+</features>
+<server>
+ftps
+</server>
+ <name>
+FTPS with invalid cacert
+ </name>
+ <command>
+--ftp-ssl-control --cacert moooo ftps://%HOSTIP:%FTPSPORT/
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+77
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test405 b/tests/data/test405
new file mode 100644
index 000000000..29e7af28e
--- /dev/null
+++ b/tests/data/test405
@@ -0,0 +1,34 @@
+<testcase>
+<info>
+<keywords>
+FTPS
+FAILURE
+</keywords>
+</info>
+
+# Client-side
+<client>
+<features>
+SSL
+</features>
+<server>
+ftp
+</server>
+ <name>
+FTPS operation to FTP port
+ </name>
+ <command>
+-m 5 -k ftps://%HOSTIP:%FTPPORT/path/to/file/405
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+# error code 35 is CURLE_SSL_CONNECT_ERROR
+# GnuTLS seems to not fail on its handshake but instead times out which gives
+# error 28
+<errorcode>
+35,28
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test406 b/tests/data/test406
new file mode 100644
index 000000000..3259bc6ae
--- /dev/null
+++ b/tests/data/test406
@@ -0,0 +1,66 @@
+<testcase>
+<info>
+<keywords>
+FTPS
+PORT
+LIST
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+# When doing LIST, we get the default list output hard-coded in the test
+# FTPS server
+<datacheck>
+total 20
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
+drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
+-r--r--r-- 1 0 1 35 Jul 16 1996 README
+lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
+dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
+drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
+dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
+drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
+dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+SSL
+</features>
+<server>
+ftps
+</server>
+ <name>
+FTPS dir list, PORT with specified IP
+ </name>
+ <command>
+-k --ftp-ssl-control -P %CLIENTIP ftps://%HOSTIP:%FTPSPORT/
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+# Strip all valid kinds of PORT and EPRT that curl can send
+<strip>
+^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
+^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
+</strip>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PBSZ 0
+PROT C
+PWD
+PORT 127,0,0,1,243,212
+TYPE A
+LIST
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test407 b/tests/data/test407
new file mode 100644
index 000000000..8c14fa846
--- /dev/null
+++ b/tests/data/test407
@@ -0,0 +1,59 @@
+<testcase>
+<info>
+<keywords>
+FTPS
+PASV
+RETR
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+data blobb
+</data>
+
+# data is sent to stdout
+</reply>
+
+# Client-side
+<client>
+<features>
+SSL
+</features>
+<server>
+ftps
+</server>
+ <name>
+Get two FTPS files from the same remote dir: no second CWD
+ </name>
+ <command>
+-k --ftp-ssl-control ftps://%HOSTIP:%FTPSPORT/a/path/407 ftps://%HOSTIP:%FTPSPORT/a/path/407
+</command>
+<stdout>
+data blobb
+data blobb
+</stdout>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PBSZ 0
+PROT C
+PWD
+CWD a
+CWD path
+EPSV
+TYPE I
+SIZE 407
+RETR 407
+EPSV
+SIZE 407
+RETR 407
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test408 b/tests/data/test408
new file mode 100644
index 000000000..d0aa13b8a
--- /dev/null
+++ b/tests/data/test408
@@ -0,0 +1,61 @@
+<testcase>
+<info>
+<keywords>
+FTPS
+PORT
+STOR
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+</data>
+</reply>
+
+# Client-side
+<client>
+<features>
+SSL
+</features>
+<server>
+ftps
+</server>
+ <name>
+FTPS PORT upload with CWD
+ </name>
+ <command>
+-k --ftp-ssl-control ftps://%HOSTIP:%FTPSPORT/CWD/STOR/RETR/408 -T log/upload408 -P -
+</command>
+<file name="log/upload408">
+Moooooooooooo
+ upload this
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+# Strip all valid kinds of PORT and EPRT that curl can send
+<strip>
+^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
+^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
+</strip>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PBSZ 0
+PROT C
+PWD
+CWD CWD
+CWD STOR
+CWD RETR
+PORT 127,0,0,1,5,109
+TYPE I
+STOR 408
+QUIT
+</protocol>
+<upload>
+Moooooooooooo
+ upload this
+</upload>
+</verify>
+</testcase>
diff --git a/tests/data/test409 b/tests/data/test409
new file mode 100644
index 000000000..d7801a841
--- /dev/null
+++ b/tests/data/test409
@@ -0,0 +1,56 @@
+<testcase>
+<info>
+<keywords>
+FTPS
+EPSV
+STOR
+</keywords>
+</info>
+
+# Client-side
+<client>
+<features>
+SSL
+</features>
+<server>
+ftps
+</server>
+ <name>
+FTPS PASV upload file
+ </name>
+<file name="log/test409.txt">
+data
+ to
+ see
+that FTP
+works
+ so does it?
+</file>
+ <command>
+-k --ftp-ssl-control ftps://%HOSTIP:%FTPSPORT/409 -T log/test409.txt
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<upload>
+data
+ to
+ see
+that FTP
+works
+ so does it?
+</upload>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PBSZ 0
+PROT C
+PWD
+EPSV
+TYPE I
+STOR 409
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test41 b/tests/data/test41
new file mode 100644
index 000000000..08eca38c9
--- /dev/null
+++ b/tests/data/test41
@@ -0,0 +1,32 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP FORMPOST
+FAILURE
+</keywords>
+</info>
+# Server-side
+<reply>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP formpost with missing file
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/want/41 -F moo=@boo
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+26
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test42 b/tests/data/test42
new file mode 100644
index 000000000..ec6742600
--- /dev/null
+++ b/tests/data/test42
@@ -0,0 +1,74 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+followlocation
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 302 OK swsclose
+Location: ../m o o.html/420002
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+
+</data>
+<data2>
+HTTP/1.1 200 OK swsclose
+Location: this should be ignored
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+
+body
+</data2>
+<datacheck>
+HTTP/1.1 302 OK swsclose
+Location: ../m o o.html/420002
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+
+HTTP/1.1 200 OK swsclose
+Location: this should be ignored
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+
+body
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP redirect with whitespace in path (and conversion)
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/are/all/twits/42 -L
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /we/are/all/twits/42 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /we/are/all/m%20o%20o.html/420002 HTTP/1.1
+User-Agent: curl/7.10 (i686-pc-linux-gnu) libcurl/7.10 OpenSSL/0.9.6c ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test43 b/tests/data/test43
new file mode 100644
index 000000000..e5535bb3a
--- /dev/null
+++ b/tests/data/test43
@@ -0,0 +1,79 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+followlocation
+HTTP proxy
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 301 This is a weirdo text message
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Location: data/430002.txt?coolsite=yes
+Connection: close
+
+This server reply is for testing a simple Location: following
+
+</data>
+<data2>
+HTTP/1.1 200 Followed here fine swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 52
+
+If this is received, the location following worked
+
+</data2>
+<datacheck>
+HTTP/1.1 301 This is a weirdo text message
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Location: data/430002.txt?coolsite=yes
+Connection: close
+
+HTTP/1.1 200 Followed here fine swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 52
+
+If this is received, the location following worked
+
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP Location: following over HTTP proxy
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/want/43 -L -x %HOSTIP:%HTTPPORT
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET http://%HOSTIP:%HTTPPORT/want/43 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+GET http://%HOSTIP:%HTTPPORT/want/data/430002.txt?coolsite=yes HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test44 b/tests/data/test44
new file mode 100644
index 000000000..8220a1aa1
--- /dev/null
+++ b/tests/data/test44
@@ -0,0 +1,72 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP FORMPOST
+HTTP replaced headers
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.0 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+
+blablabla
+
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP RFC1867-type formposting without Expect: header
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/want/44 -F name=daniel -F tool=curl -F file=@log/test44.txt -H "Expect:"
+</command>
+# We create this file before the command is invoked!
+<file name="log/test44.txt">
+foo-
+This is a moo-
+bar
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^(User-Agent:|Content-Type: multipart/form-data;|------).*
+</strip>
+<protocol>
+POST /we/want/44 HTTP/1.1
+User-Agent: curl/7.10.4 (i686-pc-linux-gnu) libcurl/7.10.4 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 408
+Content-Type: multipart/form-data; boundary=----------------------------7c633d5c27ce
+
+------------------------------7c633d5c27ce
+Content-Disposition: form-data; name="name"
+
+daniel
+------------------------------7c633d5c27ce
+Content-Disposition: form-data; name="tool"
+
+curl
+------------------------------7c633d5c27ce
+Content-Disposition: form-data; name="file"; filename="test44.txt"
+Content-Type: text/plain
+
+foo-
+This is a moo-
+bar
+
+------------------------------7c633d5c27ce--
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test45 b/tests/data/test45
new file mode 100644
index 000000000..3eb9ba943
--- /dev/null
+++ b/tests/data/test45
@@ -0,0 +1,76 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+followlocation
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 301 This is a weirdo text message swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Location: data.cgi?moo=http://&/450002
+Connection: close
+
+This server reply is for testing a simple Location: following
+
+</data>
+<data2>
+HTTP/1.1 200 Followed here fine swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 52
+
+If this is received, the location following worked
+
+</data2>
+<datacheck>
+HTTP/1.1 301 This is a weirdo text message swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Location: data.cgi?moo=http://&/450002
+Connection: close
+
+HTTP/1.1 200 Followed here fine swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 52
+
+If this is received, the location following worked
+
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+simple HTTP Location: without protocol in initial URL
+ </name>
+ <command>
+%HOSTIP:%HTTPPORT/want/45 -L
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /want/45 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /want/data.cgi?moo=http://&/450002 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test46 b/tests/data/test46
new file mode 100644
index 000000000..d0d193033
--- /dev/null
+++ b/tests/data/test46
@@ -0,0 +1,89 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+cookies
+cookiejar
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Server: Microsoft-IIS/4.0
+Date: Tue, 25 Sep 2001 19:37:44 GMT
+Content-Type: text/html
+Set-Cookie: ckyPersistent=permanent; expires=Fri, 02-Feb-2035 11:56:27 GMT; path=/
+Set-Cookie: ckySession=temporary; path=/
+Set-Cookie: ASPSESSIONIDQGGQQSJJ=GKNBDIFAAOFDPDAIEAKDIBKE; path=/
+Set-Cookie: justaname=; path=/;
+Set-Cookie: simplyhuge=zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz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zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
+Cache-control: private
+Content-Length: 41
+
+This server reply is for testing cookies
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP, get cookies and store in cookie jar
+ </name>
+# Explicitly set the time zone to a known good one, in case the user is
+# using one of the 'right' zones that take into account leap seconds
+# which causes the cookie expiry times to be different from what we expect.
+<setenv>
+TZ=GMT
+</setenv>
+ <command>
+%HOSTIP:%HTTPPORT/want/46 -c log/jar46 -b log/injar46
+</command>
+<file name="log/injar46">
+# Netscape HTTP Cookie File
+# http://curl.haxx.se/rfc/cookie_spec.html
+# This is generated by libcurl! Do not edit.
+
+www.fake.come FALSE / FALSE 1022144953 cookiecliente si
+www.loser.com FALSE / FALSE 1139150993 UID 99
+%HOSTIP FALSE / FALSE 1439150993 mooo indeed
+#HttpOnly_%HOSTIP FALSE / FALSE 1439150993 mooo2 indeed2
+%HOSTIP FALSE / FALSE 0 empty
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /want/46 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Cookie: empty=; mooo2=indeed2; mooo=indeed
+
+</protocol>
+<file name="log/jar46" mode="text">
+# Netscape HTTP Cookie File
+# http://curl.haxx.se/rfc/cookie_spec.html
+# This file was generated by libcurl! Edit at your own risk.
+
+www.fake.come FALSE / FALSE 1022144953 cookiecliente si
+www.loser.com FALSE / FALSE 1139150993 UID 99
+%HOSTIP FALSE / FALSE 1439150993 mooo indeed
+#HttpOnly_%HOSTIP FALSE / FALSE 1439150993 mooo2 indeed2
+%HOSTIP FALSE / FALSE 0 empty
+%HOSTIP FALSE / FALSE 2054030187 ckyPersistent permanent
+%HOSTIP FALSE / FALSE 0 ckySession temporary
+%HOSTIP FALSE / FALSE 0 ASPSESSIONIDQGGQQSJJ GKNBDIFAAOFDPDAIEAKDIBKE
+%HOSTIP FALSE / FALSE 0 justaname
+%HOSTIP FALSE /want/ FALSE 0 simplyhuge zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz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zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
+</file>
+</verify>
+</testcase>
diff --git a/tests/data/test47 b/tests/data/test47
new file mode 100644
index 000000000..0a6d4da3b
--- /dev/null
+++ b/tests/data/test47
@@ -0,0 +1,49 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP/1.0
+</keywords>
+</info>
+#
+# Server-side
+<reply name="47">
+<data>
+HTTP/1.0 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+
+-foo- within foo -!foo-
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+simple HTTP 1.0 GET
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/47 -0
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /47 HTTP/1.0
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+
+</testcase>
diff --git a/tests/data/test48 b/tests/data/test48
new file mode 100644
index 000000000..e092b41e3
--- /dev/null
+++ b/tests/data/test48
@@ -0,0 +1,47 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP HEAD
+-G
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP with -d and -G and -I
+ </name>
+ <command>
+-d "foo=moo&moo=poo" http://%HOSTIP:%HTTPPORT/48 -G -I
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+HEAD /48?foo=moo&moo=poo HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test49 b/tests/data/test49
new file mode 100644
index 000000000..4a4175e32
--- /dev/null
+++ b/tests/data/test49
@@ -0,0 +1,74 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+followlocation
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 302 OK swsclose
+Location: ../moo.html/490002
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+
+</data>
+<data2>
+HTTP/1.1 200 OK swsclose
+Location: this should be ignored
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+
+body
+</data2>
+<datacheck>
+HTTP/1.1 302 OK swsclose
+Location: ../moo.html/490002
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+
+HTTP/1.1 200 OK swsclose
+Location: this should be ignored
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+
+body
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP follow redirect with ../
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/are/all/twits/49 -L
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /we/are/all/twits/49 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /we/are/all/moo.html/490002 HTTP/1.1
+User-Agent: curl/7.10 (i686-pc-linux-gnu) libcurl/7.10 OpenSSL/0.9.6c ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test5 b/tests/data/test5
new file mode 100644
index 000000000..7a0ebd730
--- /dev/null
+++ b/tests/data/test5
@@ -0,0 +1,50 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP proxy
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/html
+Funny-head: yesyes
+
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP over proxy
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/want/that/page/5 -x %HOSTIP:%HTTPPORT
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET http://%HOSTIP:%HTTPPORT/we/want/that/page/5 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test50 b/tests/data/test50
new file mode 100644
index 000000000..84b05da7b
--- /dev/null
+++ b/tests/data/test50
@@ -0,0 +1,74 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+followlocation
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 302 OK swsclose
+Location: ../../moo.html/500002
+Date: Thu, 09 Nov 2010 14:50:00 GMT
+Connection: close
+
+</data>
+<data2>
+HTTP/1.1 200 OK swsclose
+Location: this should be ignored
+Date: Thu, 09 Nov 2010 14:50:00 GMT
+Connection: close
+
+body
+</data2>
+<datacheck>
+HTTP/1.1 302 OK swsclose
+Location: ../../moo.html/500002
+Date: Thu, 09 Nov 2010 14:50:00 GMT
+Connection: close
+
+HTTP/1.1 200 OK swsclose
+Location: this should be ignored
+Date: Thu, 09 Nov 2010 14:50:00 GMT
+Connection: close
+
+body
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP follow redirect with ../../
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/are/all/twits/50 -L
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /we/are/all/twits/50 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /we/are/moo.html/500002 HTTP/1.1
+User-Agent: curl/7.10 (i686-pc-linux-gnu) libcurl/7.10 OpenSSL/0.9.6c ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test500 b/tests/data/test500
new file mode 100644
index 000000000..f9b17f37c
--- /dev/null
+++ b/tests/data/test500
@@ -0,0 +1,58 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+#
+# Server-side
+<reply name="1">
+<data mode="text">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+-foo-
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+# tool is what to use instead of 'curl'
+<tool>
+lib500
+</tool>
+
+ <name>
+simple libcurl HTTP GET tool
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/500 log/ip500
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<file name="log/ip500" mode="text">
+IP: %HOSTIP
+</file>
+<protocol>
+GET /500 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test501 b/tests/data/test501
new file mode 100644
index 000000000..9c9dcc9e3
--- /dev/null
+++ b/tests/data/test501
@@ -0,0 +1,40 @@
+<testcase>
+<info>
+<keywords>
+missing URL
+</keywords>
+</info>
+#
+# Server-side
+<reply name="1">
+</reply>
+
+# Client-side
+<client>
+<server>
+none
+</server>
+<features>
+http
+</features>
+# tool is what to use instead of 'curl'
+<tool>
+lib501
+</tool>
+
+ <name>
+simple libcurl attempt operation without URL set
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/501
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+3
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test502 b/tests/data/test502
new file mode 100644
index 000000000..f73a4eb30
--- /dev/null
+++ b/tests/data/test502
@@ -0,0 +1,47 @@
+<testcase>
+<info>
+<keywords>
+FILE
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data mode="text">
+foo
+ bar swsclose
+bar
+ foo
+moo
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+file
+</server>
+# tool is what to use instead of 'curl'
+<tool>
+lib502
+</tool>
+
+ <name>
+simple multi file:// get
+ </name>
+ <command>
+file://%PWD/log/test502.txt
+</command>
+<file name="log/test502.txt">
+foo
+ bar swsclose
+bar
+ foo
+moo
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+</verify>
+</testcase>
diff --git a/tests/data/test503 b/tests/data/test503
new file mode 100644
index 000000000..3f29d8f6e
--- /dev/null
+++ b/tests/data/test503
@@ -0,0 +1,76 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP CONNECT
+HTTP proxy
+HTTP proxy Basic auth
+proxytunnel
+multi
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+
+</data>
+<datacheck>
+HTTP/1.1 200 Mighty fine indeed
+
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+# tool is what to use instead of 'curl'
+<tool>
+lib503
+</tool>
+
+ <name>
+simple multi http:// through proxytunnel with authentication info
+ </name>
+ <command>
+http://%HOSTIP:%HTTPSPORT/503 %HOSTIP:%HTTPPORT
+</command>
+<file name="log/test503.txt">
+foo
+ bar
+bar
+ foo
+moo
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+CONNECT %HOSTIP:%HTTPSPORT HTTP/1.1
+Host: %HOSTIP:%HTTPSPORT
+Proxy-Authorization: Basic dGVzdDppbmc=
+Proxy-Connection: Keep-Alive
+
+GET /503 HTTP/1.1
+Authorization: Basic dGVzdDppbmc=
+Host: %HOSTIP:%HTTPSPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test504 b/tests/data/test504
new file mode 100644
index 000000000..573ab51c7
--- /dev/null
+++ b/tests/data/test504
@@ -0,0 +1,43 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP proxy
+multi
+FAILURE
+</keywords>
+</info>
+
+# Server-side
+<reply>
+</reply>
+
+# Client-side
+<client>
+<server>
+none
+</server>
+<features>
+http
+</features>
+# tool is what to use instead of 'curl'
+<tool>
+lib504
+</tool>
+
+ <name>
+simple multi through local proxy without listener
+ </name>
+ <command>
+http://%HOSTIP:%HTTPSPORT/504 %HOSTIP:55555
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+100
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test505 b/tests/data/test505
new file mode 100644
index 000000000..d9e0fd297
--- /dev/null
+++ b/tests/data/test505
@@ -0,0 +1,60 @@
+<testcase>
+# Server-side
+<reply>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+# tool is what to use instead of 'curl'
+<tool>
+lib505
+</tool>
+
+ <name>
+FTP upload with rename after transfer
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/505 log/upload505
+</command>
+<file name="log/upload505">
+Contents
+of
+a file
+to verify
+ftp
+upload
+
+
+works?
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<upload>
+Contents
+of
+a file
+to verify
+ftp
+upload
+
+
+works?
+</upload>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE I
+STOR 505
+RNFR 505
+RNTO 505-forreal
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test506 b/tests/data/test506
new file mode 100644
index 000000000..64eb6c9c9
--- /dev/null
+++ b/tests/data/test506
@@ -0,0 +1,181 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+cookies
+shared cookies
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data1>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Type: text/html
+Set-Cookie: test1=one; domain=foo.com; expires=Sat Feb 2 11:56:27 GMT 2030
+Set-Cookie: test2=two; domain=host.foo.com; expires=Sat Feb 2 11:56:27 GMT 2030
+Set-Cookie: test3=three; domain=foo.com; expires=Sat Feb 2 11:56:27 GMT 2030
+Content-Length: 29
+
+run 1: set cookie 1, 2 and 3
+</data1>
+<data2>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:01 GMT
+Server: test-server/fake
+Content-Type: text/html
+Set-Cookie: test4=four; domain=host.foo.com; expires=Sat Feb 2 11:56:27 GMT 2030
+Set-Cookie: test5=five; domain=host.foo.com; expires=Sat Feb 2 11:56:27 GMT 2030
+Content-Length: 26
+
+run 2: set cookie 4 and 5
+</data2>
+<data3>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:02 GMT
+Server: test-server/fake
+Content-Type: text/html
+Funny-head: yesyes
+Set-Cookie: test4=overwritten4; domain=host.foo.com; expires=Sat May 5 GMT 11:56:27 2035
+Set-Cookie: test1=overwritten1; domain=foo.com; expires=Thu Mar 3 GMT 11:56:27 2033
+Content-Type: text/html
+Content-Length: 32
+
+run 3: overwrite cookie 1 and 4
+</data3>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<name>
+HTTP with shared cookie list (and dns cache)
+</name>
+# Explicitly set the time zone to a known good one, in case the user is
+# using one of the 'right' zones that take into account leap seconds
+# which causes the cookie expiry times to be different.
+<setenv>
+TZ=GMT
+</setenv>
+<tool>
+lib506
+</tool>
+<command>
+http://%HOSTIP:%HTTPPORT/506
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<stdout mode="text">
+GLOBAL_INIT
+SHARE_INIT
+CURLSHOPT_LOCKFUNC
+CURLSHOPT_UNLOCKFUNC
+CURLSHOPT_USERDATA
+CURL_LOCK_DATA_COOKIE
+CURL_LOCK_DATA_DNS
+*** run 1
+CURLOPT_SHARE
+lock: share [Pigs in space]: 0
+unlock: share [Pigs in space]: 1
+PERFORM
+lock: dns [Pigs in space]: 2
+unlock: dns [Pigs in space]: 3
+lock: dns [Pigs in space]: 4
+unlock: dns [Pigs in space]: 5
+lock: cookie [Pigs in space]: 6
+unlock: cookie [Pigs in space]: 7
+lock: cookie [Pigs in space]: 8
+unlock: cookie [Pigs in space]: 9
+lock: cookie [Pigs in space]: 10
+unlock: cookie [Pigs in space]: 11
+lock: cookie [Pigs in space]: 12
+unlock: cookie [Pigs in space]: 13
+run 1: set cookie 1, 2 and 3
+lock: dns [Pigs in space]: 14
+unlock: dns [Pigs in space]: 15
+CLEANUP
+lock: dns [Pigs in space]: 16
+unlock: dns [Pigs in space]: 17
+lock: cookie [Pigs in space]: 18
+unlock: cookie [Pigs in space]: 19
+lock: share [Pigs in space]: 20
+unlock: share [Pigs in space]: 21
+*** run 2
+CURLOPT_SHARE
+lock: share [Pigs in space]: 22
+unlock: share [Pigs in space]: 23
+PERFORM
+lock: dns [Pigs in space]: 24
+unlock: dns [Pigs in space]: 25
+lock: cookie [Pigs in space]: 26
+unlock: cookie [Pigs in space]: 27
+lock: cookie [Pigs in space]: 28
+unlock: cookie [Pigs in space]: 29
+lock: cookie [Pigs in space]: 30
+unlock: cookie [Pigs in space]: 31
+run 2: set cookie 4 and 5
+lock: dns [Pigs in space]: 32
+unlock: dns [Pigs in space]: 33
+CLEANUP
+lock: dns [Pigs in space]: 34
+unlock: dns [Pigs in space]: 35
+lock: cookie [Pigs in space]: 36
+unlock: cookie [Pigs in space]: 37
+lock: share [Pigs in space]: 38
+unlock: share [Pigs in space]: 39
+*** run 3
+CURLOPT_SHARE
+lock: share [Pigs in space]: 40
+unlock: share [Pigs in space]: 41
+CURLOPT_COOKIEJAR
+PERFORM
+lock: dns [Pigs in space]: 42
+unlock: dns [Pigs in space]: 43
+lock: cookie [Pigs in space]: 44
+unlock: cookie [Pigs in space]: 45
+lock: cookie [Pigs in space]: 46
+unlock: cookie [Pigs in space]: 47
+lock: cookie [Pigs in space]: 48
+unlock: cookie [Pigs in space]: 49
+run 3: overwrite cookie 1 and 4
+lock: dns [Pigs in space]: 50
+unlock: dns [Pigs in space]: 51
+try SHARE_CLEANUP...
+lock: share [Pigs in space]: 52
+unlock: share [Pigs in space]: 53
+SHARE_CLEANUP failed, correct
+CLEANUP
+lock: dns [Pigs in space]: 54
+unlock: dns [Pigs in space]: 55
+lock: cookie [Pigs in space]: 56
+unlock: cookie [Pigs in space]: 57
+lock: share [Pigs in space]: 58
+unlock: share [Pigs in space]: 59
+SHARE_CLEANUP
+lock: share [Pigs in space]: 60
+unlock: share [Pigs in space]: 61
+GLOBAL_CLEANUP
+</stdout>
+<stderr>
+http://%HOSTIP:%HTTPPORT/506
+</stderr>
+<file name="log/jar506" mode="text">
+# Netscape HTTP Cookie File
+# http://curl.haxx.se/rfc/cookie_spec.html
+# This file was generated by libcurl! Edit at your own risk.
+
+.foo.com TRUE / FALSE 1993463787 test1 overwritten1
+.host.foo.com TRUE / FALSE 1896263787 test2 two
+.foo.com TRUE / FALSE 1896263787 test3 three
+.host.foo.com TRUE / FALSE 2061978987 test4 overwritten4
+.host.foo.com TRUE / FALSE 1896263787 test5 five
+</file>
+</verify>
+</testcase>
diff --git a/tests/data/test507 b/tests/data/test507
new file mode 100644
index 000000000..9549bd986
--- /dev/null
+++ b/tests/data/test507
@@ -0,0 +1,37 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+multi
+FAILURE
+non-existing host
+</keywords>
+</info>
+
+# Server-side
+<reply>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<name>
+multi interface get with non-existing host name
+</name>
+<tool>
+lib507
+</tool>
+<command>
+http://non-existing-host.haxx.se/
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+6
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test508 b/tests/data/test508
new file mode 100644
index 000000000..5cd4b8c34
--- /dev/null
+++ b/tests/data/test508
@@ -0,0 +1,51 @@
+<testcase>
+#
+# Server-side
+<reply>
+<data mode="text">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Connection: close
+Content-Type: text/html
+
+hello
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+# tool is what to use instead of 'curl'
+<tool>
+lib508
+</tool>
+
+ <name>
+send HTTP POST using read callback
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/508
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strippart>
+# remove CR that CURLOPT_TRANSFERTEXT added, when CharConv enabled:
+s/^(this is what we post to the silly web server)\r\n/$1\n/ if($has_charconv)
+</strippart>
+<protocol>
+POST /508 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 45
+Content-Type: application/x-www-form-urlencoded
+
+this is what we post to the silly web server
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test51 b/tests/data/test51
new file mode 100644
index 000000000..b58c3570e
--- /dev/null
+++ b/tests/data/test51
@@ -0,0 +1,74 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+followlocation
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 302 OK swsclose
+Location: ../../../../../../../510002
+Date: Thu, 09 Nov 2010 14:50:00 GMT
+Connection: close
+
+</data>
+<data2>
+HTTP/1.1 200 OK swsclose
+Location: this should be ignored
+Date: Thu, 09 Nov 2010 14:50:00 GMT
+Connection: close
+
+body
+</data2>
+<datacheck>
+HTTP/1.1 302 OK swsclose
+Location: ../../../../../../../510002
+Date: Thu, 09 Nov 2010 14:50:00 GMT
+Connection: close
+
+HTTP/1.1 200 OK swsclose
+Location: this should be ignored
+Date: Thu, 09 Nov 2010 14:50:00 GMT
+Connection: close
+
+body
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP follow redirect with excessive ../
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/are/all/twits/51 -L
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /we/are/all/twits/51 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /510002 HTTP/1.1
+User-Agent: curl/7.10 (i686-pc-linux-gnu) libcurl/7.10 OpenSSL/0.9.6c ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test510 b/tests/data/test510
new file mode 100644
index 000000000..8313f51c3
--- /dev/null
+++ b/tests/data/test510
@@ -0,0 +1,57 @@
+<testcase>
+#
+# Server-side
+<reply>
+<data mode="text">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Connection: close
+Content-Type: text/html
+
+hello
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+# tool is what to use instead of 'curl'
+<tool>
+lib510
+</tool>
+
+ <name>
+send HTTP POST using read callback, using chunked transfer-encoding
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/510
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+POST /510 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Transfer-Encoding: chunked
+Content-Type: application/x-www-form-urlencoded
+Expect: 100-continue
+
+3
+one
+3
+two
+5
+three
+1d
+and a final longer crap: four
+0
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test511 b/tests/data/test511
new file mode 100644
index 000000000..81fe657f9
--- /dev/null
+++ b/tests/data/test511
@@ -0,0 +1,44 @@
+<testcase>
+#
+# Server-side
+<reply>
+<servercmd>
+REPLY MDTM 550 bluah you f00l!
+REPLY SIZE 550 bluah you f00l!
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+# tool is what to use instead of 'curl'
+<tool>
+lib511
+</tool>
+
+ <name>
+FTP with FILETIME and NOBODY but missing file
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/511
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+# CURLE_FTP_COULDNT_RETR_FILE
+<errorcode>
+19
+</errorcode>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+MDTM 511
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test512 b/tests/data/test512
new file mode 100644
index 000000000..516a50388
--- /dev/null
+++ b/tests/data/test512
@@ -0,0 +1,46 @@
+<testcase>
+#
+# Server-side
+<reply>
+<data mode="text">
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: yes
+Connection: close
+
+hello
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+# tool is what to use instead of 'curl'
+<tool>
+lib512
+</tool>
+
+ <name>
+simple curl_easy_duplicate() test
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/512
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /512 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test513 b/tests/data/test513
new file mode 100644
index 000000000..7d8e69b87
--- /dev/null
+++ b/tests/data/test513
@@ -0,0 +1,42 @@
+<testcase>
+#
+# Server-side
+<reply>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+# tool is what to use instead of 'curl'
+<tool>
+lib513
+</tool>
+
+ <name>
+send HTTP POST using read callback that returns CURL_READFUNC_ABORT
+ </name>
+# the 1s post-command delay helps to prevent a spurious failure on s390
+ <command delay="1">
+http://%HOSTIP:%HTTPPORT/513
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+POST /513 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 1
+Content-Type: application/x-www-form-urlencoded
+
+</protocol>
+# 42 - aborted by callback
+<errorcode>
+42
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test514 b/tests/data/test514
new file mode 100644
index 000000000..bd6da02db
--- /dev/null
+++ b/tests/data/test514
@@ -0,0 +1,51 @@
+<testcase>
+#
+# Server-side
+<reply>
+<data mode="text">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+<tool>
+lib514
+</tool>
+ <name>
+First set options to POST and then to make HEAD
+ </name>
+# the 1s post-command delay helps to prevent a spurious failure on s390
+ <command delay="1">
+http://%HOSTIP:%HTTPPORT/514
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+HEAD /514 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test515 b/tests/data/test515
new file mode 100644
index 000000000..9de0ac2b9
--- /dev/null
+++ b/tests/data/test515
@@ -0,0 +1,48 @@
+<testcase>
+#
+# Server-side
+<reply>
+<data mode="text">
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 3
+
+OK
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+# tool is what to use instead of 'curl'
+<tool>
+lib515
+</tool>
+
+ <name>
+make a POSTFIELDS set to NULL with POSTFIELDSIZE set to zero
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/515
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+POST /515 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 0
+Content-Type: application/x-www-form-urlencoded
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test516 b/tests/data/test516
new file mode 100644
index 000000000..22c39dc5e
--- /dev/null
+++ b/tests/data/test516
@@ -0,0 +1,47 @@
+<testcase>
+#
+# Server-side
+<reply>
+<data mode="text">
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 3
+
+OK
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+# tool is what to use instead of 'curl'
+<tool>
+lib516
+</tool>
+
+ <name>
+make a HTTPPOST set to NULL
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/516
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+POST /516 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 0
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test517 b/tests/data/test517
new file mode 100644
index 000000000..d7b91842c
--- /dev/null
+++ b/tests/data/test517
@@ -0,0 +1,117 @@
+<testcase>
+#
+# Server-side
+<reply>
+</reply>
+
+# Client-side
+<client>
+<server>
+none
+</server>
+# tool is what to use instead of 'curl'
+<tool>
+lib517
+</tool>
+
+ <name>
+curl_getdate() testing
+ </name>
+ <command>
+nothing
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<stdout mode="text">
+0: Sun, 06 Nov 1994 08:49:37 GMT => 784111777
+1: Sunday, 06-Nov-94 08:49:37 GMT => 784111777
+2: Sun Nov 6 08:49:37 1994 => 784111777
+3: 06 Nov 1994 08:49:37 GMT => 784111777
+4: 06-Nov-94 08:49:37 GMT => 784111777
+5: Nov 6 08:49:37 1994 => 784111777
+6: 06 Nov 1994 08:49:37 => 784111777
+7: 06-Nov-94 08:49:37 => 784111777
+8: 1994 Nov 6 08:49:37 => 784111777
+9: GMT 08:49:37 06-Nov-94 Sunday => 784111777
+10: 94 6 Nov 08:49:37 => 784111777
+11: 1994 Nov 6 => 784080000
+12: 06-Nov-94 => 784080000
+13: Sun Nov 6 94 => 784080000
+14: 1994.Nov.6 => 784080000
+15: Sun/Nov/6/94/GMT => 784080000
+16: Sun, 06 Nov 1994 08:49:37 CET => 784108177
+17: 06 Nov 1994 08:49:37 EST => 784129777
+18: Sun, 12 Sep 2004 15:05:58 -0700 => 1095026758
+19: Sat, 11 Sep 2004 21:32:11 +0200 => 1094931131
+20: 20040912 15:05:58 -0700 => 1095026758
+21: 20040911 +0200 => 1094853600
+22: Thu, 01-Jan-1970 00:59:59 GMT => 3599
+23: Thu, 01-Jan-1970 01:00:00 GMT => 3600
+24: Sat, 15-Apr-17 21:01:22 GMT => 1492290082
+25: Thu, 19-Apr-2007 16:00:00 GMT => 1176998400
+26: Wed, 25 Apr 2007 21:02:13 GMT => 1177534933
+27: Thu, 19/Apr\2007 16:00:00 GMT => 1176998400
+28: Fri, 1 Jan 2010 01:01:50 GMT => 1262307710
+29: Wednesday, 1-Jan-2003 00:00:00 GMT => 1041379200
+30: , 1-Jan-2003 00:00:00 GMT => 1041379200
+31: 1-Jan-2003 00:00:00 GMT => 1041379200
+32: 1-Jan-2003 00:00:00 GMT => 1041379200
+33: Wed,18-Apr-07 22:50:12 GMT => 1176936612
+34: WillyWonka , 18-Apr-07 22:50:12 GMT => -1
+35: WillyWonka , 18-Apr-07 22:50:12 => -1
+36: WillyWonka , 18-apr-07 22:50:12 => -1
+37: Mon, 18-Apr-1977 22:50:13 GMT => 230251813
+38: Mon, 18-Apr-77 22:50:13 GMT => 230251813
+39: "Sat, 15-Apr-17\"21:01:22\"GMT" => 1492290082
+40: Partyday, 18- April-07 22:50:12 => -1
+41: Partyday, 18 - Apri-07 22:50:12 => -1
+42: Wednes, 1-Januar-2003 00:00:00 GMT => -1
+43: Sat, 15-Apr-17 21:01:22 => 1492290082
+44: Sat, 15-Apr-17 21:01:22 GMT-2 => 1492290082
+45: Sat, 15-Apr-17 21:01:22 GMT BLAH => 1492290082
+46: Sat, 15-Apr-17 21:01:22 GMT-0400 => 1492290082
+47: Sat, 15-Apr-17 21:01:22 GMT-0400 (EDT) => 1492290082
+48: Sat, 15-Apr-17 21:01:22 DST => -1
+49: Sat, 15-Apr-17 21:01:22 -0400 => 1492304482
+50: Sat, 15-Apr-17 21:01:22 (hello there) => -1
+51: Sat, 15-Apr-17 21:01:22 11:22:33 => -1
+52: Sat, 15-Apr-17 ::00 21:01:22 => -1
+53: Sat, 15-Apr-17 boink:z 21:01:22 => -1
+54: Sat, 15-Apr-17 91:22:33 21:01:22 => -1
+55: Thu Apr 18 22:50:12 2007 GMT => 1176936612
+56: 22:50:12 Thu Apr 18 2007 GMT => 1176936612
+57: Thu 22:50:12 Apr 18 2007 GMT => 1176936612
+58: Thu Apr 22:50:12 18 2007 GMT => 1176936612
+59: Thu Apr 18 22:50:12 2007 GMT => 1176936612
+60: Thu Apr 18 2007 22:50:12 GMT => 1176936612
+61: Thu Apr 18 2007 GMT 22:50:12 => 1176936612
+62: Sat, 15-Apr-17 21:01:22 GMT => 1492290082
+63: 15-Sat, Apr-17 21:01:22 GMT => 1492290082
+64: 15-Sat, Apr 21:01:22 GMT 17 => 1492290082
+65: 15-Sat, Apr 21:01:22 GMT 2017 => 1492290082
+66: 15 Apr 21:01:22 2017 => 1492290082
+67: 15 17 Apr 21:01:22 => 1492290082
+68: Apr 15 17 21:01:22 => 1492290082
+69: Apr 15 21:01:22 17 => 1492290082
+70: 2017 April 15 21:01:22 => -1
+71: 15 April 2017 21:01:22 => -1
+72: 98 April 17 21:01:22 => -1
+73: Thu, 012-Aug-2008 20:49:07 GMT => 1218574147
+74: Thu, 999999999999-Aug-2007 20:49:07 GMT => -1
+75: Thu, 12-Aug-2007 20:61:99999999999 GMT => -1
+76: IAintNoDateFool => -1
+77: Thu Apr 18 22:50 2007 GMT => 1176936600
+</stdout>
+
+# This test case previously testes an overflow case ("2094 Nov 6 =>
+# 2147483647") for 32bit time_t, but since some systems have 64bit time_t and
+# handles this (returning 3939840000), and some 64bit-time_t systems don't
+# handle this and returns -1 for this, it turned very tricky to write a fine
+# test case and thus it is now removed until we have a way to write test cases
+# for this kind of things.
+
+</verify>
+</testcase>
diff --git a/tests/data/test518 b/tests/data/test518
new file mode 100644
index 000000000..8e52615c5
--- /dev/null
+++ b/tests/data/test518
@@ -0,0 +1,60 @@
+<testcase>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+-foo-
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+getrlimit
+</features>
+# tool is what to use instead of 'curl'
+<tool>
+lib518
+</tool>
+# precheck is a command line to run before the test, to see if we can execute
+# the test or not
+<precheck>
+./libtest/lib518 check
+</precheck>
+
+ <name>
+HTTP GET with more than FD_SETSIZE descriptors open
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/518
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+GET /518 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+<valgrind>
+disable
+</valgrind>
+</verify>
+</testcase>
diff --git a/tests/data/test519 b/tests/data/test519
new file mode 100644
index 000000000..c6bc8615b
--- /dev/null
+++ b/tests/data/test519
@@ -0,0 +1,71 @@
+<testcase>
+#
+# Server-side
+<reply>
+<data mode="text">
+HTTP/1.1 200 OK swsbounce
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 8
+
+content
+</data>
+<data1>
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 9
+
+content2
+</data1>
+<datacheck>
+HTTP/1.1 200 OK swsbounce
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 8
+
+content
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 9
+
+content2
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+# tool is what to use instead of 'curl'
+<tool>
+lib519
+</tool>
+
+ <name>
+GET same URL twice with different users
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/519
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+GET /519 HTTP/1.1
+Authorization: Basic bW9uc3Rlcjp1bmRlcmJlZA==
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /519 HTTP/1.1
+Authorization: Basic YW5vdGhlcm1vbnN0ZXI6aW53YXJkcm9iZQ==
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test52 b/tests/data/test52
new file mode 100644
index 000000000..14fa42bfd
--- /dev/null
+++ b/tests/data/test52
@@ -0,0 +1,74 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+followlocation
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 302 OK swsclose
+Location: ./520002
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+
+</data>
+<data2>
+HTTP/1.1 200 OK swsclose
+Location: this should be ignored
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+
+body
+</data2>
+<datacheck>
+HTTP/1.1 302 OK swsclose
+Location: ./520002
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+
+HTTP/1.1 200 OK swsclose
+Location: this should be ignored
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+
+body
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP follow redirect with ./-prefix
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/are/all/twits/52 -L
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /we/are/all/twits/52 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /we/are/all/twits/520002 HTTP/1.1
+User-Agent: curl/7.10 (i686-pc-linux-gnu) libcurl/7.10 OpenSSL/0.9.6c ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test520 b/tests/data/test520
new file mode 100644
index 000000000..0938b5802
--- /dev/null
+++ b/tests/data/test520
@@ -0,0 +1,47 @@
+<testcase>
+#
+# Server-side
+<reply>
+<data>
+contents of file
+</data>
+<servercmd>
+REPLY MDTM 213 20030405060708
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+# tool is what to use instead of 'curl'
+<tool>
+lib520
+</tool>
+
+ <name>
+FTP RETR with FILETIME
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/520
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+MDTM 520
+EPSV
+TYPE I
+SIZE 520
+RETR 520
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test521 b/tests/data/test521
new file mode 100644
index 000000000..9bc5501f4
--- /dev/null
+++ b/tests/data/test521
@@ -0,0 +1,60 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+CURLOPT_PORT
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+# When doing LIST, we get the default list output hard-coded in the test
+# FTP server
+<datacheck>
+total 20
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
+drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
+-r--r--r-- 1 0 1 35 Jul 16 1996 README
+lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
+dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
+drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
+dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
+drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
+dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+ftp
+</server>
+<tool>
+lib521
+</tool>
+ <name>
+FTP dir list PASV with CURLOPT_PORT
+ </name>
+ <command>
+ftp://%HOSTIP/521/ %FTPPORT
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER xxx
+PASS yyy
+PWD
+CWD 521
+EPSV
+TYPE A
+LIST
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test522 b/tests/data/test522
new file mode 100644
index 000000000..4ac46ff75
--- /dev/null
+++ b/tests/data/test522
@@ -0,0 +1,60 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+CURLOPT_PORT
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+
+hello
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+<tool>
+lib521
+</tool>
+ <name>
+HTTP GET with CURLOPT_PORT
+ </name>
+ <command>
+http://%HOSTIP/522 %HTTPPORT
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /522 HTTP/1.1
+Authorization: Basic eHh4Onl5eQ==
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+<stdout mode="text">
+hello
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test523 b/tests/data/test523
new file mode 100644
index 000000000..6c1efbd5d
--- /dev/null
+++ b/tests/data/test523
@@ -0,0 +1,64 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP proxy
+CURLOPT_PORT
+CURLOPT_PROXY
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+
+hello
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+<tool>
+lib523
+</tool>
+ <name>
+HTTP GET with proxy and CURLOPT_PORT
+ </name>
+# first URL then proxy
+ <command>
+http://www.haxx.se:999/523 http://%HOSTIP:%HTTPPORT
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET HTTP://www.haxx.se:19999/523 HTTP/1.1
+Authorization: Basic eHh4Onl5eQ==
+Host: www.haxx.se:19999
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+<stdout mode="text">
+hello
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test524 b/tests/data/test524
new file mode 100644
index 000000000..c60946672
--- /dev/null
+++ b/tests/data/test524
@@ -0,0 +1,46 @@
+<testcase>
+<info>
+<keywords>
+FTP
+UPLOAD
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+ftp
+</server>
+<tool>
+lib524
+</tool>
+ <name>
+FTP upload with target URL ending with slash
+ </name>
+# first URL then proxy
+ <command>
+ftp://%HOSTIP:%FTPPORT/path/to/
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+</protocol>
+
+# 3 is CURLE_URL_MALFORMAT
+<errorcode>
+3
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test525 b/tests/data/test525
new file mode 100644
index 000000000..7bd494e02
--- /dev/null
+++ b/tests/data/test525
@@ -0,0 +1,59 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PORT
+STOR
+multi
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+<tool>
+lib525
+</tool>
+ <name>
+FTP PORT upload using multi interface
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/path/525 log/upload525
+</command>
+<file name="log/upload525">
+Moooooooooooo
+ upload this
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+# Strip all valid kinds of PORT and EPRT that curl can send
+<strip>
+^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
+^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
+</strip>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD path
+PORT 127,0,0,1,5,109
+TYPE I
+STOR 525
+QUIT
+</protocol>
+<upload>
+Moooooooooooo
+ upload this
+</upload>
+</verify>
+</testcase>
diff --git a/tests/data/test526 b/tests/data/test526
new file mode 100644
index 000000000..70e6dcd12
--- /dev/null
+++ b/tests/data/test526
@@ -0,0 +1,63 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+RETR
+multi
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+file contents should appear once for each file
+</data>
+<datacheck>
+file contents should appear once for each file
+file contents should appear once for each file
+file contents should appear once for each file
+file contents should appear once for each file
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+<tool>
+lib526
+</tool>
+ <name>
+FTP RETR same file using different handles but same connection
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/path/526
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD path
+EPSV
+TYPE I
+SIZE 526
+RETR 526
+EPSV
+SIZE 526
+RETR 526
+EPSV
+SIZE 526
+RETR 526
+EPSV
+SIZE 526
+RETR 526
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test527 b/tests/data/test527
new file mode 100644
index 000000000..98892a97e
--- /dev/null
+++ b/tests/data/test527
@@ -0,0 +1,63 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+RETR
+multi
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+file contents should appear once for each file
+</data>
+<datacheck>
+file contents should appear once for each file
+file contents should appear once for each file
+file contents should appear once for each file
+file contents should appear once for each file
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+<tool>
+lib527
+</tool>
+ <name>
+FTP RETR same file using different handles but same connection
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/path/527
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD path
+EPSV
+TYPE I
+SIZE 527
+RETR 527
+EPSV
+SIZE 527
+RETR 527
+EPSV
+SIZE 527
+RETR 527
+EPSV
+SIZE 527
+RETR 527
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test528 b/tests/data/test528
new file mode 100644
index 000000000..0a55fd3cf
--- /dev/null
+++ b/tests/data/test528
@@ -0,0 +1,65 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+multi
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 47
+
+file contents should appear once for each file
+</data>
+<datacheck>
+file contents should appear once for each file
+file contents should appear once for each file
+file contents should appear once for each file
+file contents should appear once for each file
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<tool>
+lib526
+</tool>
+ <name>
+HTTP GET same file using different handles but same connection
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/path/528
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+GET /path/528 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /path/528 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /path/528 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /path/528 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test529 b/tests/data/test529
new file mode 100644
index 000000000..16147201c
--- /dev/null
+++ b/tests/data/test529
@@ -0,0 +1,59 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PORT
+STOR
+multi
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+<tool>
+lib529
+</tool>
+ <name>
+FTP PORT upload using multi interface (weird cleanup function sequence)
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/path/529 log/upload529
+</command>
+<file name="log/upload529">
+Moooooooooooo
+ upload this
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+# Strip all valid kinds of PORT and EPRT that curl can send
+<strip>
+^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
+^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
+</strip>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD path
+PORT 127,0,0,1,5,109
+TYPE I
+STOR 529
+QUIT
+</protocol>
+<upload>
+Moooooooooooo
+ upload this
+</upload>
+</verify>
+</testcase>
diff --git a/tests/data/test53 b/tests/data/test53
new file mode 100644
index 000000000..0ced2d237
--- /dev/null
+++ b/tests/data/test53
@@ -0,0 +1,54 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+cookies
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Server: Microsoft-IIS/4.0
+Date: Tue, 25 Sep 2001 19:37:44 GMT
+Content-Type: text/html
+Connection: close
+Content-Length: 21
+
+This server says moo
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP, junk session cookies
+ </name>
+ <command>
+%HOSTIP:%HTTPPORT/want/53 -b log/injar53 -j
+</command>
+<file name="log/injar53">
+%HOSTIP FALSE / FALSE 2139150993 mooo indeed
+%HOSTIP FALSE / FALSE 0 moo1 indeed
+%HOSTIP FALSE / FALSE 1 moo2 indeed
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /want/53 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Cookie: mooo=indeed
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test530 b/tests/data/test530
new file mode 100644
index 000000000..359d04cf1
--- /dev/null
+++ b/tests/data/test530
@@ -0,0 +1,83 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+Pipelining
+multi
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data1>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 47
+
+file contents should appear once for each file
+</data1>
+<data2>
+HTTP/1.1 200 OK
+</data2>
+<data3>
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+</data3>
+<data4>
+Server: test-server/fake
+Content-Length: 47
+
+file contents should appear once for each file
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 47
+
+file contents should appear once for each file
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 47
+
+file contents should appear once for each file
+</data4>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<tool>
+lib530
+</tool>
+ <name>
+HTTP GET using pipelining
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/path/530
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+GET /path/5300001 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /path/5300002 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /path/5300003 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /path/5300004 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test531 b/tests/data/test531
new file mode 100644
index 000000000..8a7cee50a
--- /dev/null
+++ b/tests/data/test531
@@ -0,0 +1,59 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PORT
+STOR
+multi
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+</data>
+<servercmd>
+REPLY STOR 425 Permission Denied. File Exists.
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+<tool>
+lib525
+</tool>
+ <name>
+FTP PORT upload using multi interface and get 425 response
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/path/531 log/upload531
+</command>
+<file name="log/upload531">
+Moooooooooooo
+don't upload this
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+# Strip all valid kinds of PORT and EPRT that curl can send
+<strip>
+^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
+^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
+</strip>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD path
+PORT 127,0,0,1,5,109
+TYPE I
+STOR 531
+QUIT
+</protocol>
+
+</verify>
+</testcase>
diff --git a/tests/data/test532 b/tests/data/test532
new file mode 100644
index 000000000..dc45db1d2
--- /dev/null
+++ b/tests/data/test532
@@ -0,0 +1,63 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+RETR
+multi
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+file contents should appear once for each file
+</data>
+<datacheck>
+file contents should appear once for each file
+file contents should appear once for each file
+file contents should appear once for each file
+file contents should appear once for each file
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+<tool>
+lib532
+</tool>
+ <name>
+FTP RETR same file using reset handles between each transfer
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/path/532
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD path
+EPSV
+TYPE I
+SIZE 532
+RETR 532
+EPSV
+SIZE 532
+RETR 532
+EPSV
+SIZE 532
+RETR 532
+EPSV
+SIZE 532
+RETR 532
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test533 b/tests/data/test533
new file mode 100644
index 000000000..f4446cbe0
--- /dev/null
+++ b/tests/data/test533
@@ -0,0 +1,55 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+RETR
+multi
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+</data>
+
+<servercmd>
+REPLY RETR 550 the file doesn't exist
+REPLY SIZE 550 Can't check for file existence
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+<tool>
+lib533
+</tool>
+ <name>
+FTP RETR a non-existing file twice using the multi interface
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/path/533 ftp://%HOSTIP:%FTPPORT/path/533
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD path
+EPSV
+TYPE I
+SIZE 533
+RETR 533
+EPSV
+SIZE 533
+RETR 533
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test534 b/tests/data/test534
new file mode 100644
index 000000000..6045dba61
--- /dev/null
+++ b/tests/data/test534
@@ -0,0 +1,53 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+RETR
+multi
+non-existing host
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+</data>
+
+<servercmd>
+REPLY RETR 550 the file doesn't exist
+REPLY SIZE 550 Can't check for file existence
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+<tool>
+lib533
+</tool>
+ <name>
+FTP RETR twice using multi: non-existing host and non-existing file
+ </name>
+ <command>
+ftp://non-existing-host.haxx.se/path/534 ftp://%HOSTIP:%FTPPORT/path/534
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD path
+EPSV
+TYPE I
+SIZE 534
+RETR 534
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test535 b/tests/data/test535
new file mode 100644
index 000000000..85515a1b2
--- /dev/null
+++ b/tests/data/test535
@@ -0,0 +1,69 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+multi
+</keywords>
+</info>
+
+<reply>
+<data mode="text">
+HTTP/1.1 404 Badness
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+ETag: "21025-dc7-39462498"
+Content-Length: 6
+Content-Type: text/html
+Funny-head: yesyes
+
+hejsan
+</data>
+<data1>
+HTTP/1.1 200 Fine
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 13
+Connection: close
+Content-Type: text/html
+
+fine content
+</data1>
+
+<datacheck>
+fine content
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+# tool is what to use instead of 'curl'
+<tool>
+lib533
+</tool>
+
+ <name>
+HTTP GET multi two files with FAILONERROR
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/535 http://%HOSTIP:%HTTPPORT/5350001
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+GET /535 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /5350001 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test536 b/tests/data/test536
new file mode 100644
index 000000000..334c07f06
--- /dev/null
+++ b/tests/data/test536
@@ -0,0 +1,65 @@
+<testcase>
+<reply>
+<data mode="text">
+HTTP/1.1 404 Badness
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+ETag: "21025-dc7-39462498"
+Content-Length: 6
+Content-Type: text/html
+Funny-head: yesyes
+
+hejsan
+</data>
+<data1>
+HTTP/1.1 200 Fine
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 13
+Connection: close
+Content-Type: text/html
+
+fine content
+</data1>
+
+<datacheck>
+fine content
+Finished!
+</datacheck>
+
+<servercmd>
+pipe: 1
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+# tool is what to use instead of 'curl'
+<tool>
+lib536
+</tool>
+
+ <name>
+HTTP GET multi two files with FAILONERROR and pipelining
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/536 http://%HOSTIP:%HTTPPORT/5360001
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+GET /536 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /5360001 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test537 b/tests/data/test537
new file mode 100644
index 000000000..ce66c409d
--- /dev/null
+++ b/tests/data/test537
@@ -0,0 +1,57 @@
+<testcase>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+-foo-
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+getrlimit
+</features>
+# tool is what to use instead of 'curl'
+<tool>
+lib537
+</tool>
+# precheck is a command line to run before the test, to see if we can execute
+# the test or not
+<precheck>
+./libtest/lib537 check
+</precheck>
+
+ <name>
+HTTP GET with a HUGE number of file descriptors open
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/537
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+GET /537 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test538 b/tests/data/test538
new file mode 100644
index 000000000..f33b2a654
--- /dev/null
+++ b/tests/data/test538
@@ -0,0 +1,46 @@
+<testcase>
+<info>
+<keywords>
+FTP
+FAILURE
+multi
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<servercmd>
+REPLY PASS 314 bluah you f00l!
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+# NOTE that we use the 504 tool for this case
+<tool>
+lib504
+</tool>
+ <name>
+FTP multi-interface download, failed login: PASS not valid
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/538
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+# ok, the error code here is supposed to be 100 for the fine case since
+# that's just how lib504.c is written
+<errorcode>
+100
+</errorcode>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test539 b/tests/data/test539
new file mode 100644
index 000000000..2406c5473
--- /dev/null
+++ b/tests/data/test539
@@ -0,0 +1,63 @@
+<testcase>
+#
+# Server-side
+<reply>
+<data mode="text">
+file contents
+</data>
+
+<datacheck>
+file contents
+total 20
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
+drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
+-r--r--r-- 1 0 1 35 Jul 16 1996 README
+lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
+dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
+drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
+dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
+drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
+dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+# tool is what to use instead of 'curl'
+<tool>
+lib539
+</tool>
+
+ <name>
+Two FTP fetches using different CURLOPT_FTP_FILEMETHOD
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/path/to/the/file/539
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD path/to/the/file
+EPSV
+TYPE I
+SIZE 539
+RETR 539
+SYST
+CWD /
+EPSV
+TYPE A
+LIST path/to/the/file/539./
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test54 b/tests/data/test54
new file mode 100644
index 000000000..66dbe9ddb
--- /dev/null
+++ b/tests/data/test54
@@ -0,0 +1,45 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+followlocation
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 302 This is a weirdo text message swsclose
+Connection: close
+Location:
+
+This server reply is for testing
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP with blank Location:
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/want/54 -L
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /want/54 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test540 b/tests/data/test540
new file mode 100644
index 000000000..7c5b9a86d
--- /dev/null
+++ b/tests/data/test540
@@ -0,0 +1,96 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP proxy
+HTTP proxy Digest auth
+multi
+</keywords>
+</info>
+
+# Server-side
+<reply>
+
+# this is returned first since we get no proxy-auth
+<data>
+HTTP/1.1 407 Authorization Required to proxy me my dear
+Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345"
+Content-Length: 33
+
+And you should ignore this data.
+</data>
+
+# then this is returned when we get proxy-auth
+<data1000>
+HTTP/1.1 200 OK
+Content-Length: 21
+Server: no
+
+Nice proxy auth sir!
+</data1000>
+
+<datacheck>
+HTTP/1.1 407 Authorization Required to proxy me my dear
+Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345"
+Content-Length: 33
+
+HTTP/1.1 200 OK
+Content-Length: 21
+Server: no
+
+Nice proxy auth sir!
+HTTP/1.1 200 OK
+Content-Length: 21
+Server: no
+
+Nice proxy auth sir!
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+# tool is what to use instead of 'curl'
+<tool>
+lib540
+</tool>
+<features>
+crypto
+</features>
+ <name>
+HTTP proxy auth Digest multi API re-using connection
+ </name>
+ <command>
+http://test.remote.haxx.se/path/540 http://%HOSTIP:%HTTPPORT silly:person custom.set.host.name
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent: curl/.*
+</strip>
+<protocol>
+GET http://test.remote.haxx.se/path/540 HTTP/1.1
+Accept: */*
+Proxy-Connection: Keep-Alive
+Host: custom.set.host.name
+
+GET http://test.remote.haxx.se/path/540 HTTP/1.1
+Proxy-Authorization: Digest username="silly", realm="weirdorealm", nonce="12345", uri="/path/540", response="ca507dcf189196b6a5374d3233042261"
+Accept: */*
+Proxy-Connection: Keep-Alive
+Host: custom.set.host.name
+
+GET http://test.remote.haxx.se/path/540 HTTP/1.1
+Proxy-Authorization: Digest username="silly", realm="weirdorealm", nonce="12345", uri="/path/540", response="ca507dcf189196b6a5374d3233042261"
+Accept: */*
+Proxy-Connection: Keep-Alive
+Host: custom.set.host.name
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test541 b/tests/data/test541
new file mode 100644
index 000000000..ce4c91116
--- /dev/null
+++ b/tests/data/test541
@@ -0,0 +1,51 @@
+<testcase>
+# Server-side
+<reply>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+# tool is what to use instead of 'curl'
+<tool>
+lib541
+</tool>
+
+ <name>
+FTP upload and upload same file again without rewind
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/541 log/upload541
+</command>
+<file name="log/upload541">
+Contents
+of
+a file
+to verify
+ftp
+upload
+
+
+works?
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<upload>
+</upload>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE I
+STOR 541
+EPSV
+STOR 541
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test542 b/tests/data/test542
new file mode 100644
index 000000000..5afe12470
--- /dev/null
+++ b/tests/data/test542
@@ -0,0 +1,57 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+RETR
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+data
+ to
+ see
+that FTP
+works
+ so does it?
+</data>
+<datacheck>
+Content-Length: 51
+Accept-ranges: bytes
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+<tool>
+lib542
+</tool>
+ <name>
+FTP a file with NOBODY yes and HEADER no
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/542
+</command>
+
+</client>
+
+# Verify data after the test has been "shot"
+#
+# There's no MTDM in the protocol here since this code doesn't ask for the
+# time/date of the file
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+TYPE I
+SIZE 542
+REST 0
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test543 b/tests/data/test543
new file mode 100644
index 000000000..455633037
--- /dev/null
+++ b/tests/data/test543
@@ -0,0 +1,35 @@
+<testcase>
+<info>
+<keywords>
+curl_easy_escape
+</keywords>
+</info>
+# Server-side
+
+# Client-side
+<client>
+<server>
+none
+</server>
+<tool>
+lib543
+</tool>
+ <name>
+curl_easy_escape
+ </name>
+ <command>
+-
+</command>
+
+</client>
+
+# Verify data after the test has been "shot"
+#
+# There's no MTDM in the protocol here since this code doesn't ask for the
+# time/date of the file
+<verify>
+<stdout>
+%9C%26K%3DI%04%A1%01%E0%D8%7C%20%B7%EFS%29%FA%1DW%E1
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test544 b/tests/data/test544
new file mode 100644
index 000000000..2fa4edb1b
--- /dev/null
+++ b/tests/data/test544
@@ -0,0 +1,49 @@
+<testcase>
+#
+# Server-side
+<reply>
+<data mode="text">
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 3
+
+OK
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+# tool is what to use instead of 'curl'
+<tool>
+lib544
+</tool>
+
+ <name>
+HTTP POST text data using CURLOPT_COPYPOSTFIELDS
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/544
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol nonewline="yes">
+POST /544 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 4
+Content-Type: application/x-www-form-urlencoded
+
+This
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test545 b/tests/data/test545
new file mode 100644
index 000000000..66ebb6119
--- /dev/null
+++ b/tests/data/test545
Binary files differ
diff --git a/tests/data/test546 b/tests/data/test546
new file mode 100644
index 000000000..12e604a0e
--- /dev/null
+++ b/tests/data/test546
@@ -0,0 +1,70 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+RETR
+multi
+</keywords>
+</info>
+# Server-side
+<reply>
+<data nocheck="yes">
+data
+ to
+ see
+that FTP
+works
+ so does it?
+</data>
+
+<servercmd>
+REPLY RETR 550 the file doesn't exist
+COUNT RETR 1
+REPLY SIZE 550 Can't check for file existence
+COUNT SIZE 1
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+<tool>
+lib533
+</tool>
+ <name>
+FTP RETR a non-existing file then a found one using the multi interface
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/path/546 ftp://%HOSTIP:%FTPPORT/path/546
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD path
+EPSV
+TYPE I
+SIZE 546
+RETR 546
+EPSV
+SIZE 546
+RETR 546
+QUIT
+</protocol>
+<stdout>
+data
+ to
+ see
+that FTP
+works
+ so does it?
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test547 b/tests/data/test547
new file mode 100644
index 000000000..d1e26040a
--- /dev/null
+++ b/tests/data/test547
@@ -0,0 +1,133 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP POST
+POST callback
+HTTP proxy
+HTTP proxy NTLM auth
+</keywords>
+</info>
+# Server-side
+<reply>
+
+<data>
+HTTP/1.1 407 Authorization Required swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+Proxy-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
+Proxy-Authenticate: Basic realm="gimme all yer s3cr3ts"
+Proxy-Authenticate: NTLM
+Content-Type: text/html; charset=iso-8859-1
+Connection: close
+
+This is not the real page
+</data>
+
+# this is returned first since we get no proxy-auth
+<data1001>
+HTTP/1.1 407 Authorization Required to proxy me my dear
+Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+Content-Length: 34
+
+Hey you, authenticate or go away!
+</data1001>
+
+# This is supposed to be returned when the server gets the second
+# Authorization: NTLM line passed-in from the client
+<data1002>
+HTTP/1.1 200 Things are fine in proxy land swsclose
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 42
+
+Contents of that page you requested, sir.
+</data1002>
+
+<datacheck>
+HTTP/1.1 407 Authorization Required swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+Proxy-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
+Proxy-Authenticate: Basic realm="gimme all yer s3cr3ts"
+Proxy-Authenticate: NTLM
+Content-Type: text/html; charset=iso-8859-1
+Connection: close
+
+HTTP/1.1 407 Authorization Required to proxy me my dear
+Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+Content-Length: 34
+
+HTTP/1.1 200 Things are fine in proxy land swsclose
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 42
+
+Contents of that page you requested, sir.
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+# tool to use
+<tool>
+lib547
+</tool>
+<features>
+NTLM
+</features>
+ <name>
+HTTP proxy auth NTLM with POST data from read callback
+ </name>
+ <setenv>
+# we force our own host name, in order to make the test machine independent
+CURL_GETHOSTNAME=curlhost
+# we try to use the LD_PRELOAD hack, if not a debug build
+LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
+ </setenv>
+ <command>
+http://test.remote.haxx.se/path/547 http://%HOSTIP:%HTTPPORT s1lly:pers0n
+</command>
+<precheck>
+chkhostname curlhost
+</precheck>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent: curl/.*
+</strip>
+<protocol>
+POST http://test.remote.haxx.se/path/547 HTTP/1.1
+User-Agent: curl/7.13.2-CVS (i686-pc-linux-gnu) libcurl/7.13.2-CVS OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13
+Host: test.remote.haxx.se
+Accept: */*
+Proxy-Connection: Keep-Alive
+Content-Length: 36
+Content-Type: application/x-www-form-urlencoded
+
+this is the blurb we want to upload
+POST http://test.remote.haxx.se/path/547 HTTP/1.1
+Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
+User-Agent: curl/7.13.2-CVS (i686-pc-linux-gnu) libcurl/7.13.2-CVS OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13
+Host: test.remote.haxx.se
+Accept: */*
+Proxy-Connection: Keep-Alive
+Content-Length: 0
+Content-Type: application/x-www-form-urlencoded
+
+POST http://test.remote.haxx.se/path/547 HTTP/1.1
+Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAABQAFAHAAAAAIAAgAdQAAAAAAAAAAAAAABoKBAIYrD1xJmhNBNL9fLzuk9PV9436GAxPu0EKWzqQ/sZDVLXnp1JrySgl8A+cibE6z4HMxbGx5Y3VybGhvc3Q=
+User-Agent: curl/7.13.2-CVS (i686-pc-linux-gnu) libcurl/7.13.2-CVS OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13
+Host: test.remote.haxx.se
+Accept: */*
+Proxy-Connection: Keep-Alive
+Content-Length: 36
+Content-Type: application/x-www-form-urlencoded
+
+this is the blurb we want to upload
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test548 b/tests/data/test548
new file mode 100644
index 000000000..c4942e602
--- /dev/null
+++ b/tests/data/test548
@@ -0,0 +1,133 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP POST
+HTTP proxy
+HTTP proxy NTLM auth
+</keywords>
+</info>
+
+# Server-side
+<reply>
+
+<data>
+HTTP/1.1 407 Authorization Required swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+Proxy-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
+Proxy-Authenticate: Basic realm="gimme all yer s3cr3ts"
+Proxy-Authenticate: NTLM
+Content-Type: text/html; charset=iso-8859-1
+Connection: close
+
+This is not the real page
+</data>
+
+# this is returned first since we get no proxy-auth
+<data1001>
+HTTP/1.1 407 Authorization Required to proxy me my dear
+Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+Content-Length: 34
+
+Hey you, authenticate or go away!
+</data1001>
+
+# This is supposed to be returned when the server gets the second
+# Authorization: NTLM line passed-in from the client
+<data1002>
+HTTP/1.1 200 Things are fine in proxy land swsclose
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 42
+
+Contents of that page you requested, sir.
+</data1002>
+
+<datacheck>
+HTTP/1.1 407 Authorization Required swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+Proxy-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
+Proxy-Authenticate: Basic realm="gimme all yer s3cr3ts"
+Proxy-Authenticate: NTLM
+Content-Type: text/html; charset=iso-8859-1
+Connection: close
+
+HTTP/1.1 407 Authorization Required to proxy me my dear
+Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+Content-Length: 34
+
+HTTP/1.1 200 Things are fine in proxy land swsclose
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 42
+
+Contents of that page you requested, sir.
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+# tool to use
+<tool>
+lib548
+</tool>
+<features>
+NTLM
+</features>
+ <name>
+HTTP proxy auth NTLM with POST data from CURLOPT_POSTFIELDS
+ </name>
+ <setenv>
+# we force our own host name, in order to make the test machine independent
+CURL_GETHOSTNAME=curlhost
+# we try to use the LD_PRELOAD hack, if not a debug build
+LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
+ </setenv>
+ <command>
+http://test.remote.haxx.se/path/548 http://%HOSTIP:%HTTPPORT s1lly:pers0n
+</command>
+<precheck>
+chkhostname curlhost
+</precheck>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent: curl/.*
+</strip>
+<protocol>
+POST http://test.remote.haxx.se/path/548 HTTP/1.1
+User-Agent: curl/7.13.2-CVS (i686-pc-linux-gnu) libcurl/7.13.2-CVS OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13
+Host: test.remote.haxx.se
+Accept: */*
+Proxy-Connection: Keep-Alive
+Content-Length: 36
+Content-Type: application/x-www-form-urlencoded
+
+this is the blurb we want to upload
+POST http://test.remote.haxx.se/path/548 HTTP/1.1
+Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
+User-Agent: curl/7.13.2-CVS (i686-pc-linux-gnu) libcurl/7.13.2-CVS OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13
+Host: test.remote.haxx.se
+Accept: */*
+Proxy-Connection: Keep-Alive
+Content-Length: 0
+Content-Type: application/x-www-form-urlencoded
+
+POST http://test.remote.haxx.se/path/548 HTTP/1.1
+Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAABQAFAHAAAAAIAAgAdQAAAAAAAAAAAAAABoKBAIYrD1xJmhNBNL9fLzuk9PV9436GAxPu0EKWzqQ/sZDVLXnp1JrySgl8A+cibE6z4HMxbGx5Y3VybGhvc3Q=
+User-Agent: curl/7.13.2-CVS (i686-pc-linux-gnu) libcurl/7.13.2-CVS OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13
+Host: test.remote.haxx.se
+Accept: */*
+Proxy-Connection: Keep-Alive
+Content-Length: 36
+Content-Type: application/x-www-form-urlencoded
+
+this is the blurb we want to upload
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test549 b/tests/data/test549
new file mode 100644
index 000000000..298d0ad98
--- /dev/null
+++ b/tests/data/test549
@@ -0,0 +1,65 @@
+<testcase>
+<info>
+<keywords>
+FTP
+CURLOPT_PROXY_TRANSFER_MODE
+CURLOPT_PROXY
+HTTP proxy
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+
+hello
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+ftp
+</features>
+<tool>
+lib549
+</tool>
+ <name>
+FTP RETR over proxy with CURLOPT_PROXY_TRANSFER_MODE
+ </name>
+# first URL then proxy
+ <command>
+ftp://www.haxx.se/moo/549 http://%HOSTIP:%HTTPPORT
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET ftp://www.haxx.se/moo/549;type=i HTTP/1.1
+Host: www.haxx.se:21
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+<stdout mode="text">
+hello
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test55 b/tests/data/test55
new file mode 100644
index 000000000..662385608
--- /dev/null
+++ b/tests/data/test55
@@ -0,0 +1,66 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+followlocation
+</keywords>
+</info>
+<reply>
+<data>
+HTTP/1.1 302 OK swsclose
+Location: 550002
+Date: Thu, 09 Nov 2010 14:50:00 GMT
+Connection: close
+
+</data>
+<data2>
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:50:00 GMT
+Connection: close
+
+body
+</data2>
+<datacheck>
+HTTP/1.1 302 OK swsclose
+Location: 550002
+Date: Thu, 09 Nov 2010 14:50:00 GMT
+Connection: close
+
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:50:00 GMT
+Connection: close
+
+body
+</datacheck>
+</reply>
+
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP follow redirect with single slash in path
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/55 -L
+</command>
+</client>
+
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /55 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /550002 HTTP/1.1
+User-Agent: curl/7.10 (i686-pc-linux-gnu) libcurl/7.10 OpenSSL/0.9.6c ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test550 b/tests/data/test550
new file mode 100644
index 000000000..c99cf4bed
--- /dev/null
+++ b/tests/data/test550
@@ -0,0 +1,65 @@
+<testcase>
+<info>
+<keywords>
+FTP
+HTTP proxy
+CURLOPT_PROXY_TRANSFER_MODE
+CURLOPT_PROXY
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+
+hello
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+ftp
+</features>
+<tool>
+lib549
+</tool>
+ <name>
+FTP RETR over proxy with CURLOPT_PROXY_TRANSFER_MODE and ASCII transfer
+ </name>
+# first URL then proxy
+ <command>
+ftp://www.haxx.se/moo/550 http://%HOSTIP:%HTTPPORT ascii
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET ftp://www.haxx.se/moo/550;type=a HTTP/1.1
+Host: www.haxx.se:21
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+<stdout mode="text">
+hello
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test551 b/tests/data/test551
new file mode 100644
index 000000000..8027d91cf
--- /dev/null
+++ b/tests/data/test551
@@ -0,0 +1,98 @@
+<testcase>
+<info>
+# this test is meant to be exactly like 547 but using Digest instead of NTLM
+<keywords>
+HTTP
+HTTP POST
+POST callback
+HTTP proxy
+HTTP proxy Digest auth
+</keywords>
+</info>
+
+# Server-side
+<reply>
+
+# as a bonus, ww use an excessive nonce length
+<data>
+HTTP/1.1 407 Authorization Required swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+Proxy-Authenticate: Digest realm="something fun to read", nonce="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+Content-Type: text/html; charset=iso-8859-1
+Connection: close
+
+This is not the real page
+</data>
+
+# This is supposed to be returned when the server gets the Digest
+# Authorization: line passed-in from the client
+<data1000>
+HTTP/1.1 200 Things are fine in proxy land swsclose
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 42
+
+Contents of that page you requested, sir.
+</data1000>
+
+<datacheck>
+HTTP/1.1 407 Authorization Required swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+Proxy-Authenticate: Digest realm="something fun to read", nonce="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+Content-Type: text/html; charset=iso-8859-1
+Connection: close
+
+HTTP/1.1 200 Things are fine in proxy land swsclose
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 42
+
+Contents of that page you requested, sir.
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+# tool to use
+<tool>
+lib547
+</tool>
+<features>
+</features>
+ <name>
+HTTP proxy auth Digest with POST data from read callback
+ </name>
+ <command>
+http://test.remote.haxx.se/path/551 http://%HOSTIP:%HTTPPORT s1lly:pers0n
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent: curl/.*
+</strip>
+<protocol>
+POST http://test.remote.haxx.se/path/551 HTTP/1.1
+Host: test.remote.haxx.se
+Accept: */*
+Proxy-Connection: Keep-Alive
+Content-Length: 36
+Content-Type: application/x-www-form-urlencoded
+
+this is the blurb we want to upload
+POST http://test.remote.haxx.se/path/551 HTTP/1.1
+Proxy-Authorization: Digest username="s1lly", realm="something fun to read", nonce="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", uri="/path/551", response="3325240726fbdaf1e61f3a0dd40b930c"
+Host: test.remote.haxx.se
+Accept: */*
+Proxy-Connection: Keep-Alive
+Content-Length: 36
+Content-Type: application/x-www-form-urlencoded
+
+this is the blurb we want to upload
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test552 b/tests/data/test552
new file mode 100644
index 000000000..b0db37c1e
--- /dev/null
+++ b/tests/data/test552
Binary files differ
diff --git a/tests/data/test553 b/tests/data/test553
new file mode 100644
index 000000000..555293621
--- /dev/null
+++ b/tests/data/test553
@@ -0,0 +1,67 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP POST
+POST callback
+huge request header
+</keywords>
+</info>
+# Server-side
+<reply>
+
+<data>
+HTTP/1.1 200 Fine!
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+Content-Length: 6
+
+hello
+</data>
+
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+# tool to use
+<tool>
+lib553
+</tool>
+<features>
+</features>
+ <name>
+HTTP post with huge request headers and post data from callback
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/path/553
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent: curl/.*
+</strip>
+# We strip off a large chunk of the type-2 NTLM message since it depends on
+# the local host name and thus differs on different machines!
+<protocol nonewline="yes">
+POST /path/553 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Header0: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test554 b/tests/data/test554
new file mode 100644
index 000000000..134f7ef97
--- /dev/null
+++ b/tests/data/test554
@@ -0,0 +1,68 @@
+<testcase>
+#
+# Server-side
+<reply>
+<data mode="text">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Connection: close
+Content-Type: text/html
+
+hello
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+# tool is what to use instead of 'curl'
+<tool>
+lib554
+</tool>
+
+ <name>
+HTTP multi-part formpost using read callback for the file part
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/554
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strippart>
+s/^------------------------------[a-z0-9]*/------------------------------/
+s/boundary=----------------------------[a-z0-9]*/boundary=----------------------------/
+</strippart>
+# Note that the stripping above removes 12 bytes from every occurance of the
+# boundary string and since 4 of them are in the body contents, we see
+# 415 - (4*12) here == 367 bytes.
+<protocol>
+POST /554 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 415
+Expect: 100-continue
+Content-Type: multipart/form-data; boundary=----------------------------
+
+------------------------------
+Content-Disposition: form-data; name="sendfile"; filename="postit2.c"
+
+this is what we post to the silly web server
+
+------------------------------
+Content-Disposition: form-data; name="filename"
+
+postit2.c
+------------------------------
+Content-Disposition: form-data; name="submit"
+
+send
+--------------------------------
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test555 b/tests/data/test555
new file mode 100644
index 000000000..32223452e
--- /dev/null
+++ b/tests/data/test555
@@ -0,0 +1,142 @@
+<testcase>
+# NOTE: this test case is a duplicate of 547 but the tool is built to use the
+# multi interface instead of easy, but that shouldn't be noticable at all in
+# this file!
+<info>
+<keywords>
+HTTP
+HTTP POST
+POST callback
+HTTP proxy
+HTTP proxy NTLM auth
+multi
+</keywords>
+</info>
+
+# Server-side
+<reply>
+
+<data>
+HTTP/1.1 407 Authorization Required swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+Proxy-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
+Proxy-Authenticate: Basic realm="gimme all yer s3cr3ts"
+Proxy-Authenticate: NTLM
+Content-Type: text/html; charset=iso-8859-1
+Connection: close
+
+This is not the real page
+</data>
+
+# this is returned first since we get no proxy-auth
+<data1001>
+HTTP/1.1 407 Authorization Required to proxy me my dear
+Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+Content-Length: 34
+
+Hey you, authenticate or go away!
+</data1001>
+
+# This is supposed to be returned when the server gets the second
+# Authorization: NTLM line passed-in from the client
+<data1002>
+HTTP/1.1 200 Things are fine in proxy land swsclose
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 42
+
+Contents of that page you requested, sir.
+</data1002>
+
+<datacheck>
+HTTP/1.1 407 Authorization Required swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+Proxy-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
+Proxy-Authenticate: Basic realm="gimme all yer s3cr3ts"
+Proxy-Authenticate: NTLM
+Content-Type: text/html; charset=iso-8859-1
+Connection: close
+
+HTTP/1.1 407 Authorization Required to proxy me my dear
+Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+Content-Length: 34
+
+HTTP/1.1 200 Things are fine in proxy land swsclose
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 42
+
+Contents of that page you requested, sir.
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+# tool to use
+<tool>
+lib555
+</tool>
+<features>
+NTLM
+</features>
+ <name>
+HTTP proxy auth NTLM with POST data from read callback multi-if
+ </name>
+ <setenv>
+# we force our own host name, in order to make the test machine independent
+CURL_GETHOSTNAME=curlhost
+# we try to use the LD_PRELOAD hack, if not a debug build
+LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
+ </setenv>
+ <command>
+http://test.remote.haxx.se/path/555 http://%HOSTIP:%HTTPPORT s1lly:pers0n
+</command>
+<precheck>
+chkhostname curlhost
+</precheck>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent: curl/.*
+</strip>
+<strippart>
+# remove CR that CURLOPT_TRANSFERTEXT added, when CharConv enabled:
+s/^(this is the blurb we want to upload)\r\n/$1\n/ if($has_charconv)
+</strippart>
+<protocol>
+POST http://test.remote.haxx.se/path/555 HTTP/1.1
+User-Agent: curl/7.13.2-CVS (i686-pc-linux-gnu) libcurl/7.13.2-CVS OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13
+Host: test.remote.haxx.se
+Accept: */*
+Proxy-Connection: Keep-Alive
+Content-Length: 36
+Content-Type: application/x-www-form-urlencoded
+
+this is the blurb we want to upload
+POST http://test.remote.haxx.se/path/555 HTTP/1.1
+Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
+User-Agent: curl/7.13.2-CVS (i686-pc-linux-gnu) libcurl/7.13.2-CVS OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13
+Host: test.remote.haxx.se
+Accept: */*
+Proxy-Connection: Keep-Alive
+Content-Length: 0
+Content-Type: application/x-www-form-urlencoded
+
+POST http://test.remote.haxx.se/path/555 HTTP/1.1
+Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAABQAFAHAAAAAIAAgAdQAAAAAAAAAAAAAABoKBAIYrD1xJmhNBNL9fLzuk9PV9436GAxPu0EKWzqQ/sZDVLXnp1JrySgl8A+cibE6z4HMxbGx5Y3VybGhvc3Q=
+User-Agent: curl/7.13.2-CVS (i686-pc-linux-gnu) libcurl/7.13.2-CVS OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13
+Host: test.remote.haxx.se
+Accept: */*
+Proxy-Connection: Keep-Alive
+Content-Length: 36
+Content-Type: application/x-www-form-urlencoded
+
+this is the blurb we want to upload
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test556 b/tests/data/test556
new file mode 100644
index 000000000..998bdfb07
--- /dev/null
+++ b/tests/data/test556
@@ -0,0 +1,50 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+Content-Length: 6
+Connection: close
+
+-foo-
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+<tool>
+lib556
+</tool>
+ <name>
+send and recv HTTP
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /556 HTTP/1.2
+Host: ninja
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test557 b/tests/data/test557
new file mode 100644
index 000000000..3da67e99f
--- /dev/null
+++ b/tests/data/test557
@@ -0,0 +1,39 @@
+<testcase>
+#
+# Server-side
+<reply>
+</reply>
+
+# Client-side
+<client>
+<server>
+none
+</server>
+# tool is what to use instead of 'curl'
+<tool>
+lib557
+</tool>
+
+<name>
+curl_mprintf() testing
+</name>
+<command>
+nothing
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<stdout mode="text">
+All curl_mprintf() unsigned short tests OK!
+All curl_mprintf() signed short tests OK!
+All curl_mprintf() unsigned int tests OK!
+All curl_mprintf() signed int tests OK!
+All curl_mprintf() unsigned long tests OK!
+All curl_mprintf() signed long tests OK!
+All curl_mprintf() curl_off_t tests OK!
+</stdout>
+</verify>
+
+</testcase>
diff --git a/tests/data/test558 b/tests/data/test558
new file mode 100644
index 000000000..5b69ea027
--- /dev/null
+++ b/tests/data/test558
@@ -0,0 +1,44 @@
+<testcase>
+#
+# Server-side
+<reply>
+</reply>
+
+# Client-side
+<client>
+<server>
+none
+</server>
+# tool is what to use instead of 'curl'
+<tool>
+lib558
+</tool>
+# precheck is a command line to run before the test,
+# to see if we can execute the test or not
+<precheck>
+./libtest/lib558 check
+</precheck>
+
+<name>
+internal hash create/destroy testing
+</name>
+<command>
+nothing
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<stdout mode="text">
+easy handle init OK
+creating hash...
+hash creation OK
+destroying hash...
+hash destruction OK
+destroying easy handle...
+easy handle destruction OK
+</stdout>
+</verify>
+
+</testcase>
diff --git a/tests/data/test559 b/tests/data/test559
new file mode 100644
index 000000000..ecaf54c7e
--- /dev/null
+++ b/tests/data/test559
@@ -0,0 +1,44 @@
+<testcase>
+#
+# Server-side
+<reply>
+</reply>
+
+# Client-side
+<client>
+<server>
+none
+</server>
+# tool is what to use instead of 'curl'
+<tool>
+lib559
+</tool>
+# precheck is a command line to run before the test,
+# to see if we can execute the test or not
+<precheck>
+./libtest/lib559 check
+</precheck>
+
+<name>
+internal hash create/add/destroy testing
+</name>
+<command>
+nothing
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<stdout mode="text">
+easy handle init OK
+creating hash...
+hash creation OK
+destroying hash...
+hash destruction OK
+destroying easy handle...
+easy handle destruction OK
+</stdout>
+</verify>
+
+</testcase>
diff --git a/tests/data/test56 b/tests/data/test56
new file mode 100644
index 000000000..a97b3650e
--- /dev/null
+++ b/tests/data/test56
@@ -0,0 +1,61 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP POST
+chunked Transfer-Encoding
+config file
+-A
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.0 200 OK swsclose
+Funny-head: yesyes
+
+This is the proof it works
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP POST with *HUGE* request and chunked transfer-encoding
+ </name>
+ <stdin>
+#
+data "we post this"
+#
+# enforce chunky post!
+header "Transfer-Encoding: chunked"
+#
+# Set the user-agent using a short-option:
+-A "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Transfer-Encoding: chunked
+Content-Type: application/x-www-form-urlencoded
+
+c
+we post this
+0
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test560 b/tests/data/test560
new file mode 100644
index 000000000..0e991b825
--- /dev/null
+++ b/tests/data/test560
@@ -0,0 +1,56 @@
+<testcase>
+<info>
+<keywords>
+HTTPS
+HTTP GET
+multi
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 7
+
+MooMoo
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+SSL
+</features>
+<server>
+https
+</server>
+<tool>
+lib560
+</tool>
+ <name>
+simple HTTPS GET with multi interface
+ </name>
+ <command>
+https://%HOSTIP:%HTTPSPORT/560
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /560 HTTP/1.1
+Host: %HOSTIP:%HTTPSPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test561 b/tests/data/test561
new file mode 100644
index 000000000..18e827c10
--- /dev/null
+++ b/tests/data/test561
@@ -0,0 +1,66 @@
+<testcase>
+<info>
+<keywords>
+FTP
+HTTP proxy
+CURLOPT_PROXY_TRANSFER_MODE
+CURLOPT_PROXY
+type=
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+
+hello
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+ftp
+</features>
+<tool>
+lib549
+</tool>
+ <name>
+FTP RETR with CURLOPT_PROXY_TRANSFER_MODE, ASCII transfer and type=i
+ </name>
+# first URL then proxy
+ <command>
+"ftp://www.haxx.se/moo/561;type=i" http://%HOSTIP:%HTTPPORT ascii
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET ftp://www.haxx.se/moo/561;type=i HTTP/1.1
+Host: www.haxx.se:21
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+<stdout mode="text">
+hello
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test562 b/tests/data/test562
new file mode 100644
index 000000000..070cf7aa1
--- /dev/null
+++ b/tests/data/test562
@@ -0,0 +1,53 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+RETR
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+silly data
+over FTP
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+<tool>
+lib562
+</tool>
+ <name>
+FTP a type=A URL and CURLOPT_PORT set
+ </name>
+
+# note that we need quotes around the URL below to make sure the shell doesn't
+# treat the semicolon as a separator!
+ <command>
+'ftp://%HOSTIP:23456/562;type=A' %FTPPORT
+</command>
+
+</client>
+
+# Verify data after the test has been "shot"
+#
+# There's no MTDM in the protocol here since this code doesn't ask for the
+# time/date of the file
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE A
+SIZE 562
+RETR 562
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test563 b/tests/data/test563
new file mode 100644
index 000000000..785152319
--- /dev/null
+++ b/tests/data/test563
@@ -0,0 +1,57 @@
+<testcase>
+<info>
+<keywords>
+FTP
+CURLOPT_PORT
+HTTP proxy
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Accept-Ranges: bytes
+Content-Length: 6
+
+hello
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+http
+</server>
+<tool>
+lib562
+</tool>
+ <name>
+FTP type=A URL and CURLOPT_PORT set and proxy
+ </name>
+
+<setenv>
+ftp_proxy=http://%HOSTIP:%HTTPPORT/
+</setenv>
+# note that we need quotes around the URL below to make sure the shell doesn't
+# treat the semicolon as a separator!
+ <command>
+"ftp://%HOSTIP:23456/563;type=A" %FTPPORT
+</command>
+
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+GET FTP://%HOSTIP:%FTPPORT/563;type=A HTTP/1.1
+Host: %HOSTIP:%FTPPORT
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test564 b/tests/data/test564
new file mode 100644
index 000000000..6d0609d9d
--- /dev/null
+++ b/tests/data/test564
@@ -0,0 +1,66 @@
+<testcase>
+<info>
+<keywords>
+FTP
+PASV
+RETR
+multi
+SOCKS4
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+data
+ to
+ see
+that FTP
+works
+ so does it?
+</data>
+
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+socks4
+</server>
+<tool>
+lib564
+</tool>
+ <name>
+FTP RETR a file over a SOCKS proxy using the multi interface
+ </name>
+<command>
+ftp://%HOSTIP:%FTPPORT/path/564 %HOSTIP:%SOCKSPORT
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD path
+EPSV
+TYPE I
+SIZE 546
+RETR 546
+EPSV
+SIZE 546
+RETR 546
+QUIT
+</protocol>
+<stdout>
+data
+ to
+ see
+that FTP
+works
+ so does it?
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test565 b/tests/data/test565
new file mode 100644
index 000000000..fdf75a5f8
--- /dev/null
+++ b/tests/data/test565
@@ -0,0 +1,105 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP POST
+HTTP Digest auth
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 100 Continue
+Server: Microsoft-IIS/5.0
+Date: Sun, 03 Apr 2005 14:57:45 GMT
+X-Powered-By: ASP.NET
+
+HTTP/1.1 401 authentication please swsbounce
+Server: Microsoft-IIS/6.0
+WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 0
+
+</data>
+<data1>
+HTTP/1.1 200 A OK
+Server: Microsoft-IIS/6.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 3
+
+ok
+</data1>
+<datacheck>
+HTTP/1.1 100 Continue
+Server: Microsoft-IIS/5.0
+Date: Sun, 03 Apr 2005 14:57:45 GMT
+X-Powered-By: ASP.NET
+
+HTTP/1.1 401 authentication please swsbounce
+Server: Microsoft-IIS/6.0
+WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 0
+
+HTTP/1.1 200 A OK
+Server: Microsoft-IIS/6.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 3
+
+ok
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+# tool is what to use instead of 'curl'
+<tool>
+lib565
+</tool>
+
+ <name>
+send HTTP POST using read callback, chunked transfer-encoding and Digest
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/565
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+POST /565 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Transfer-Encoding: chunked
+Content-Type: application/x-www-form-urlencoded
+
+
+0
+
+POST /565 HTTP/1.1
+Authorization: Digest username="foo", realm="testrealm", nonce="1053604144", uri="/565", response="877424f750af047634dbd94f9933217b"
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Transfer-Encoding: chunked
+Content-Type: application/x-www-form-urlencoded
+Expect: 100-continue
+
+3
+one
+3
+two
+5
+three
+1d
+and a final longer crap: four
+0
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test566 b/tests/data/test566
new file mode 100644
index 000000000..95da61d2d
--- /dev/null
+++ b/tests/data/test566
@@ -0,0 +1,57 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data mode="text">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 0
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+# tool is what to use instead of 'curl'
+<tool>
+lib566
+</tool>
+
+ <name>
+HTTP GET with CURLINFO_CONTENT_LENGTH_DOWNLOAD and 0 bytes transfer
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/566 log/ip566
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<file name="log/ip566" mode="text">
+CL: 0
+</file>
+<protocol>
+GET /566 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test567 b/tests/data/test567
new file mode 100644
index 000000000..4fd14843c
--- /dev/null
+++ b/tests/data/test567
@@ -0,0 +1,50 @@
+<testcase>
+
+#Informational
+<info>
+<keywords>
+RTSP
+OPTIONS
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+RTSP/1.0 200 OK
+Server: RTSPD/libcurl-test
+CSeq: 1
+Public: DESCRIBE, OPTIONS, SETUP, TEARDOWN, PLAY, PAUSE
+Curl-Private: swsclose
+</data>
+</reply>
+
+# Client-Side
+<client>
+<server>
+rtsp
+</server>
+<tool>
+lib567
+</tool>
+
+<name>
+simple RTSP OPTIONS command
+</name>
+<command>
+rtsp://%HOSTIP:%RTSPPORT/567
+</command>
+</client>
+
+<verify>
+<protocol>
+OPTIONS rtsp://%HOSTIP:%RTSPPORT/567 RTSP/1.0
+CSeq: 1
+User-Agent: test567
+Test-Number: 567
+
+</protocol>
+</verify>
+
+</testcase>
+
diff --git a/tests/data/test568 b/tests/data/test568
new file mode 100644
index 000000000..d746e96dd
--- /dev/null
+++ b/tests/data/test568
@@ -0,0 +1,117 @@
+<testcase>
+
+#Informational
+<info>
+<keywords>
+RTSP
+ANNOUNCE
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data1>
+RTSP/1.0 200 OK
+Server: RTSPD/libcurl-test
+Cseq: 1
+
+</data1>
+
+<data2>
+RTSP/1.0 200 OK
+Server: RTSPD/libcurl-test
+Cseq: 2
+Content-Length: 70
+Content-Type: application/sdp
+
+v=0
+s=rtspd SDP
+i=A fake SDP reply
+u=http://www.curl.haxx.se/fakesdp.ps
+</data2>
+<data3>
+RTSP/1.0 200 Okie Dokie
+Server: RTSPD/libcurl-test
+Cseq: 3
+
+</data3>
+<data4>
+RTSP/1.0 200 OK
+Server: RTSPD/libcurl-test
+CSeq: 4
+Curl-private: swsclose
+Informational: Empty Options Response
+
+</data4>
+</reply>
+
+# Client-Side
+<client>
+<server>
+rtsp
+</server>
+<tool>
+lib568
+</tool>
+
+<name>
+RTSP Announce (PUT and POST style) test
+</name>
+<command>
+rtsp://%HOSTIP:%RTSPPORT/568
+</command>
+# file written before test command runs
+<file name="log/file568.txt">
+v=0
+o=mhandley 2890844526 2890845468 IN IP4 126.16.64.4
+s=SDP Seminar
+i=A Seminar on the session description protocol
+u=http://www.cs.ucl.ac.uk/staff/M.Handley/sdp.03.ps
+e=mjh@isi.edu (Mark Handley)
+c=IN IP4 224.2.17.12/127
+t=2873397496 2873404696
+a=recvonly
+m=audio 3456 RTP/AVP 0
+m=video 2232 RTP/AVP 31
+</file>
+</client>
+
+<verify>
+<strip>
+^If-Modified-Since:.*
+</strip>
+<protocol>
+ANNOUNCE rtsp://%HOSTIP:%RTSPPORT/5680001 RTSP/1.0
+CSeq: 1
+Content-Length: 306
+Content-Type: application/sdp
+
+v=0
+o=mhandley 2890844526 2890845468 IN IP4 126.16.64.4
+s=SDP Seminar
+i=A Seminar on the session description protocol
+u=http://www.cs.ucl.ac.uk/staff/M.Handley/sdp.03.ps
+e=mjh@isi.edu (Mark Handley)
+c=IN IP4 224.2.17.12/127
+t=2873397496 2873404696
+a=recvonly
+m=audio 3456 RTP/AVP 0
+m=video 2232 RTP/AVP 31
+DESCRIBE rtsp://%HOSTIP:%RTSPPORT/5680002 RTSP/1.0
+CSeq: 2
+Accept: application/sdp
+
+ANNOUNCE rtsp://%HOSTIP:%RTSPPORT/5680003 RTSP/1.0
+CSeq: 3
+Content-Type: posty goodness
+Content-Length: 35
+
+postyfield=postystuff&project=curl
+OPTIONS rtsp://%HOSTIP:%RTSPPORT/5680004 RTSP/1.0
+CSeq: 4
+
+</protocol>
+</verify>
+
+</testcase>
+
diff --git a/tests/data/test569 b/tests/data/test569
new file mode 100644
index 000000000..5cd4797fe
--- /dev/null
+++ b/tests/data/test569
@@ -0,0 +1,110 @@
+<testcase>
+
+#Informational
+<info>
+<keywords>
+RTSP
+SESSION_ID
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data1>
+RTSP/1.0 200 OK
+Server: RTSPD/libcurl-test
+CSeq: 1
+Session: 00.+1-am-aSe55ion_id\$yes-i-am\$;timeout=60
+
+</data1>
+<data2>
+RTSP/1.0 200 OK
+Server: RTSPD/libcurl-test
+CSeq: 2
+
+</data2>
+<data3>
+RTSP/1.0 200 OK
+Session: \$extraspaces ignore-this-part-------;foo=bar
+CSeq: 3
+Server: RTSPD/libcurl-test
+
+</data3>
+<data4>
+RTSP/1.0 200 OK
+CSeq: 4
+Server: RTSPD/libcurl-test
+
+</data4>
+<data5>
+RTSP/1.0 200 OK
+Session: A
+Server: RTSPD/libcurl-test
+CSeq: 5
+Informational: Single Character
+
+</data5>
+<data6>
+RTSP/1.0 200 OK
+Server: RTSPD/libcurl-test
+Curl-Private: swsclose
+CSeq: 6
+
+</data6>
+
+# Client-Side
+<client>
+<server>
+rtsp
+</server>
+<tool>
+lib569
+</tool>
+
+<name>
+RTSP Session ID parsing
+</name>
+<command>
+rtsp://%HOSTIP:%RTSPPORT/569 log/idfile.txt
+</command>
+</client>
+
+<verify>
+<strip>
+^If-Modified-Since:.*
+</strip>
+<protocol>
+SETUP rtsp://%HOSTIP:%RTSPPORT/5690001 RTSP/1.0
+CSeq: 1
+Transport: Fake/NotReal/JustATest;foo=baz
+
+TEARDOWN rtsp://%HOSTIP:%RTSPPORT/5690002 RTSP/1.0
+CSeq: 2
+Session: 00.+1-am-aSe55ion_id\$yes-i-am\$
+
+SETUP rtsp://%HOSTIP:%RTSPPORT/5690003 RTSP/1.0
+CSeq: 3
+Transport: Fake/NotReal/JustATest;foo=baz
+
+TEARDOWN rtsp://%HOSTIP:%RTSPPORT/5690004 RTSP/1.0
+CSeq: 4
+Session: \$extraspaces
+
+SETUP rtsp://%HOSTIP:%RTSPPORT/5690005 RTSP/1.0
+CSeq: 5
+Transport: Fake/NotReal/JustATest;foo=baz
+
+TEARDOWN rtsp://%HOSTIP:%RTSPPORT/5690006 RTSP/1.0
+CSeq: 6
+Session: A
+
+</protocol>
+<file name="log/idfile.txt">
+Got Session ID: [00.+1-am-aSe55ion_id\$yes-i-am\$]
+Got Session ID: [\$extraspaces]
+Got Session ID: [A]
+</file>
+</verify>
+
+</testcase>
+
diff --git a/tests/data/test57 b/tests/data/test57
new file mode 100644
index 000000000..0724eac82
--- /dev/null
+++ b/tests/data/test57
@@ -0,0 +1,48 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+--write-out
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.1 200 OK swsclose
+Funny-head: yesyes
+Content-Type: text/html; charset=ISO-8859-4
+
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP content-type with spaces in
+ </name>
+ <command>
+-w "%{content_type}\n" http://%HOSTIP:%HTTPPORT/57 -o log/out57
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<stdout mode="text">
+text/html; charset=ISO-8859-4
+</stdout>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /57 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test570 b/tests/data/test570
new file mode 100644
index 000000000..aec863846
--- /dev/null
+++ b/tests/data/test570
@@ -0,0 +1,77 @@
+<testcase>
+
+#Informational
+<info>
+<keywords>
+RTSP
+Mismatch checking
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data1>
+RTSP/1.0 200 OK
+Server: RTSPD/libcurl-test
+CSeq: 2
+Public: DESCRIBE, OPTIONS, SETUP, TEARDOWN, PLAY, PAUSE
+Informational: CSeq Mismatch
+
+</data1>
+<data2>
+RTSP/1.0 200 OK
+Server: RTSPD/libcurl-test
+Session: asdf
+CSeq: 999
+
+</data2>
+<data3>
+RTSP/1.0 200 OK
+Server: RTSPD/libcurl-test
+Session: asdfWRONG
+Informational: Session ID mismatch
+Curl-Private: swsclose
+CSeq: 1000
+
+</data3>
+
+</reply>
+
+# Client-Side
+<client>
+<server>
+rtsp
+</server>
+<tool>
+lib570
+</tool>
+
+<name>
+RTSP CSeq and Session Mismatch checks
+</name>
+<command>
+rtsp://%HOSTIP:%RTSPPORT/570
+</command>
+</client>
+
+<verify>
+<strip>
+^If-Modified-Since:.*
+</strip>
+<protocol>
+OPTIONS rtsp://%HOSTIP:%RTSPPORT/5700001 RTSP/1.0
+CSeq: 1
+
+SETUP rtsp://%HOSTIP:%RTSPPORT/5700002 RTSP/1.0
+CSeq: 999
+Transport: RAW/RAW/UDP;unicast;client_port=3056-3057
+
+PLAY rtsp://%HOSTIP:%RTSPPORT/5700003 RTSP/1.0
+CSeq: 1000
+Session: asdf
+
+</protocol>
+</verify>
+
+</testcase>
+
diff --git a/tests/data/test571 b/tests/data/test571
new file mode 100644
index 000000000..9b263b12b
--- /dev/null
+++ b/tests/data/test571
@@ -0,0 +1,108 @@
+<testcase>
+
+# Informational
+# Bang on RTP by
+# 1) giving an evil payload (with $)
+# 2) Giving evil content (SDP starting with $)
+# 3) packing rtp after headers, after content, and at the start
+<info>
+<keywords>
+RTSP
+RTP
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data1>
+RTSP/1.0 200 OK
+Server: RTSPD/libcurl-test
+Session: asdf
+CSeq: 1
+
+</data1>
+
+<data2>
+RTSP/1.0 200 OK
+Server: RTSPD/libcurl-test
+CSeq: 2
+Session: asdf
+
+</data2>
+
+<data3>
+RTSP/1.0 200 OK
+Server: RTSPD/libcurl-test
+Cseq: 3
+Content-Length: 4
+Content-Type: fake/evil
+
+$99
+</data3>
+
+<data4>
+RTSP/1.0 200 OK
+Server: RTSPD/libcurl-test
+Session: asdf
+CSeq: 4
+
+</data4>
+
+<servercmd>
+rtp: part 2 channel 1 size 10
+rtp: part 2 channel 0 size 500
+rtp: part 2 channel 0 size 196
+rtp: part 2 channel 0 size 124
+rtp: part 2 channel 0 size 824
+rtp: part 3 channel 1 size 10
+rtp: part 3 channel 0 size 50
+rtp: part 4 channel 0 size 798
+rtp: part 4 channel 0 size 42
+rtp: part 4 channel 1 size 30
+rtp: part 4 channel 0 size 2048
+rtp: part 4 channel 0 size 85
+rtp: part 4 channel 1 size 24
+</servercmd>
+</reply>
+
+# Client-Side
+<client>
+<server>
+rtsp
+</server>
+<tool>
+lib571
+</tool>
+
+<name>
+RTSP RTP Interleaving Test
+</name>
+<command>
+rtsp://%HOSTIP:%RTSPPORT/571 log/protofile.txt
+</command>
+</client>
+
+<verify>
+<stdout>
+RTP: message size 10, channel 1
+RTP: message size 500, channel 0
+RTP: message size 196, channel 0
+RTP: message size 124, channel 0
+RTP: message size 824, channel 0
+RTP: message size 10, channel 1
+RTP: message size 50, channel 0
+RTP: message size 798, channel 0
+RTP: message size 42, channel 0
+RTP: message size 30, channel 1
+RTP: message size 2048, channel 0
+RTP: message size 85, channel 0
+RTP: message size 24, channel 1
+</stdout>
+
+<file name="log/protofile.txt">
+$99
+</file>
+</verify>
+
+</testcase>
+
diff --git a/tests/data/test572 b/tests/data/test572
new file mode 100644
index 000000000..c06e531fc
--- /dev/null
+++ b/tests/data/test572
@@ -0,0 +1,121 @@
+<testcase>
+
+#Informational
+<info>
+<keywords>
+RTSP
+GET_PARAMETER
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data1>
+RTSP/1.0 200 OK
+Server: RTSPD/libcurl-test
+Session: getparams-test
+CSeq: 1
+
+</data1>
+
+<data2>
+RTSP/1.0 200 OK
+Server: RTSPD/libcurl-test
+Session: getparams-test
+Content-Type: text/parameters
+Content-Length: 32
+Cseq: 2
+
+scale=enormous
+speed=ludicrous
+</data2>
+
+<data3>
+RTSP/1.0 200 OK
+Server: RTSPD/libcurl-test
+Session: getparams-test
+Cseq: 3
+
+</data3>
+
+<data4>
+RTSP/1.0 200 Okie Dokie
+Server: RTSPD/libcurl-test
+Session: getparams-test
+Cseq: 4
+Content-Length: 37
+
+packets_received: 1000
+jitter: 0.314
+</data4>
+<data5>
+RTSP/1.0 200 OK
+Server: RTSPD/libcurl-test
+Session: getparams-test
+CSeq: 5
+Curl-private: swsclose
+Informational: Empty Options Response
+
+</data5>
+</reply>
+
+# Client-Side
+<client>
+<server>
+rtsp
+</server>
+<tool>
+lib572
+</tool>
+
+<name>
+RTSP GET_PARAMETER (Put/Heartbeat/Post)
+</name>
+<command>
+rtsp://%HOSTIP:%RTSPPORT/572
+</command>
+# file written before test command runs
+<file name="log/file572.txt">
+scale
+speed
+</file>
+</client>
+
+<verify>
+<strip>
+^If-Modified-Since:.*
+</strip>
+<protocol>
+SETUP rtsp://%HOSTIP:%RTSPPORT/5720001 RTSP/1.0
+CSeq: 1
+Transport: Planes/Trains/Automobiles
+
+GET_PARAMETER rtsp://%HOSTIP:%RTSPPORT/5720002 RTSP/1.0
+CSeq: 2
+Session: getparams-test
+Content-Length: 12
+Content-Type: text/parameters
+
+scale
+speed
+GET_PARAMETER rtsp://%HOSTIP:%RTSPPORT/5720003 RTSP/1.0
+CSeq: 3
+Session: getparams-test
+
+GET_PARAMETER rtsp://%HOSTIP:%RTSPPORT/5720004 RTSP/1.0
+CSeq: 4
+Session: getparams-test
+Content-Length: 24
+Content-Type: text/parameters
+
+packets_received
+jitter
+OPTIONS rtsp://%HOSTIP:%RTSPPORT/5720005 RTSP/1.0
+CSeq: 5
+Session: getparams-test
+
+</protocol>
+</verify>
+
+</testcase>
+
diff --git a/tests/data/test573 b/tests/data/test573
new file mode 100644
index 000000000..909ae3cf7
--- /dev/null
+++ b/tests/data/test573
@@ -0,0 +1,56 @@
+<testcase>
+<info>
+<keywords>
+FILE
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+-foo-
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+# tool is what to use instead of 'curl'
+<tool>
+lib573
+</tool>
+
+ <name>
+verify connect time with multi interface
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/573
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /573 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test574 b/tests/data/test574
new file mode 100644
index 000000000..1fa4654d4
--- /dev/null
+++ b/tests/data/test574
@@ -0,0 +1,98 @@
+<testcase>
+<info>
+<keywords>
+FTP
+LIST
+RETR
+wildcardmatch
+ftplistparser
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data mode="text">
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+<tool>
+lib574
+</tool>
+<name>
+FTP wildcard download - changed fnmatch, 2x perform (UNIX LIST response)
+</name>
+<command>
+ftp://%HOSTIP:%FTPPORT/fully_simulated/UNIX/*.txt
+</command>
+</client>
+
+############################################
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+0
+</errorcode>
+# THERE SHOULD NOT BE "SIZE"! and one "USER/PASS"
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD fully_simulated
+CWD UNIX
+EPSV
+TYPE A
+LIST
+EPSV
+TYPE I
+RETR chmod1
+EPSV
+RETR chmod2
+EPSV
+RETR chmod3
+EPSV
+RETR empty_file.dat
+EPSV
+RETR file.txt
+EPSV
+RETR someothertext.txt
+CWD /
+CWD fully_simulated
+CWD UNIX
+EPSV
+TYPE A
+LIST
+EPSV
+TYPE I
+RETR chmod1
+EPSV
+RETR chmod2
+EPSV
+RETR chmod3
+EPSV
+RETR empty_file.dat
+EPSV
+RETR file.txt
+EPSV
+RETR someothertext.txt
+QUIT
+</protocol>
+<stdout mode="text">
+This file should have permissions 444
+This file should have permissions 666
+This file should have permissions 777
+This is content of file "file.txt"
+Some junk ;-) This file does not really exist.
+This file should have permissions 444
+This file should have permissions 666
+This file should have permissions 777
+This is content of file "file.txt"
+Some junk ;-) This file does not really exist.
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test575 b/tests/data/test575
new file mode 100644
index 000000000..5670e6bc6
--- /dev/null
+++ b/tests/data/test575
@@ -0,0 +1,121 @@
+<testcase>
+<info>
+<keywords>
+FTP
+RETR
+multi
+wildcardmatch
+ftplistparser
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+<tool>
+lib575
+</tool>
+ <name>
+FTP wildcard download - dup_handle and multi interface
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/fully_simulated/UNIX/*
+</command>
+</client>
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+0
+</errorcode>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD fully_simulated
+CWD UNIX
+EPSV
+TYPE A
+LIST
+EPSV
+TYPE I
+RETR chmod1
+EPSV
+RETR chmod2
+EPSV
+RETR chmod3
+EPSV
+RETR empty_file.dat
+EPSV
+RETR file.txt
+EPSV
+RETR someothertext.txt
+CWD /
+CWD fully_simulated
+CWD UNIX
+EPSV
+TYPE A
+LIST
+EPSV
+TYPE I
+RETR chmod1
+EPSV
+RETR chmod2
+EPSV
+RETR chmod3
+EPSV
+RETR empty_file.dat
+EPSV
+RETR file.txt
+EPSV
+RETR someothertext.txt
+QUIT
+USER anonymous
+PASS ftp@example.com
+PWD
+CWD fully_simulated
+CWD UNIX
+EPSV
+TYPE A
+LIST
+EPSV
+TYPE I
+RETR chmod1
+EPSV
+RETR chmod2
+EPSV
+RETR chmod3
+EPSV
+RETR empty_file.dat
+EPSV
+RETR file.txt
+EPSV
+RETR someothertext.txt
+QUIT
+</protocol>
+<stdout mode="text">
+This file should have permissions 444
+This file should have permissions 666
+This file should have permissions 777
+This is content of file "file.txt"
+Some junk ;-) This file does not really exist.
+This file should have permissions 444
+This file should have permissions 666
+This file should have permissions 777
+This is content of file "file.txt"
+Some junk ;-) This file does not really exist.
+This file should have permissions 444
+This file should have permissions 666
+This file should have permissions 777
+This is content of file "file.txt"
+Some junk ;-) This file does not really exist.
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test576 b/tests/data/test576
new file mode 100644
index 000000000..4d4b90c80
--- /dev/null
+++ b/tests/data/test576
@@ -0,0 +1,192 @@
+<testcase>
+<info>
+<keywords>
+FTP
+wildcardmatch
+ftplistparser
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+<tool>
+lib576
+</tool>
+ <name>
+FTP wildcard download - skip/parser_correctness/CURLOPT_FNMATCH_FUNCTION (UNIX)
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/fully_simulated/UNIX/*
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+0
+</errorcode>
+<stdout mode="text">
+=============================================================
+Remains: 14
+Filename: .
+Permissions: rwxrwxrwx (parsed => 777)
+Size: 20480B
+User: ftp-default
+Group: ftp-default
+Time: Apr 27 5:12
+Filetype: directory
+=============================================================
+Remains: 13
+Filename: ..
+Permissions: rwxrwxrwx (parsed => 777)
+Size: 20480B
+User: ftp-default
+Group: ftp-default
+Time: Apr 23 3:12
+Filetype: directory
+=============================================================
+Remains: 12
+Filename: chmod1
+Permissions: r--r--r-- (parsed => 444)
+Size: 38B
+User: ftp-default
+Group: ftp-default
+Time: Jan 11 10:00
+Filetype: regular file
+Content:
+-------------------------------------------------------------
+This file should have permissions 444
+-------------------------------------------------------------
+=============================================================
+Remains: 11
+Filename: chmod2
+Permissions: rw-rw-rw- (parsed => 666)
+Size: 38B
+User: ftp-default
+Group: ftp-default
+Time: Feb 1 8:00
+Filetype: regular file
+Content:
+-------------------------------------------------------------
+This file should have permissions 666
+-------------------------------------------------------------
+=============================================================
+Remains: 10
+Filename: chmod3
+Permissions: rwxrwxrwx (parsed => 777)
+Size: 38B
+User: ftp-default
+Group: ftp-default
+Time: Feb 1 8:00
+Filetype: regular file
+Content:
+-------------------------------------------------------------
+This file should have permissions 777
+-------------------------------------------------------------
+=============================================================
+Remains: 9
+Filename: chmod4
+Permissions: --S--S--t (parsed => 7001)
+Size: 4096B
+User: ftp-default
+Group: ftp-default
+Time: May 4 4:31
+Filetype: directory
+=============================================================
+Remains: 8
+Filename: chmod5
+Permissions: --s--s--T (parsed => 7110)
+Size: 4096B
+User: ftp-default
+Group: ftp-default
+Time: May 4 4:31
+Filetype: directory
+=============================================================
+Remains: 7
+Filename: empty_file.dat
+Permissions: rw-r--r-- (parsed => 644)
+Size: 0B
+User: ftp-default
+Group: ftp-default
+Time: Apr 27 11:01
+Filetype: regular file
+Content:
+-------------------------------------------------------------
+-------------------------------------------------------------
+=============================================================
+Remains: 6
+Filename: file.txt
+Permissions: rw-r--r-- (parsed => 644)
+Size: 35B
+User: ftp-default
+Group: ftp-default
+Time: Apr 27 11:01
+Filetype: regular file
+Content:
+-------------------------------------------------------------
+This is content of file "file.txt"
+-------------------------------------------------------------
+=============================================================
+Remains: 5
+Filename: link
+Permissions: rwxrwxrwx (parsed => 777)
+Size: 0B
+User: ftp-default
+Group: ftp-default
+Time: Jan 6 4:42
+Filetype: symlink
+Target: file.txt
+=============================================================
+Remains: 4
+Filename: link_absolute
+Permissions: rwxrwxrwx (parsed => 777)
+Size: 0B
+User: ftp-default
+Group: ftp-default
+Time: Jan 6 4:45
+Filetype: symlink
+Target: /data/ftp/file.txt
+=============================================================
+Remains: 3
+Filename: .NeXT
+Permissions: rwxrwxrwx (parsed => 777)
+Size: 4096B
+User: ftp-default
+Group: ftp-default
+Time: Jan 23 2:05
+Filetype: directory
+=============================================================
+Remains: 2
+Filename: someothertext.txt
+Permissions: rw-r--r-- (parsed => 644)
+Size: 47B
+User: ftp-default
+Group: ftp-default
+Time: Apr 27 11:01
+Filetype: regular file
+Content:
+-------------------------------------------------------------
+# THIS CONTENT WAS SKIPPED IN CHUNK_BGN CALLBACK #
+-------------------------------------------------------------
+=============================================================
+Remains: 1
+Filename: weirddir.txt
+Permissions: rwxr-xrwx (parsed => 757)
+Size: 4096B
+User: ftp-default
+Group: ftp-default
+Time: Apr 23 3:12
+Filetype: directory
+=============================================================
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test577 b/tests/data/test577
new file mode 100644
index 000000000..7a69ead20
--- /dev/null
+++ b/tests/data/test577
@@ -0,0 +1,43 @@
+<testcase>
+<info>
+<keywords>
+wildcardmatch
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+</reply>
+
+# Client-side
+<client>
+<server>
+none
+</server>
+# tool is what to use instead of 'curl'
+<tool>
+lib577
+</tool>
+# precheck is a command line to run before the test,
+# to see if we can execute the test or not
+<precheck>
+./libtest/lib577 check
+</precheck>
+
+ <name>
+Curl_fnmatch() testing
+ </name>
+ <command>
+nothing
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<stdout mode="text">
+===========================
+===========================
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test578 b/tests/data/test578
new file mode 100644
index 000000000..0b6a43731
--- /dev/null
+++ b/tests/data/test578
@@ -0,0 +1,52 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP POST
+</keywords>
+</info>
+#
+# Server-side
+<reply name="1">
+<data mode="text">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+-foo-
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+# tool is what to use instead of 'curl'
+<tool>
+lib578
+</tool>
+
+ <name>
+HTTP POST lower than MAX_INITIAL_POST_SIZE with progress callback
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/500 log/ip578
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<file name="log/ip578" mode="text">
+PASSED, UL data matched data size
+</file>
+</verify>
+</testcase>
diff --git a/tests/data/test579 b/tests/data/test579
new file mode 100644
index 000000000..5f8794437
--- /dev/null
+++ b/tests/data/test579
@@ -0,0 +1,85 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP POST
+HTTP Digest auth
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 100 Continue
+Server: Microsoft-IIS/5.0
+Date: Sun, 03 Apr 2005 14:57:45 GMT
+X-Powered-By: ASP.NET
+
+HTTP/1.1 401 authentication please swsbounce
+Server: Microsoft-IIS/6.0
+WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 0
+
+</data>
+<data1>
+HTTP/1.1 200 A OK
+Server: Microsoft-IIS/6.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 3
+
+ok
+</data1>
+<datacheck>
+HTTP/1.1 100 Continue
+Server: Microsoft-IIS/5.0
+Date: Sun, 03 Apr 2005 14:57:45 GMT
+X-Powered-By: ASP.NET
+
+HTTP/1.1 401 authentication please swsbounce
+Server: Microsoft-IIS/6.0
+WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 0
+
+HTTP/1.1 200 A OK
+Server: Microsoft-IIS/6.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 3
+
+ok
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+# tool is what to use instead of 'curl'
+<tool>
+lib579
+</tool>
+
+ <name>
+small chunked HTTP POSTs with digest auth. and progress callback
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/579 log/ip579
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<file name="log/ip579" mode="text">
+Progress callback called with UL 0 out of 0
+Progress callback called with UL 0 out of -1
+Progress callback called with UL 8 out of -1
+Progress callback called with UL 16 out of -1
+Progress callback called with UL 26 out of -1
+Progress callback called with UL 61 out of -1
+Progress callback called with UL 66 out of -1
+</file>
+</verify>
+</testcase>
diff --git a/tests/data/test58 b/tests/data/test58
new file mode 100644
index 000000000..1bd53fa27
--- /dev/null
+++ b/tests/data/test58
@@ -0,0 +1,51 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP PUT
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.0 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+
+blablabla
+
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<name>
+HTTP PUT from file with weird letters
+</name>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/want/ -T log/58te[]st.txt -g
+</command>
+<file name="log/58te[]st.txt">
+a few bytes
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+PUT /we/want/58te%5B%5Dst.txt HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 12
+Expect: 100-continue
+
+a few bytes
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test59 b/tests/data/test59
new file mode 100644
index 000000000..1924650f5
--- /dev/null
+++ b/tests/data/test59
@@ -0,0 +1,47 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+#
+# Server-side
+<reply name="1">
+<data>
+HTTP/1.0 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+
+hej
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP URL with slash but with "parameter"
+ </name>
+ <command>
+"http://%HOSTIP:%HTTPPORT?mooo/59"
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /?mooo/59 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test6 b/tests/data/test6
new file mode 100644
index 000000000..0e7dc9b24
--- /dev/null
+++ b/tests/data/test6
@@ -0,0 +1,49 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP set cookie
+cookies
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Type: text/html
+Funny-head: yesyes
+swsclose: booo
+
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP with simple cookie send
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/want/that/page/6 -b "name=contents;name2=content2"
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /we/want/that/page/6 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Cookie: name=contents;name2=content2
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test60 b/tests/data/test60
new file mode 100644
index 000000000..df9eeee15
--- /dev/null
+++ b/tests/data/test60
@@ -0,0 +1,57 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP PUT
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.0 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+
+blablabla
+
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<name>
+HTTP PUT from stdin with wrong content-length
+</name>
+ <command>
+http://%HOSTIP:%HTTPPORT/bzz/60 -T - -H "Content-Length: 1"
+</command>
+<stdin>
+more than one byte
+</stdin>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+PUT /bzz/60 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Transfer-Encoding: chunked
+Content-Length: 1
+Expect: 100-continue
+
+13
+more than one byte
+
+0
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test600 b/tests/data/test600
new file mode 100644
index 000000000..1f3f6011c
--- /dev/null
+++ b/tests/data/test600
@@ -0,0 +1,42 @@
+<testcase>
+<info>
+<keywords>
+SFTP
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+Test data
+for ssh test
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+sftp
+</server>
+ <name>
+SFTP retrieval
+ </name>
+ <command>
+--key curl_client_key --pubkey curl_client_key.pub -u %USER: sftp://%HOSTIP:%SSHPORT%PWD/log/file600.txt --insecure
+</command>
+<file name="log/file600.txt">
+Test data
+for ssh test
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<valgrind>
+disable
+</valgrind>
+</verify>
+</testcase>
diff --git a/tests/data/test601 b/tests/data/test601
new file mode 100644
index 000000000..8e765a8ec
--- /dev/null
+++ b/tests/data/test601
@@ -0,0 +1,42 @@
+<testcase>
+<info>
+<keywords>
+SCP
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+Test data
+for ssh test
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+scp
+</server>
+ <name>
+SCP retrieval
+ </name>
+ <command>
+--key curl_client_key --pubkey curl_client_key.pub -u %USER: scp://%HOSTIP:%SSHPORT%PWD/log/file601.txt --insecure
+</command>
+<file name="log/file601.txt">
+Test data
+for ssh test
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<valgrind>
+disable
+</valgrind>
+</verify>
+</testcase>
diff --git a/tests/data/test602 b/tests/data/test602
new file mode 100644
index 000000000..6b75feb63
--- /dev/null
+++ b/tests/data/test602
@@ -0,0 +1,43 @@
+<testcase>
+<info>
+<keywords>
+SFTP
+SFTP put
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+sftp
+</server>
+ <name>
+SFTP put
+ </name>
+ <command>
+--key curl_client_key --pubkey curl_client_key.pub -u %USER: -T log/file602.txt sftp://%HOSTIP:%SSHPORT%PWD/log/upload.602 --insecure
+</command>
+<file name="log/file602.txt">
+Test data
+for ssh upload test
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<upload>
+Test data
+for ssh upload test
+</upload>
+<valgrind>
+disable
+</valgrind>
+</verify>
+</testcase>
diff --git a/tests/data/test603 b/tests/data/test603
new file mode 100644
index 000000000..efa7d2ed0
--- /dev/null
+++ b/tests/data/test603
@@ -0,0 +1,43 @@
+<testcase>
+<info>
+<keywords>
+SCP
+SCP upload
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+scp
+</server>
+ <name>
+SCP upload
+ </name>
+ <command>
+--key curl_client_key --pubkey curl_client_key.pub -u %USER: -T log/file603.txt scp://%HOSTIP:%SSHPORT%PWD/log/upload.603 --insecure
+</command>
+<file name="log/file603.txt">
+Test data
+for ssh upload test
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<upload>
+Test data
+for ssh upload test
+</upload>
+<valgrind>
+disable
+</valgrind>
+</verify>
+</testcase>
diff --git a/tests/data/test604 b/tests/data/test604
new file mode 100644
index 000000000..af0259fb9
--- /dev/null
+++ b/tests/data/test604
@@ -0,0 +1,30 @@
+<testcase>
+<info>
+<keywords>
+SFTP
+FAILURE
+</keywords>
+</info>
+
+#
+# Client-side
+<client>
+<server>
+sftp
+</server>
+ <name>
+SFTP retrieval of nonexistent file
+ </name>
+ <command>
+--key curl_client_key --pubkey curl_client_key.pub -u %USER: sftp://%HOSTIP:%SSHPORT%PWD/not-a-valid-file-moooo --insecure
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+78
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test605 b/tests/data/test605
new file mode 100644
index 000000000..1c162fca5
--- /dev/null
+++ b/tests/data/test605
@@ -0,0 +1,33 @@
+<testcase>
+<info>
+<keywords>
+SCP
+FAILURE
+</keywords>
+</info>
+
+#
+# Client-side
+<client>
+<server>
+scp
+</server>
+ <name>
+SCP retrieval of nonexistent file
+ </name>
+ <command>
+--key curl_client_key --pubkey curl_client_key.pub -u %USER: scp://%HOSTIP:%SSHPORT%PWD/not-a-valid-file-moooo --insecure
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+79
+</errorcode>
+<valgrind>
+disable
+</valgrind>
+</verify>
+</testcase>
diff --git a/tests/data/test606 b/tests/data/test606
new file mode 100644
index 000000000..80a82e9a9
--- /dev/null
+++ b/tests/data/test606
@@ -0,0 +1,33 @@
+<testcase>
+<info>
+<keywords>
+SFTP
+FAILURE
+</keywords>
+</info>
+
+#
+# Client-side
+<client>
+<server>
+sftp
+</server>
+ <name>
+SFTP invalid user login
+ </name>
+ <command>
+--key curl_client_key --pubkey curl_client_key.pub -u not-a-valid-user: sftp://%HOSTIP:%SSHPORT%PWD/not-a-valid-file-moooo --insecure
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+67
+</errorcode>
+<valgrind>
+disable
+</valgrind>
+</verify>
+</testcase>
diff --git a/tests/data/test607 b/tests/data/test607
new file mode 100644
index 000000000..e34098743
--- /dev/null
+++ b/tests/data/test607
@@ -0,0 +1,33 @@
+<testcase>
+<info>
+<keywords>
+SCP
+FAILURE
+</keywords>
+</info>
+
+#
+# Client-side
+<client>
+<server>
+scp
+</server>
+ <name>
+SCP invalid user login
+ </name>
+ <command>
+--key curl_client_key --pubkey curl_client_key.pub -u not-a-valid-user: scp://%HOSTIP:%SSHPORT%PWD/not-a-valid-file-moooo --insecure
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+67
+</errorcode>
+<valgrind>
+disable
+</valgrind>
+</verify>
+</testcase>
diff --git a/tests/data/test608 b/tests/data/test608
new file mode 100644
index 000000000..c904bff9f
--- /dev/null
+++ b/tests/data/test608
@@ -0,0 +1,49 @@
+<testcase>
+<info>
+<keywords>
+SFTP
+post-quote
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+Test file for rename test
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+sftp
+</server>
+ <name>
+SFTP post-quote rename
+ </name>
+ <command>
+--key curl_client_key --pubkey curl_client_key.pub -u %USER: -Q "-rename %PWD/log/file608.txt %PWD/log/file608-renamed.txt" sftp://%HOSTIP:%SSHPORT%PWD/log/file608.txt --insecure
+</command>
+# Verify that the file was renamed properly, then rename the file back to what
+# it was so the verify section works and the file can be cleaned up.
+<postcheck>
+perl %SRCDIR/libtest/test610.pl gone %PWD/log/file608.txt move %PWD/log/file608-renamed.txt %PWD/log/file608.txt
+</postcheck>
+<file name="log/file608.txt">
+Test file for rename test
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<file name="log/file608.txt">
+Test file for rename test
+</file>
+<valgrind>
+disable
+</valgrind>
+</verify>
+</testcase>
diff --git a/tests/data/test609 b/tests/data/test609
new file mode 100644
index 000000000..59a217520
--- /dev/null
+++ b/tests/data/test609
@@ -0,0 +1,45 @@
+<testcase>
+<info>
+<keywords>
+SFTP
+post-quote
+FAILURE
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+Test file for mkdir test
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+sftp
+</server>
+ <name>
+SFTP post-quote mkdir failure
+ </name>
+ <command>
+--key curl_client_key --pubkey curl_client_key.pub -u %USER: -Q "-mkdir %PWD/log/file609.txt" sftp://%HOSTIP:%SSHPORT%PWD/log/file609.txt --insecure
+</command>
+<file name="log/file609.txt">
+Test file for mkdir test
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+21
+</errorcode>
+<valgrind>
+disable
+</valgrind>
+</verify>
+</testcase>
diff --git a/tests/data/test61 b/tests/data/test61
new file mode 100644
index 000000000..f2a6a4ee7
--- /dev/null
+++ b/tests/data/test61
@@ -0,0 +1,71 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+cookies
+cookiejar
+HTTP replaced headers
+httponly
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Type: text/html
+Funny-head: yesyes
+Set-Cookie: test=yes; httponly; domain=foo.com; expires=Fri Feb 2 11:56:27 GMT 2035
+SET-COOKIE: test2=yes; domain=host.foo.com; expires=Fri Feb 2 11:56:27 GMT 2035
+Set-Cookie: test3=maybe; domain=foo.com; path=/moo; secure
+Set-Cookie: test4=no; domain=nope.foo.com; path=/moo; secure
+Set-Cookie: test5=name; domain=anything.com; path=/ ; secure
+Content-Length: 4
+
+boo
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP with various cookies and custom Host:
+ </name>
+# Explicitly set the time zone to a known good one, in case the user is
+# using one of the 'right' zones that take into account leap seconds
+# which causes the cookie expiry times to be different.
+<setenv>
+TZ=GMT
+</setenv>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/want/61 -c log/jar61.txt -H "Host: www.host.foo.com"
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /we/want/61 HTTP/1.1
+Accept: */*
+Host: www.host.foo.com
+
+</protocol>
+<file name="log/jar61.txt" mode="text">
+# Netscape HTTP Cookie File
+# http://curl.haxx.se/rfc/cookie_spec.html
+# This file was generated by libcurl! Edit at your own risk.
+
+#HttpOnly_.foo.com TRUE /we/want/ FALSE 2054030187 test yes
+.host.foo.com TRUE /we/want/ FALSE 2054030187 test2 yes
+.foo.com TRUE /moo TRUE 0 test3 maybe
+</file>
+</verify>
+</testcase>
diff --git a/tests/data/test610 b/tests/data/test610
new file mode 100644
index 000000000..a7c2ce389
--- /dev/null
+++ b/tests/data/test610
@@ -0,0 +1,47 @@
+<testcase>
+<info>
+<keywords>
+SFTP
+post-quote
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+Dummy test file for rmdir test
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+sftp
+</server>
+<precheck>
+perl %SRCDIR/libtest/test610.pl mkdir %PWD/log/test610.dir
+</precheck>
+ <name>
+SFTP post-quote rmdir
+ </name>
+ <command>
+--key curl_client_key --pubkey curl_client_key.pub -u %USER: -Q "-rmdir %PWD/log/test610.dir" sftp://%HOSTIP:%SSHPORT%PWD/log/file610.txt --insecure
+</command>
+<postcheck>
+perl %SRCDIR/libtest/test610.pl gone %PWD/log/test610.dir
+</postcheck>
+<file name="log/file610.txt">
+Dummy test file for rmdir test
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<valgrind>
+disable
+</valgrind>
+</verify>
+</testcase>
diff --git a/tests/data/test611 b/tests/data/test611
new file mode 100644
index 000000000..bfdddde3a
--- /dev/null
+++ b/tests/data/test611
@@ -0,0 +1,47 @@
+<testcase>
+<info>
+<keywords>
+SFTP
+post-quote
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+Dummy test file for rename test
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+sftp
+</server>
+<precheck>
+perl %SRCDIR/libtest/test610.pl mkdir %PWD/log/test611.dir
+</precheck>
+ <name>
+SFTP post-quote rename
+ </name>
+ <command>
+--key curl_client_key --pubkey curl_client_key.pub -u %USER: -Q "-rename %PWD/log/test611.dir %PWD/log/test611.new" sftp://%HOSTIP:%SSHPORT%PWD/log/file611.txt --insecure
+</command>
+<postcheck>
+perl %SRCDIR/libtest/test610.pl rmdir %PWD/log/test611.new
+</postcheck>
+<file name="log/file611.txt">
+Dummy test file for rename test
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<valgrind>
+disable
+</valgrind>
+</verify>
+</testcase>
diff --git a/tests/data/test612 b/tests/data/test612
new file mode 100644
index 000000000..a8f2a5c0b
--- /dev/null
+++ b/tests/data/test612
@@ -0,0 +1,47 @@
+<testcase>
+<info>
+<keywords>
+SFTP
+post-quote
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data nocheck="yes">
+Dummy test file for remove test
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+sftp
+</server>
+ <name>
+SFTP post-quote remove file
+ </name>
+ <command>
+--key curl_client_key --pubkey curl_client_key.pub -u %USER: -T log/file612.txt -Q "-rm %PWD/log/file612.txt" sftp://%HOSTIP:%SSHPORT%PWD/log/upload.612 --insecure
+</command>
+<postcheck>
+perl %SRCDIR/libtest/test610.pl gone %PWD/log/test612.txt
+</postcheck>
+<file name="log/file612.txt">
+Dummy test file for remove test
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<upload>
+Dummy test file for remove test
+</upload>
+<valgrind>
+disable
+</valgrind>
+</verify>
+</testcase>
diff --git a/tests/data/test613 b/tests/data/test613
new file mode 100644
index 000000000..9b0b3fd35
--- /dev/null
+++ b/tests/data/test613
@@ -0,0 +1,48 @@
+<testcase>
+<info>
+<keywords>
+SFTP
+directory
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<datacheck>
+d????????? N U U N ??? N NN:NN .
+d????????? N U U N ??? N NN:NN ..
+d????????? N U U N ??? N NN:NN asubdir
+-rw?rw?rw? 1 U U 37 Jan 1 2000 plainfile.txt
+-r-?r-?r-? 1 U U 47 Dec 31 2000 rofile.txt
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+sftp
+</server>
+<precheck>
+perl %SRCDIR/libtest/test613.pl prepare %PWD/log/test613.dir
+</precheck>
+ <name>
+SFTP directory retrieval
+ </name>
+ <command>
+--key curl_client_key --pubkey curl_client_key.pub -u %USER: sftp://%HOSTIP:%SSHPORT%PWD/log/test613.dir/ --insecure
+</command>
+<postcheck>
+perl %SRCDIR/libtest/test613.pl postprocess %PWD/log/test613.dir %PWD/log/curl613.out
+</postcheck>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<valgrind>
+disable
+</valgrind>
+</verify>
+</testcase>
diff --git a/tests/data/test614 b/tests/data/test614
new file mode 100644
index 000000000..2184a22cf
--- /dev/null
+++ b/tests/data/test614
@@ -0,0 +1,49 @@
+<testcase>
+<info>
+<keywords>
+SFTP
+pre-quote
+directory
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<datacheck>
+d????????? N U U N ??? N NN:NN .
+d????????? N U U N ??? N NN:NN ..
+d????????? N U U N ??? N NN:NN asubdir
+-r-?r-?r-? 1 U U 37 Jan 1 2000 plainfile.txt
+-r-?r-?r-? 1 U U 47 Dec 31 2000 rofile.txt
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+sftp
+</server>
+<precheck>
+perl %SRCDIR/libtest/test613.pl prepare %PWD/log/test614.dir
+</precheck>
+ <name>
+SFTP pre-quote chmod
+ </name>
+ <command>
+--key curl_client_key --pubkey curl_client_key.pub -u %USER: -Q "chmod 444 %PWD/log/test614.dir/plainfile.txt" sftp://%HOSTIP:%SSHPORT%PWD/log/test614.dir/ --insecure
+</command>
+<postcheck>
+perl %SRCDIR/libtest/test613.pl postprocess %PWD/log/test614.dir %PWD/log/curl614.out
+</postcheck>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<valgrind>
+disable
+</valgrind>
+</verify>
+</testcase>
diff --git a/tests/data/test615 b/tests/data/test615
new file mode 100644
index 000000000..abe9902a3
--- /dev/null
+++ b/tests/data/test615
@@ -0,0 +1,44 @@
+<testcase>
+<info>
+<keywords>
+SFTP
+SFTP put
+FAILURE
+</keywords>
+</info>
+
+#
+# Client-side
+<client>
+<server>
+sftp
+</server>
+<precheck>
+perl %SRCDIR/libtest/test613.pl prepare %PWD/log/test615.dir
+</precheck>
+ <name>
+SFTP put remote failure
+ </name>
+ <command>
+--key curl_client_key --pubkey curl_client_key.pub -u %USER: -T log/file615.txt sftp://%HOSTIP:%SSHPORT%PWD/log/test615.dir/rofile.txt --insecure
+</command>
+<postcheck>
+perl %SRCDIR/libtest/test613.pl postprocess %PWD/log/test615.dir
+</postcheck>
+<file name="log/file615.txt">
+Test data
+for ssh upload test
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+9
+</errorcode>
+<valgrind>
+disable
+</valgrind>
+</verify>
+</testcase>
diff --git a/tests/data/test616 b/tests/data/test616
new file mode 100644
index 000000000..a6a225de9
--- /dev/null
+++ b/tests/data/test616
@@ -0,0 +1,39 @@
+<testcase>
+<info>
+<keywords>
+SFTP
+zero-length
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data sendzero="yes">
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+sftp
+</server>
+ <name>
+SFTP retrieval of empty file
+ </name>
+ <command>
+--key curl_client_key --pubkey curl_client_key.pub -u %USER: sftp://%HOSTIP:%SSHPORT%PWD/log/file616.txt --insecure
+</command>
+<file name="log/file616.txt">
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<valgrind>
+disable
+</valgrind>
+</verify>
+</testcase>
diff --git a/tests/data/test617 b/tests/data/test617
new file mode 100644
index 000000000..4b183e4f0
--- /dev/null
+++ b/tests/data/test617
@@ -0,0 +1,39 @@
+<testcase>
+<info>
+<keywords>
+SCP
+zero-length
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data sendzero="yes">
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+scp
+</server>
+ <name>
+SCP retrieval of empty file
+ </name>
+ <command>
+--key curl_client_key --pubkey curl_client_key.pub -u %USER: scp://%HOSTIP:%SSHPORT%PWD/log/file617.txt --insecure
+</command>
+<file name="log/file617.txt">
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<valgrind>
+disable
+</valgrind>
+</verify>
+</testcase>
diff --git a/tests/data/test618 b/tests/data/test618
new file mode 100644
index 000000000..d545d6282
--- /dev/null
+++ b/tests/data/test618
@@ -0,0 +1,39 @@
+<testcase>
+<info>
+<keywords>
+SFTP
+</keywords>
+</info>
+
+#
+# Client-side
+<client>
+<server>
+sftp
+</server>
+ <name>
+SFTP retrieval of two files
+ </name>
+ <command>
+--key curl_client_key --pubkey curl_client_key.pub -u %USER: sftp://%HOSTIP:%SSHPORT%PWD/log/file618.txt sftp://%HOSTIP:%SSHPORT%PWD/log/file618.txt --insecure
+</command>
+<file name="log/file618.txt">
+Test data
+for ssh test
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<valgrind>
+disable
+</valgrind>
+<stdout>
+Test data
+for ssh test
+Test data
+for ssh test
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test619 b/tests/data/test619
new file mode 100644
index 000000000..303266fc5
--- /dev/null
+++ b/tests/data/test619
@@ -0,0 +1,39 @@
+<testcase>
+<info>
+<keywords>
+SCP
+</keywords>
+</info>
+
+#
+# Client-side
+<client>
+<server>
+scp
+</server>
+ <name>
+SCP retrieval of two files
+ </name>
+ <command>
+--key curl_client_key --pubkey curl_client_key.pub -u %USER: scp://%HOSTIP:%SSHPORT%PWD/log/file619.txt scp://%HOSTIP:%SSHPORT%PWD/log/file619.txt --insecure
+</command>
+<file name="log/file619.txt">
+Test data
+for ssh test
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<valgrind>
+disable
+</valgrind>
+<stdout>
+Test data
+for ssh test
+Test data
+for ssh test
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test62 b/tests/data/test62
new file mode 100644
index 000000000..99eca1ecc
--- /dev/null
+++ b/tests/data/test62
@@ -0,0 +1,60 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP replaced headers
+cookies
+httponly
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.0 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Type: text/html
+
+boo
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP, send cookies when using custom Host:
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/want/62 -b log/jar62.txt -H "Host: www.host.foo.com"
+</command>
+<file name="log/jar62.txt">
+# Netscape HTTP Cookie File
+# http://curl.haxx.se/rfc/cookie_spec.html
+# This file was generated by libcurl! Edit at your own risk.
+
+#HttpOnly_.foo.com TRUE /we/want/ FALSE 2054030187 test yes
+.host.foo.com TRUE /we/want/ FALSE 2054030187 test2 yes
+.fake.host.foo.com TRUE /we/want/ FALSE 2054030187 test4 yes
+
+.foo.com TRUE /moo TRUE 0 test3 maybe
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /we/want/62 HTTP/1.1
+Accept: */*
+Cookie: test2=yes; test=yes
+Host: www.host.foo.com
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test620 b/tests/data/test620
new file mode 100644
index 000000000..1750ab932
--- /dev/null
+++ b/tests/data/test620
@@ -0,0 +1,38 @@
+<testcase>
+<info>
+<keywords>
+SFTP
+FAILURE
+</keywords>
+</info>
+
+#
+# Client-side
+<client>
+<server>
+sftp
+</server>
+ <name>
+SFTP retrieval of missing file followed by good file
+ </name>
+ <command>
+--key curl_client_key --pubkey curl_client_key.pub -u %USER: sftp://%HOSTIP:%SSHPORT%PWD/log/not-a-valid-file-moooo sftp://%HOSTIP:%SSHPORT%PWD/log/file620.txt --insecure
+</command>
+<file name="log/file620.txt">
+Test data
+for ssh test
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<valgrind>
+disable
+</valgrind>
+<stdout>
+Test data
+for ssh test
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test621 b/tests/data/test621
new file mode 100644
index 000000000..c75a284ca
--- /dev/null
+++ b/tests/data/test621
@@ -0,0 +1,38 @@
+<testcase>
+<info>
+<keywords>
+SCP
+FAILURE
+</keywords>
+</info>
+
+#
+# Client-side
+<client>
+<server>
+scp
+</server>
+ <name>
+SCP retrieval of missing file followed by good file
+ </name>
+ <command>
+--key curl_client_key --pubkey curl_client_key.pub -u %USER: scp://%HOSTIP:%SSHPORT%PWD/log/not-a-valid-file-moooo scp://%HOSTIP:%SSHPORT%PWD/log/file621.txt --insecure
+</command>
+<file name="log/file621.txt">
+Test data
+for ssh test
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<valgrind>
+disable
+</valgrind>
+<stdout>
+Test data
+for ssh test
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test622 b/tests/data/test622
new file mode 100644
index 000000000..e5a769c1c
--- /dev/null
+++ b/tests/data/test622
@@ -0,0 +1,43 @@
+<testcase>
+<info>
+<keywords>
+SFTP
+SFTP put
+FAILURE
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+sftp
+</server>
+ <name>
+SFTP put failure
+ </name>
+ <command>
+--key curl_client_key --pubkey curl_client_key.pub -u %USER: -T log/file622.txt sftp://%HOSTIP:%SSHPORT%PWD/log/nonexistent-directory/nonexistent-file --insecure
+</command>
+<file name="log/file622.txt">
+Test data
+for ssh upload test
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+78
+</errorcode>
+<valgrind>
+disable
+</valgrind>
+</verify>
+</testcase>
diff --git a/tests/data/test623 b/tests/data/test623
new file mode 100644
index 000000000..19e505b23
--- /dev/null
+++ b/tests/data/test623
@@ -0,0 +1,41 @@
+<testcase>
+<info>
+<keywords>
+SCP
+SCP upload
+FAILURE
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+scp
+</server>
+ <name>
+SCP upload failure
+ </name>
+ <command>
+--key curl_client_key --pubkey curl_client_key.pub -u %USER: -T log/file623.txt scp://%HOSTIP:%SSHPORT%PWD/log/nonexistent-directory/nonexistent-file --insecure
+</command>
+<file name="log/file623.txt">
+Test data
+for ssh upload test
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+79
+</errorcode>
+
+</verify>
+</testcase>
diff --git a/tests/data/test624 b/tests/data/test624
new file mode 100644
index 000000000..fa4ff08d7
--- /dev/null
+++ b/tests/data/test624
@@ -0,0 +1,47 @@
+<testcase>
+<info>
+<keywords>
+SFTP
+SFTP put
+--ftp-create-dirs
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+sftp
+</server>
+ <name>
+SFTP put with --ftp-create-dirs
+ </name>
+ <command>
+--ftp-create-dirs --key curl_client_key --pubkey curl_client_key.pub -u %USER: -T log/file624.txt sftp://%HOSTIP:%SSHPORT%PWD/log/test624.dir/upload.624 --insecure
+</command>
+<postcheck>
+perl %SRCDIR/libtest/test610.pl move %PWD/log/test624.dir/upload.624 %PWD/log/upload.624 rmdir %PWD/log/test624.dir
+</postcheck>
+<file name="log/file624.txt">
+Test data
+for ssh upload test
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<upload>
+Test data
+for ssh upload test
+</upload>
+<valgrind>
+disable
+</valgrind>
+</verify>
+</testcase>
diff --git a/tests/data/test625 b/tests/data/test625
new file mode 100644
index 000000000..b3ec738cf
--- /dev/null
+++ b/tests/data/test625
@@ -0,0 +1,47 @@
+<testcase>
+<info>
+<keywords>
+SFTP
+SFTP put
+--ftp-create-dirs
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+sftp
+</server>
+ <name>
+SFTP put with --ftp-create-dirs twice
+ </name>
+ <command>
+--ftp-create-dirs --key curl_client_key --pubkey curl_client_key.pub -u %USER: -T log/file625.txt sftp://%HOSTIP:%SSHPORT%PWD/log/test625.a/upload.625 -T log/file625.txt sftp://%HOSTIP:%SSHPORT%PWD/log/test625.b/upload.625 --insecure
+</command>
+<postcheck>
+perl %SRCDIR/libtest/test610.pl move %PWD/log/test625.a/upload.625 %PWD/log/upload.625 rmdir %PWD/log/test625.a rm %PWD/log/test625.b/upload.625 rmdir %PWD/log/test625.b
+</postcheck>
+<file name="log/file625.txt">
+Test data
+for ssh upload test
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<upload>
+Test data
+for ssh upload test
+</upload>
+<valgrind>
+disable
+</valgrind>
+</verify>
+</testcase>
diff --git a/tests/data/test626 b/tests/data/test626
new file mode 100644
index 000000000..a8c2a6c22
--- /dev/null
+++ b/tests/data/test626
@@ -0,0 +1,42 @@
+<testcase>
+<info>
+<keywords>
+SFTP
+pre-quote
+FAILURE
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+sftp
+</server>
+ <name>
+SFTP invalid quote command
+ </name>
+ <command>
+--key curl_client_key --pubkey curl_client_key.pub -u %USER: -Q "invalid-command foo bar" sftp://%HOSTIP:%SSHPORT%PWD/log/file626.txt --insecure
+</command>
+<file name="log/file626.txt">
+Test file for rename test
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+21
+</errorcode>
+<valgrind>
+disable
+</valgrind>
+</verify>
+</testcase>
diff --git a/tests/data/test627 b/tests/data/test627
new file mode 100644
index 000000000..ae29d9b5a
--- /dev/null
+++ b/tests/data/test627
@@ -0,0 +1,46 @@
+<testcase>
+<info>
+<keywords>
+SFTP
+quote
+NOBODY
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data sendzero="yes">
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+sftp
+</server>
+ <name>
+SFTP quote remove file with NOBODY
+ </name>
+ <command>
+--key curl_client_key --pubkey curl_client_key.pub -u %USER: -I -Q "rm %PWD/log/file627.txt" sftp://%HOSTIP:%SSHPORT --insecure
+</command>
+<postcheck>
+perl %SRCDIR/libtest/test610.pl gone %PWD/log/test627.txt
+</postcheck>
+<file name="log/file627.txt">
+Dummy test file for remove test
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<valgrind>
+disable
+</valgrind>
+<protocol>
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test628 b/tests/data/test628
new file mode 100644
index 000000000..37a6f1c64
--- /dev/null
+++ b/tests/data/test628
@@ -0,0 +1,33 @@
+<testcase>
+<info>
+<keywords>
+SFTP
+FAILURE
+</keywords>
+</info>
+
+#
+# Client-side
+<client>
+<server>
+sftp
+</server>
+ <name>
+SFTP invalid user login (password authentication)
+ </name>
+ <command>
+-u not-a-valid-user: sftp://%HOSTIP:%SSHPORT%PWD/irrelevant-file --insecure
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+67
+</errorcode>
+<valgrind>
+disable
+</valgrind>
+</verify>
+</testcase>
diff --git a/tests/data/test629 b/tests/data/test629
new file mode 100644
index 000000000..0c1791494
--- /dev/null
+++ b/tests/data/test629
@@ -0,0 +1,33 @@
+<testcase>
+<info>
+<keywords>
+SCP
+FAILURE
+</keywords>
+</info>
+
+#
+# Client-side
+<client>
+<server>
+scp
+</server>
+ <name>
+SCP invalid user login (password authentication)
+ </name>
+ <command>
+-u not-a-valid-user: scp://%HOSTIP:%SSHPORT%PWD/irrelevant-file --insecure
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+67
+</errorcode>
+<valgrind>
+disable
+</valgrind>
+</verify>
+</testcase>
diff --git a/tests/data/test63 b/tests/data/test63
new file mode 100644
index 000000000..66ed1d86b
--- /dev/null
+++ b/tests/data/test63
@@ -0,0 +1,52 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP proxy
+HTTP proxy Basic auth
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Type: text/html
+Content-Length: 26
+
+the content would go here
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP with proxy authorization set in environment
+ </name>
+<setenv>
+http_proxy=http://fake:user@%HOSTIP:%HTTPPORT/
+</setenv>
+ <command>
+http://we.want.that.site.com/63
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET http://we.want.that.site.com/63 HTTP/1.1
+Proxy-Authorization: Basic ZmFrZTp1c2Vy
+Host: we.want.that.site.com
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test630 b/tests/data/test630
new file mode 100644
index 000000000..e2f6ff95f
--- /dev/null
+++ b/tests/data/test630
@@ -0,0 +1,34 @@
+<testcase>
+<info>
+<keywords>
+SFTP
+FAILURE
+server key check
+</keywords>
+</info>
+
+#
+# Client-side
+<client>
+<server>
+sftp
+</server>
+ <name>
+SFTP incorrect host key
+ </name>
+ <command>
+--hostpubmd5 00000000000000000000000000000000 --key curl_client_key --pubkey curl_client_key.pub -u %USER: sftp://%HOSTIP:%SSHPORT%PWD/log/irrelevant-file --insecure
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+51
+</errorcode>
+<valgrind>
+disable
+</valgrind>
+</verify>
+</testcase>
diff --git a/tests/data/test631 b/tests/data/test631
new file mode 100644
index 000000000..47b0acbb5
--- /dev/null
+++ b/tests/data/test631
@@ -0,0 +1,34 @@
+<testcase>
+<info>
+<keywords>
+SCP
+FAILURE
+server key check
+</keywords>
+</info>
+
+#
+# Client-side
+<client>
+<server>
+scp
+</server>
+ <name>
+SCP incorrect host key
+ </name>
+ <command>
+--hostpubmd5 00000000000000000000000000000000 --key curl_client_key --pubkey curl_client_key.pub -u %USER: scp://%HOSTIP:%SSHPORT%PWD/log/irrelevant-file --insecure
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+51
+</errorcode>
+<valgrind>
+disable
+</valgrind>
+</verify>
+</testcase>
diff --git a/tests/data/test632 b/tests/data/test632
new file mode 100644
index 000000000..2da0c798b
--- /dev/null
+++ b/tests/data/test632
@@ -0,0 +1,34 @@
+<testcase>
+<info>
+<keywords>
+SFTP
+FAILURE
+server key check
+</keywords>
+</info>
+
+#
+# Client-side
+<client>
+<server>
+none
+</server>
+<features>
+sftp
+</features>
+ <name>
+SFTP syntactically invalid host key
+ </name>
+ <command>
+--hostpubmd5 00 --key curl_client_key --pubkey curl_client_key.pub -u %USER: sftp://%HOSTIP:%SSHPORT%PWD/log/irrelevant-file --insecure
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+2
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test633 b/tests/data/test633
new file mode 100644
index 000000000..adfd109e0
--- /dev/null
+++ b/tests/data/test633
@@ -0,0 +1,42 @@
+<testcase>
+<info>
+<keywords>
+SFTP
+Range
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+data
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+sftp
+</server>
+ <name>
+SFTP retrieval with byte range
+ </name>
+ <command>
+--key curl_client_key --pubkey curl_client_key.pub -u %USER: sftp://%HOSTIP:%SSHPORT%PWD/log/file633.txt -r 5-9 --insecure
+</command>
+<file name="log/file633.txt">
+Test data
+for ssh test
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<valgrind>
+disable
+</valgrind>
+</verify>
+</testcase>
diff --git a/tests/data/test634 b/tests/data/test634
new file mode 100644
index 000000000..1fbb87925
--- /dev/null
+++ b/tests/data/test634
@@ -0,0 +1,43 @@
+<testcase>
+<info>
+<keywords>
+SFTP
+Range
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+data
+for ssh test
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+sftp
+</server>
+ <name>
+SFTP retrieval with byte range past end of file
+ </name>
+ <command>
+--key curl_client_key --pubkey curl_client_key.pub -u %USER: sftp://%HOSTIP:%SSHPORT%PWD/log/file634.txt -r 5-99 --insecure
+</command>
+<file name="log/file634.txt">
+Test data
+for ssh test
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<valgrind>
+disable
+</valgrind>
+</verify>
+</testcase>
diff --git a/tests/data/test635 b/tests/data/test635
new file mode 100644
index 000000000..a54929d4c
--- /dev/null
+++ b/tests/data/test635
@@ -0,0 +1,42 @@
+<testcase>
+<info>
+<keywords>
+SFTP
+Range
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+ssh test
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+sftp
+</server>
+ <name>
+SFTP retrieval with byte range relative to end of file
+ </name>
+ <command>
+--key curl_client_key --pubkey curl_client_key.pub -u %USER: sftp://%HOSTIP:%SSHPORT%PWD/log/file635.txt -r -9 --insecure
+</command>
+<file name="log/file635.txt">
+Test data
+for ssh test
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<valgrind>
+disable
+</valgrind>
+</verify>
+</testcase>
diff --git a/tests/data/test636 b/tests/data/test636
new file mode 100644
index 000000000..df4ee7e63
--- /dev/null
+++ b/tests/data/test636
@@ -0,0 +1,43 @@
+<testcase>
+<info>
+<keywords>
+SFTP
+Range
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+data
+for ssh test
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+sftp
+</server>
+ <name>
+SFTP retrieval with X- byte range
+ </name>
+ <command>
+--key curl_client_key --pubkey curl_client_key.pub -u %USER: sftp://%HOSTIP:%SSHPORT%PWD/log/file636.txt -r 5- --insecure
+</command>
+<file name="log/file636.txt">
+Test data
+for ssh test
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<valgrind>
+disable
+</valgrind>
+</verify>
+</testcase>
diff --git a/tests/data/test637 b/tests/data/test637
new file mode 100644
index 000000000..ef0c81435
--- /dev/null
+++ b/tests/data/test637
@@ -0,0 +1,44 @@
+<testcase>
+<info>
+<keywords>
+SFTP
+Range
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+sftp
+</server>
+ <name>
+SFTP retrieval with invalid X- range
+ </name>
+ <command>
+--key curl_client_key --pubkey curl_client_key.pub -u %USER: sftp://%HOSTIP:%SSHPORT%PWD/log/file637.txt -r 99- --insecure
+</command>
+<file name="log/file637.txt">
+Test data
+for ssh test
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+36
+</errorcode>
+<valgrind>
+disable
+</valgrind>
+</verify>
+</testcase>
diff --git a/tests/data/test64 b/tests/data/test64
new file mode 100644
index 000000000..6bd82a8e2
--- /dev/null
+++ b/tests/data/test64
@@ -0,0 +1,83 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP Digest auth
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 401 Authorization Required swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 26
+
+This is not the real page
+</data>
+
+# This is supposed to be returned when the server gets a
+# Authorization: Digest line passed-in from the client
+<data1000>
+HTTP/1.1 200 OK swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 23
+
+This IS the real page!
+</data1000>
+
+<datacheck>
+HTTP/1.1 401 Authorization Required swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 26
+
+HTTP/1.1 200 OK swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 23
+
+This IS the real page!
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+crypto
+</features>
+ <name>
+HTTP with Digest authorization
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/64 -u testuser:testpass --digest
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /64 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /64 HTTP/1.1
+Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/64", response="c55f7f30d83d774a3d2dcacf725abaca"
+User-Agent: curl/7.10.5 (i686-pc-linux-gnu) libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test65 b/tests/data/test65
new file mode 100644
index 000000000..8582a0ca8
--- /dev/null
+++ b/tests/data/test65
@@ -0,0 +1,83 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP Digest auth
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 401 Authorization Required
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+WWW-Authenticate: Digest realm="testrealm", nonce="2053604145"
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 26
+
+This is not the real page
+</data>
+
+# This is supposed to be returned when the server gets a
+# Authorization: Digest line passed-in from the client
+<data1000>
+HTTP/1.1 401 Still a bad password you moron
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 34
+
+This is not the real page either
+</data1000>
+
+<datacheck>
+HTTP/1.1 401 Authorization Required
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+WWW-Authenticate: Digest realm="testrealm", nonce="2053604145"
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 26
+
+HTTP/1.1 401 Still a bad password you moron
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 34
+
+This is not the real page either
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+crypto
+</features>
+ <name>
+HTTP with Digest authorization with bad password
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/65 -u testuser:test2pass --digest
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /65 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /65 HTTP/1.1
+Authorization: Digest username="testuser", realm="testrealm", nonce="2053604145", uri="/65", response="66d68d3251f1839576ba7c766cf9205b"
+User-Agent: curl/7.10.5 (i686-pc-linux-gnu) libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test66 b/tests/data/test66
new file mode 100644
index 000000000..a018d8fd4
--- /dev/null
+++ b/tests/data/test66
@@ -0,0 +1,41 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+no headers swsclose
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET without headers in the response
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/66
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /66 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test67 b/tests/data/test67
new file mode 100644
index 000000000..bfe6edd26
--- /dev/null
+++ b/tests/data/test67
@@ -0,0 +1,100 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP NTLM auth
+</keywords>
+</info>
+# Server-side
+<reply>
+
+<!-- no <data> in this test since we have NTLM from the start
+
+This is supposed to be returned when the server gets a first
+Authorization: NTLM line passed-in from the client -->
+
+<data1001>
+HTTP/1.1 401 Now gimme that second request of crap
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 34
+WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+
+This is not the real page either!
+</data1001>
+
+# This is supposed to be returned when the server gets the second
+# Authorization: NTLM line passed-in from the client
+<data1002>
+HTTP/1.1 200 Things are fine in server land swsclose
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 32
+
+Finally, this is the real page!
+</data1002>
+
+<datacheck>
+HTTP/1.1 401 Now gimme that second request of crap
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 34
+WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+
+HTTP/1.1 200 Things are fine in server land swsclose
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 32
+
+Finally, this is the real page!
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+<features>
+NTLM
+</features>
+<server>
+http
+</server>
+ <name>
+HTTP with NTLM authorization
+ </name>
+ <setenv>
+# we force our own host name, in order to make the test machine independent
+CURL_GETHOSTNAME=curlhost
+# we try to use the LD_PRELOAD hack, if not a debug build
+LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
+ </setenv>
+ <command>
+http://%HOSTIP:%HTTPPORT/67 -u testuser:testpass --ntlm
+</command>
+<precheck>
+chkhostname curlhost
+</precheck>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /67 HTTP/1.1
+Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
+User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /67 HTTP/1.1
+Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoKBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyY3VybGhvc3Q=
+User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test68 b/tests/data/test68
new file mode 100644
index 000000000..10b4429c3
--- /dev/null
+++ b/tests/data/test68
@@ -0,0 +1,99 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP NTLM auth
+</keywords>
+</info>
+# Server-side
+<reply>
+
+# This is supposed to be returned when the server gets a first
+# Authorization: NTLM line passed-in from the client
+<data1001>
+HTTP/1.1 401 Now gimme that second request of crap
+Server: Microsoft-IIS/5.0
+Content-Length: 34
+Content-Type: text/html; charset=iso-8859-1
+WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+
+This is not the real page either!
+</data1001>
+
+# This is supposed to be returned when the server gets the second
+# Authorization: NTLM line passed-in from the client
+<data1002>
+HTTP/1.1 401 You give me wrong password
+Server: Microsoft-IIS/5.0
+WWW-Authenticate: NTLM
+Content-Length: 46
+Content-Type: text/html; charset=iso-8859-1
+
+Wrong password dude. Get it fixed and return.
+</data1002>
+
+<datacheck>
+HTTP/1.1 401 Now gimme that second request of crap
+Server: Microsoft-IIS/5.0
+Content-Length: 34
+Content-Type: text/html; charset=iso-8859-1
+WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+
+HTTP/1.1 401 You give me wrong password
+Server: Microsoft-IIS/5.0
+WWW-Authenticate: NTLM
+Content-Length: 46
+Content-Type: text/html; charset=iso-8859-1
+
+Wrong password dude. Get it fixed and return.
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+<features>
+NTLM
+</features>
+<server>
+http
+</server>
+ <name>
+HTTP with NTLM authorization and wrong password
+ </name>
+ <setenv>
+# we force our own host name, in order to make the test machine independent
+CURL_GETHOSTNAME=curlhost
+# we try to use the LD_PRELOAD hack, if not a debug build
+LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
+ </setenv>
+ <command>
+http://%HOSTIP:%HTTPPORT/68 -u testuser:testpass --ntlm
+</command>
+<precheck>
+chkhostname curlhost
+</precheck>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /68 HTTP/1.1
+Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
+User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /68 HTTP/1.1
+Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoKBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyY3VybGhvc3Q=
+User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test69 b/tests/data/test69
new file mode 100644
index 000000000..441aed7e8
--- /dev/null
+++ b/tests/data/test69
@@ -0,0 +1,121 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP NTLM auth
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 401 Authorization Required swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+WWW-Authenticate: Basic
+WWW-Authenticate: Wild-and-crazy
+WWW-Authenticate: NTLM
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 26
+
+This is not the real page
+</data>
+
+# This is supposed to be returned when the server gets a first
+# Authorization: NTLM line passed-in from the client
+<data1001>
+HTTP/1.1 401 Now gimme that second request of crap
+Server: Microsoft-IIS/5.0
+Content-Length: 34
+Content-Type: text/html; charset=iso-8859-1
+WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+
+This is not the real page either!
+</data1001>
+
+# This is supposed to be returned when the server gets the second
+# Authorization: NTLM line passed-in from the client
+<data1002>
+HTTP/1.1 200 Things are fine in server land swsclose
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 32
+
+Finally, this is the real page!
+</data1002>
+
+<datacheck>
+HTTP/1.1 401 Authorization Required swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+WWW-Authenticate: Basic
+WWW-Authenticate: Wild-and-crazy
+WWW-Authenticate: NTLM
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 26
+
+HTTP/1.1 401 Now gimme that second request of crap
+Server: Microsoft-IIS/5.0
+Content-Length: 34
+Content-Type: text/html; charset=iso-8859-1
+WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+
+HTTP/1.1 200 Things are fine in server land swsclose
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 32
+
+Finally, this is the real page!
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+<features>
+NTLM
+</features>
+<server>
+http
+</server>
+ <name>
+HTTP with NTLM, Basic or Wild-and-crazy authorization
+ </name>
+ <setenv>
+# we force our own host name, in order to make the test machine independent
+CURL_GETHOSTNAME=curlhost
+# we try to use the LD_PRELOAD hack, if not a debug build
+LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
+ </setenv>
+ <command>
+http://%HOSTIP:%HTTPPORT/69 -u testuser:testpass --anyauth
+</command>
+<precheck>
+chkhostname curlhost
+</precheck>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /69 HTTP/1.1
+User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /69 HTTP/1.1
+Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
+User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /69 HTTP/1.1
+Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoKBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyY3VybGhvc3Q=
+User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test7 b/tests/data/test7
new file mode 100644
index 000000000..62731de13
--- /dev/null
+++ b/tests/data/test7
@@ -0,0 +1,62 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+cookies
+header dump
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Type: text/html
+Funny-head: yesyes swsclose
+Set-Cookie: foobar=name; domain=127.0.0.1; path=/;
+Set-Cookie: mismatch=this; domain=127.0.0.1; path="/silly/";
+Set-Cookie: partmatch=present; domain=.0.0.1; path=/;
+
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP with cookie parser and header recording
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/want/7 -b none -D log/heads7.txt
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /we/want/7 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+<file name="log/heads7.txt">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Type: text/html
+Funny-head: yesyes swsclose
+Set-Cookie: foobar=name; domain=127.0.0.1; path=/;
+Set-Cookie: mismatch=this; domain=127.0.0.1; path="/silly/";
+Set-Cookie: partmatch=present; domain=.0.0.1; path=/;
+
+</file>
+</verify>
+</testcase>
diff --git a/tests/data/test70 b/tests/data/test70
new file mode 100644
index 000000000..2fc032746
--- /dev/null
+++ b/tests/data/test70
@@ -0,0 +1,87 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP Digest auth
+--anyauth
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 401 Authorization Required
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+WWW-Authenticate: Digest realm="testrealm", nonce="1053604199"
+WWW-Authenticate: NTLM
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 26
+
+This is not the real page
+</data>
+
+# This is supposed to be returned when the server gets a
+# Authorization: Digest line passed-in from the client
+<data1000>
+HTTP/1.1 200 OK
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 23
+
+This IS the real page!
+</data1000>
+
+<datacheck>
+HTTP/1.1 401 Authorization Required
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+WWW-Authenticate: Digest realm="testrealm", nonce="1053604199"
+WWW-Authenticate: NTLM
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 26
+
+HTTP/1.1 200 OK
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 23
+
+This IS the real page!
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+<features>
+NTLM
+</features>
+<server>
+http
+</server>
+ <name>
+HTTP with Digest *OR* NTLM authorization
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/70 -u testuser:testpass --anyauth
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /70 HTTP/1.1
+User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /70 HTTP/1.1
+Authorization: Digest username="testuser", realm="testrealm", nonce="1053604199", uri="/70", response="2c9a6f00af0d86497b177b90e90c688a"
+User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test700 b/tests/data/test700
new file mode 100644
index 000000000..ce6f894fd
--- /dev/null
+++ b/tests/data/test700
@@ -0,0 +1,57 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+SOCKS4
+</keywords>
+</info>
+
+#
+# Server-side
+<reply name="1">
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+-foo-
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+socks4
+</server>
+ <name>
+HTTP GET via SOCKS4 proxy
+ </name>
+ <command>
+--socks4 %HOSTIP:%SOCKSPORT http://%HOSTIP:%HTTPPORT/700
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /700 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test701 b/tests/data/test701
new file mode 100644
index 000000000..014aca249
--- /dev/null
+++ b/tests/data/test701
@@ -0,0 +1,57 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+SOCKS5
+</keywords>
+</info>
+
+#
+# Server-side
+<reply name="1">
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+-foo-
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+socks5
+</server>
+ <name>
+HTTP GET via SOCKS5 proxy
+ </name>
+ <command>
+--socks5 %HOSTIP:%SOCKSPORT http://%HOSTIP:%HTTPPORT/701
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /701 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test702 b/tests/data/test702
new file mode 100644
index 000000000..36af71328
--- /dev/null
+++ b/tests/data/test702
@@ -0,0 +1,39 @@
+<testcase>
+#based off 19
+<info>
+<keywords>
+HTTP
+SOCKS4
+connect to non-listen
+FAILURE
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+socks4
+</server>
+<features>
+http
+</features>
+ <name>
+Attempt connect to non-listening HTTP server via SOCKS4 proxy
+ </name>
+ <command>
+--socks4 %HOSTIP:%SOCKSPORT http://%HOSTIP:60000
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+7
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test703 b/tests/data/test703
new file mode 100644
index 000000000..4aa89b46a
--- /dev/null
+++ b/tests/data/test703
@@ -0,0 +1,39 @@
+<testcase>
+#based off 19
+<info>
+<keywords>
+HTTP
+SOCKS5
+connect to non-listen
+FAILURE
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+socks5
+</server>
+<features>
+http
+</features>
+ <name>
+Attempt connect to non-listening HTTP server via SOCKS5 proxy
+ </name>
+ <command>
+--socks5 %HOSTIP:%SOCKSPORT http://%HOSTIP:60000
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+7
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test704 b/tests/data/test704
new file mode 100644
index 000000000..15a1b6701
--- /dev/null
+++ b/tests/data/test704
@@ -0,0 +1,36 @@
+<testcase>
+#based off 19
+<info>
+<keywords>
+HTTP
+SOCKS4
+connect to non-listen
+FAILURE
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+Attempt connect to non-listening SOCKS4 proxy
+ </name>
+ <command>
+--socks4 %HOSTIP:60000 http://%HOSTIP:%HTTPPORT/704
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+7
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test705 b/tests/data/test705
new file mode 100644
index 000000000..3b904c6b1
--- /dev/null
+++ b/tests/data/test705
@@ -0,0 +1,36 @@
+<testcase>
+#based off 19
+<info>
+<keywords>
+HTTP
+SOCKS5
+connect to non-listen
+FAILURE
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+Attempt connect to non-listening SOCKS5 proxy
+ </name>
+ <command>
+--socks5 %HOSTIP:60000 http://%HOSTIP:%HTTPPORT/705
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+7
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test706 b/tests/data/test706
new file mode 100644
index 000000000..330cb2393
--- /dev/null
+++ b/tests/data/test706
@@ -0,0 +1,59 @@
+<testcase>
+#based off test 100
+<info>
+<keywords>
+FTP
+PASV
+LIST
+SOCKS4
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+# When doing LIST, we get the default list output hard-coded in the test
+# FTP server
+<datacheck>
+total 20
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
+drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
+-r--r--r-- 1 0 1 35 Jul 16 1996 README
+lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
+dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
+drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
+dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
+drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
+dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+ftp
+socks4
+</server>
+ <name>
+FTP dir list PASV via SOCKS4
+ </name>
+ <command>
+--socks4 %HOSTIP:%SOCKSPORT ftp://%HOSTIP:%FTPPORT/
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE A
+LIST
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test707 b/tests/data/test707
new file mode 100644
index 000000000..c3a862178
--- /dev/null
+++ b/tests/data/test707
@@ -0,0 +1,59 @@
+<testcase>
+#based off test 100
+<info>
+<keywords>
+FTP
+PASV
+LIST
+SOCKS5
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+# When doing LIST, we get the default list output hard-coded in the test
+# FTP server
+<datacheck>
+total 20
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
+drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
+drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
+-r--r--r-- 1 0 1 35 Jul 16 1996 README
+lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
+dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
+drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
+dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
+drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
+dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+ftp
+socks5
+</server>
+ <name>
+FTP dir list PASV via SOCKS5
+ </name>
+ <command>
+--socks5 %HOSTIP:%SOCKSPORT ftp://%HOSTIP:%FTPPORT/
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous
+PASS ftp@example.com
+PWD
+EPSV
+TYPE A
+LIST
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test71 b/tests/data/test71
new file mode 100644
index 000000000..b71f969e7
--- /dev/null
+++ b/tests/data/test71
@@ -0,0 +1,79 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP FORMPOST
+config file
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 11
+
+blablabla
+
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP and -F upload in config file
+ </name>
+<stdin>
+-F name=daniel
+-F tool=curl
+-F file=@log/test71.txt
+</stdin>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/want/71 -K -
+</command>
+# We create this file before the command is invoked!
+<file name="log/test71.txt">
+foo-
+This is a moo-
+bar
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^(User-Agent:|Content-Type: multipart/form-data;|------------).*
+</strip>
+<protocol>
+POST /we/want/71 HTTP/1.1
+User-Agent: curl/7.10.4 (i686-pc-linux-gnu) libcurl/7.10.4 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 408
+Expect: 100-continue
+Content-Type: multipart/form-data; boundary=----------------------------9ef8d6205763
+
+------------------------------9ef8d6205763
+Content-Disposition: form-data; name="name"
+
+daniel
+------------------------------9ef8d6205763
+Content-Disposition: form-data; name="tool"
+
+curl
+------------------------------9ef8d6205763
+Content-Disposition: form-data; name="file"; filename="test71.txt"
+Content-Type: text/plain
+
+foo-
+This is a moo-
+bar
+
+------------------------------9ef8d6205763--
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test72 b/tests/data/test72
new file mode 100644
index 000000000..5c24271f8
--- /dev/null
+++ b/tests/data/test72
@@ -0,0 +1,86 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP Digest auth
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 401 Authorization Required
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+WWW-Authenticate: Basic realm="foothis"
+WWW-Authenticate: Digest realm="testrealm", nonce="1053604199"
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 26
+
+This is not the real page
+</data>
+
+# This is supposed to be returned when the server gets a
+# Authorization: Digest line passed-in from the client
+<data1000>
+HTTP/1.1 200 OK
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 23
+
+This IS the real page!
+</data1000>
+
+<datacheck>
+HTTP/1.1 401 Authorization Required
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+WWW-Authenticate: Basic realm="foothis"
+WWW-Authenticate: Digest realm="testrealm", nonce="1053604199"
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 26
+
+HTTP/1.1 200 OK
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 23
+
+This IS the real page!
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+crypto
+</features>
+ <name>
+HTTP with Digest *OR* Basic authorization
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/72 -u testuser:testpass --anyauth
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /72 HTTP/1.1
+User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /72 HTTP/1.1
+Authorization: Digest username="testuser", realm="testrealm", nonce="1053604199", uri="/72", response="9fcd1330377365a09bbcb33b2cbb25bd"
+User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test73 b/tests/data/test73
new file mode 100644
index 000000000..dec08010e
--- /dev/null
+++ b/tests/data/test73
@@ -0,0 +1,55 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+cookies
+cookiejar
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Type: text/html
+Set-Cookie: IPCZQX01af0fca5c=000010008168c200d25dfc4b; path=/; domain=.NOT_DISCLOSED.se
+Content-Length: 4
+
+boo
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP, receive cookies when using custom Host:, domain using only two dots
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/want/73 -c log/jar73.txt -H "Host: host.NOT_DISCLOSED.se"
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /we/want/73 HTTP/1.1
+Accept: */*
+Host: host.NOT_DISCLOSED.se
+
+</protocol>
+<file name="log/jar73.txt" mode="text">
+# Netscape HTTP Cookie File
+# http://curl.haxx.se/rfc/cookie_spec.html
+# This file was generated by libcurl! Edit at your own risk.
+
+.NOT_DISCLOSED.se TRUE / FALSE 0 IPCZQX01af0fca5c 000010008168c200d25dfc4b
+</file>
+</verify>
+</testcase>
diff --git a/tests/data/test74 b/tests/data/test74
new file mode 100644
index 000000000..4c08e26eb
--- /dev/null
+++ b/tests/data/test74
@@ -0,0 +1,74 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+{} list
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Content-Type: text/html
+Funny-head: yesyes
+
+-foo-
+</data>
+<data1>
+HTTP/1.0 200 OK
+Content-Type: text/html
+Funny-head: swsclose
+Connection: close
+
+crap data
+</data1>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP, urlglob {}-retrieval and -o #[num] usage
+ </name>
+ <command option="no-output">
+"http://%HOSTIP:%HTTPPORT/{74,740001}" -o "log/dumpit#1.dump"
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /74 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /740001 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+<file name="log/dumpit740001.dump">
+HTTP/1.0 200 OK
+Content-Type: text/html
+Funny-head: swsclose
+Connection: close
+
+crap data
+</file>
+</verify>
+</testcase>
diff --git a/tests/data/test75 b/tests/data/test75
new file mode 100644
index 000000000..07f6990b7
--- /dev/null
+++ b/tests/data/test75
@@ -0,0 +1,49 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+FAILURE
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+none
+</server>
+<features>
+http
+</features>
+ <name>
+HTTP, urlglob retrieval with bad range
+ </name>
+ <command option="no-output">
+"http://%HOSTIP:%HTTPPORT/[2-1]" -o "log/weee#1.dump" --stderr -
+</command>
+# The error message on stdout implicitly depends on the length of the
+# URL, so refuse to run if the length is unexpected.
+<precheck>
+perl %SRCDIR/libtest/test75.pl http://%HOSTIP:%HTTPPORT/ 22
+</precheck>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<errorcode>
+3
+</errorcode>
+<stdout mode="text">
+curl: (3) [globbing] error: bad range specification after pos 24
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test76 b/tests/data/test76
new file mode 100644
index 000000000..ada3a3359
--- /dev/null
+++ b/tests/data/test76
@@ -0,0 +1,39 @@
+<testcase>
+<info>
+<keywords>
+FAILURE
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+none
+</server>
+<features>
+http
+</features>
+ <name>
+HTTP, -O with no file name part in the URL
+ </name>
+ <command option="no-output">
+http://%HOSTIP:%HTTPPORT/76/ -O
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<errorcode>
+23
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test77 b/tests/data/test77
new file mode 100644
index 000000000..90f4563b2
--- /dev/null
+++ b/tests/data/test77
@@ -0,0 +1,55 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+-z
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2010 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+
+-foo-
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP with -z "older date"
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/77 -z "dec 12 12:00:00 1999 GMT"
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /77 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+If-Modified-Since: Sun, 12 Dec 1999 12:00:00 GMT
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test78 b/tests/data/test78
new file mode 100644
index 000000000..aa889c50f
--- /dev/null
+++ b/tests/data/test78
@@ -0,0 +1,67 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+-z
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 1990 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+-foo-
+</data>
+<datacheck>
+HTTP/1.1 200 OK
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 1990 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP with -z "newer date"
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/78 -z "dec 12 11:00:00 1999 GMT"
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /78 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+If-Modified-Since: Sun, 12 Dec 1999 11:00:00 GMT
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test79 b/tests/data/test79
new file mode 100644
index 000000000..b2566e229
--- /dev/null
+++ b/tests/data/test79
@@ -0,0 +1,55 @@
+<testcase>
+<info>
+<keywords>
+FTP
+HTTP
+HTTP GET
+HTTP proxy
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.0 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/html
+Funny-head: yesyes
+
+contents
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+ftp
+</features>
+ <name>
+FTP over HTTP proxy
+ </name>
+ <command>
+ftp://%HOSTIP:%HTTPPORT/we/want/that/page/79 -x %HOSTIP:%HTTPPORT
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET ftp://%HOSTIP:%HTTPPORT/we/want/that/page/79 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test8 b/tests/data/test8
new file mode 100644
index 000000000..4a6e00455
--- /dev/null
+++ b/tests/data/test8
@@ -0,0 +1,63 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+cookies
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP with cookie parsing from header file
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/want/8 -b log/heads8.txt
+</command>
+
+# We create this file before the command is invoked!
+<file name="log/heads8.txt">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Type: text/html
+Funny-head: yesyes
+Set-Cookie: foobar=name; domain=127.0.0.1; path=/;
+Set-Cookie: mismatch=this; domain=127.0.0.1; path="/silly/";
+Set-Cookie: partmatch=present; domain=.0.0.1; path=/w;
+Set-Cookie: duplicate=test; domain=.0.0.1; domain=.0.0.1; path=/donkey;
+Set-Cookie: cookie=yes; path=/we;
+Set-Cookie: cookie=perhaps; path=/we/want;
+Set-Cookie: nocookie=yes; path=/WE;
+Set-Cookie: blexp=yesyes; domain=.0.0.1; domain=.0.0.1; expiry=totally bad;
+
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /we/want/8 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Cookie: cookie=perhaps; cookie=yes; partmatch=present; foobar=name; blexp=yesyes
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test80 b/tests/data/test80
new file mode 100644
index 000000000..a405af7a1
--- /dev/null
+++ b/tests/data/test80
@@ -0,0 +1,76 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP CONNECT
+HTTP Basic auth
+HTTP proxy
+HTTP proxy Basic auth
+proxytunnel
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/html
+Funny-head: yesyes
+Content-Length: 9
+
+contents
+</data>
+<datacheck>
+HTTP/1.1 200 Mighty fine indeed
+
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/html
+Funny-head: yesyes
+Content-Length: 9
+
+contents
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP 1.0 CONNECT with proxytunnel and host Basic authentication
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/want/that/page/80 -p --proxy1.0 %HOSTIP:%HTTPPORT --user iam:myself --proxy-user youare:yourself
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+CONNECT %HOSTIP:%HTTPPORT HTTP/1.0
+Host: %HOSTIP:%HTTPPORT
+Proxy-Authorization: Basic eW91YXJlOnlvdXJzZWxm
+User-Agent: curl/7.10.7-pre2 (i686-pc-linux-gnu) libcurl/7.10.7-pre2 OpenSSL/0.9.7a zlib/1.1.3
+Proxy-Connection: Keep-Alive
+
+GET /we/want/that/page/80 HTTP/1.1
+Authorization: Basic aWFtOm15c2VsZg==
+User-Agent: curl/7.10.7-pre2 (i686-pc-linux-gnu) libcurl/7.10.7-pre2 OpenSSL/0.9.7a zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test800 b/tests/data/test800
new file mode 100644
index 000000000..3281b632d
--- /dev/null
+++ b/tests/data/test800
@@ -0,0 +1,47 @@
+<testcase>
+<info>
+<keywords>
+POP3
+RETR
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+From: me@somewhere
+To: fake@nowhere
+
+body
+
+--
+ yours sincerely
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+pop3
+</server>
+ <name>
+POP3 RETR
+ </name>
+ <command>
+pop3://%HOSTIP:%POP3PORT/800 -u user:secret
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER user
+PASS secret
+RETR 800
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test801 b/tests/data/test801
new file mode 100644
index 000000000..271d8d1f7
--- /dev/null
+++ b/tests/data/test801
@@ -0,0 +1,47 @@
+<testcase>
+<info>
+<keywords>
+IMAP
+FETCH
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+From: me@somewhere
+To: fake@nowhere
+
+body
+
+--
+ yours sincerely
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+imap
+</server>
+ <name>
+IMAP FETCH
+ </name>
+ <command>
+imap://%HOSTIP:%IMAPPORT/801 -u user:secret
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+B LOGIN user secret
+C SELECT 801
+D FETCH 1 BODY[TEXT]
+A LOGOUT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test802 b/tests/data/test802
new file mode 100644
index 000000000..7027c802d
--- /dev/null
+++ b/tests/data/test802
@@ -0,0 +1,53 @@
+<testcase>
+<info>
+<keywords>
+SMTP
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+smtp
+</server>
+ <name>
+SMTP
+ </name>
+<stdin>
+From: different
+To: another
+
+body
+</stdin>
+ <command>
+smtp://%HOSTIP:%SMTPPORT/user --mail-rcpt 802@foo --mail-rcpt 802@foobar.example --mail-from 802@from -T -
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+EHLO user
+MAIL FROM:802@from
+RCPT TO:<802@foo>
+RCPT TO:<802@foobar.example>
+DATA
+QUIT
+</protocol>
+<upload>
+From: different
+To: another
+
+body
+
+.
+</upload>
+</verify>
+</testcase>
diff --git a/tests/data/test803 b/tests/data/test803
new file mode 100644
index 000000000..24ff0d001
--- /dev/null
+++ b/tests/data/test803
@@ -0,0 +1,64 @@
+<testcase>
+<info>
+<keywords>
+SMTP
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+smtp
+</server>
+ <name>
+SMTP with CRLF-dot-CRLF in data
+ </name>
+<stdin>
+From: different
+To: another
+
+
+.
+.
+
+.
+
+body
+</stdin>
+ <command>
+smtp://%HOSTIP:%SMTPPORT/user --mail-rcpt 803@foo --mail-from 803@from -T -
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+EHLO user
+MAIL FROM:803@from
+RCPT TO:<803@foo>
+DATA
+QUIT
+</protocol>
+<upload>
+From: different
+To: another
+
+
+..
+..
+
+..
+
+body
+
+.
+</upload>
+</verify>
+</testcase>
diff --git a/tests/data/test804 b/tests/data/test804
new file mode 100644
index 000000000..3d490c52b
--- /dev/null
+++ b/tests/data/test804
@@ -0,0 +1,59 @@
+<testcase>
+<info>
+<keywords>
+SMTP
+SMTP HELO
+RFC821
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<servercmd>
+REPLY EHLO 500 Command unrecognized
+REPLY HELO 250 Already old but still servicing...
+</servercmd>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+smtp
+</server>
+ <name>
+RFC821-only SMTP server (EHLO not supported)
+ </name>
+<stdin>
+From: different
+To: another
+
+body
+</stdin>
+ <command>
+smtp://%HOSTIP:%SMTPPORT/user --mail-rcpt 804@foo --mail-from 804@from -T -
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+EHLO user
+HELO user
+MAIL FROM:804@from
+RCPT TO:<804@foo>
+DATA
+QUIT
+</protocol>
+<upload>
+From: different
+To: another
+
+body
+
+.
+</upload>
+</verify>
+</testcase>
diff --git a/tests/data/test805 b/tests/data/test805
new file mode 100644
index 000000000..fba5124f3
--- /dev/null
+++ b/tests/data/test805
@@ -0,0 +1,54 @@
+<testcase>
+<info>
+<keywords>
+SMTP
+SMTP AUTH PLAIN
+RFC4616
+RFC4954
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<servercmd>
+REPLY EHLO 220 AUTH PLAIN
+REPLY AUTH 235 Authenticated
+</servercmd>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+smtp
+</server>
+ <name>
+SMTP plain authentication
+ </name>
+<stdin>
+mail body
+</stdin>
+ <command>
+smtp://%HOSTIP:%SMTPPORT/user --mail-rcpt 805@foo --mail-from 805@from -u test:1234 -T -
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+EHLO user
+AUTH PLAIN dGVzdAB0ZXN0ADEyMzQ=
+MAIL FROM:805@from
+RCPT TO:<805@foo>
+DATA
+QUIT
+</protocol>
+<upload>
+mail body
+
+.
+</upload>
+</verify>
+</testcase>
diff --git a/tests/data/test806 b/tests/data/test806
new file mode 100644
index 000000000..8ece5dc8c
--- /dev/null
+++ b/tests/data/test806
@@ -0,0 +1,55 @@
+<testcase>
+<info>
+<keywords>
+SMTP
+SMTP AUTH LOGIN
+RFC4954
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<servercmd>
+REPLY EHLO 220 AUTH LOGIN
+REPLY AUTH 334 UGFzc3dvcmQ6
+REPLY MTIzNA== 235 Authenticated
+</servercmd>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+smtp
+</server>
+ <name>
+SMTP login authentication
+ </name>
+<stdin>
+mail body
+</stdin>
+ <command>
+smtp://%HOSTIP:%SMTPPORT/user --mail-rcpt 806@foo --mail-from 806@from -u test:1234 -T -
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+EHLO user
+AUTH LOGIN dGVzdA==
+MTIzNA==
+MAIL FROM:806@from
+RCPT TO:<806@foo>
+DATA
+QUIT
+</protocol>
+<upload>
+mail body
+
+.
+</upload>
+</verify>
+</testcase>
diff --git a/tests/data/test807 b/tests/data/test807
new file mode 100644
index 000000000..6daa1d02b
--- /dev/null
+++ b/tests/data/test807
@@ -0,0 +1,59 @@
+<testcase>
+<info>
+<keywords>
+SMTP
+SMTP AUTH CRAM-MD5
+RFC2195
+RFC4954
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<servercmd>
+REPLY EHLO 220 AUTH CRAM-MD5
+REPLY AUTH 334 PDE4OTYuNjk3MTcwOTUyQHBvc3RvZmZpY2UucmVzdG9uLm1jaS5uZXQ+
+REPLY dGltIGI5MTNhNjAyYzdlZGE3YTQ5NWI0ZTZlNzMzNGQzODkw 235 Authenticated
+</servercmd>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+smtp
+</server>
+<features>
+crypto
+</features>
+ <name>
+SMTP CRAM-MD5 authentication
+ </name>
+<stdin>
+mail body
+</stdin>
+ <command>
+smtp://%HOSTIP:%SMTPPORT/user --mail-rcpt 807@foo --mail-from 807@from -u tim:tanstaaftanstaaf -T -
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+EHLO user
+AUTH CRAM-MD5
+dGltIGI5MTNhNjAyYzdlZGE3YTQ5NWI0ZTZlNzMzNGQzODkw
+MAIL FROM:807@from
+RCPT TO:<807@foo>
+DATA
+QUIT
+</protocol>
+<upload>
+mail body
+
+.
+</upload>
+</verify>
+</testcase>
diff --git a/tests/data/test81 b/tests/data/test81
new file mode 100644
index 000000000..0da0bdca0
--- /dev/null
+++ b/tests/data/test81
@@ -0,0 +1,101 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP proxy
+HTTP proxy NTLM auth
+</keywords>
+</info>
+
+# Server-side
+<reply>
+
+# This is supposed to be returned when the server gets a first
+# Authorization: NTLM line passed-in from the client
+<data1001>
+HTTP/1.1 407 Now gimme that second request of crap
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 34
+Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+
+This is not the real page either!
+</data1001>
+
+# This is supposed to be returned when the server gets the second
+# Authorization: NTLM line passed-in from the client
+<data1002>
+HTTP/1.1 200 Things are fine in server land swsclose
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 32
+
+Finally, this is the real page!
+</data1002>
+
+<datacheck>
+HTTP/1.1 407 Now gimme that second request of crap
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 34
+Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+
+HTTP/1.1 200 Things are fine in server land swsclose
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 32
+
+Finally, this is the real page!
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+<features>
+NTLM
+</features>
+<server>
+http
+</server>
+ <name>
+HTTP with proxy using NTLM authorization
+ </name>
+ <setenv>
+# we force our own host name, in order to make the test machine independent
+CURL_GETHOSTNAME=curlhost
+# we try to use the LD_PRELOAD hack, if not a debug build
+LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
+ </setenv>
+ <command>
+http://%HOSTIP:%HTTPPORT/81 --proxy-user testuser:testpass -x http://%HOSTIP:%HTTPPORT --proxy-ntlm
+</command>
+<precheck>
+chkhostname curlhost
+</precheck>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET http://%HOSTIP:%HTTPPORT/81 HTTP/1.1
+Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
+User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+GET http://%HOSTIP:%HTTPPORT/81 HTTP/1.1
+Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoKBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyY3VybGhvc3Q=
+User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test82 b/tests/data/test82
new file mode 100644
index 000000000..9e800bb73
--- /dev/null
+++ b/tests/data/test82
@@ -0,0 +1,56 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP proxy
+HTTP proxy Basic auth
+HTTP proxy NTLM auth
+</keywords>
+</info>
+# Server-side
+<reply>
+
+<data>
+HTTP/1.1 407 We only deal with NTLM my friend
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 34
+Proxy-Authenticate: NTLM
+
+This is not the real page either!
+</data>
+
+</reply>
+
+# Client-side
+<client>
+<features>
+</features>
+<server>
+http
+</server>
+ <name>
+HTTP with proxy requiring NTLM, but we send Basic
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/82 --proxy-user testuser:testpass -x http://%HOSTIP:%HTTPPORT
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET http://%HOSTIP:%HTTPPORT/82 HTTP/1.1
+Proxy-Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M=
+User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test83 b/tests/data/test83
new file mode 100644
index 000000000..0ada5d1af
--- /dev/null
+++ b/tests/data/test83
@@ -0,0 +1,72 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP CONNECT
+HTTP Basic auth
+proxytunnel
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/html
+Funny-head: yesyes
+Content-Length: 9
+
+contents
+</data>
+<datacheck>
+HTTP/1.1 200 Mighty fine indeed
+
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/html
+Funny-head: yesyes
+Content-Length: 9
+
+contents
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP over proxy-tunnel with site authentication
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/want/that/page/83 -p -x %HOSTIP:%HTTPPORT --user iam:myself
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+CONNECT %HOSTIP:%HTTPPORT HTTP/1.1
+User-Agent: curl/7.10.7-pre2 (i686-pc-linux-gnu) libcurl/7.10.7-pre2 OpenSSL/0.9.7a zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Proxy-Connection: Keep-Alive
+
+GET /we/want/that/page/83 HTTP/1.1
+Authorization: Basic aWFtOm15c2VsZg==
+User-Agent: curl/7.10.7-pre2 (i686-pc-linux-gnu) libcurl/7.10.7-pre2 OpenSSL/0.9.7a zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test84 b/tests/data/test84
new file mode 100644
index 000000000..4dbf16432
--- /dev/null
+++ b/tests/data/test84
@@ -0,0 +1,54 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP Basic auth
+HTTP proxy
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.0 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/html
+Funny-head: yesyes
+
+contents
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP over proxy with site authentication
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/want/that/page/84 -x %HOSTIP:%HTTPPORT --user iam:myself
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET http://%HOSTIP:%HTTPPORT/we/want/that/page/84 HTTP/1.1
+Authorization: Basic aWFtOm15c2VsZg==
+User-Agent: curl/7.10.7-pre2 (i686-pc-linux-gnu) libcurl/7.10.7-pre2 OpenSSL/0.9.7a zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test85 b/tests/data/test85
new file mode 100644
index 000000000..a5d1a3bca
--- /dev/null
+++ b/tests/data/test85
@@ -0,0 +1,58 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP Basic auth
+HTTP proxy
+HTTP proxy Basic auth
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/html
+Funny-head: yesyes
+Content-Length: 9
+
+contents
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP over proxy with site and proxy authentication
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/want/that/page/85 -x %HOSTIP:%HTTPPORT --user iam:myself --proxy-user testing:this
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET http://%HOSTIP:%HTTPPORT/we/want/that/page/85 HTTP/1.1
+Proxy-Authorization: Basic dGVzdGluZzp0aGlz
+Authorization: Basic aWFtOm15c2VsZg==
+User-Agent: curl/7.10.7-pre2 (i686-pc-linux-gnu) libcurl/7.10.7-pre2 OpenSSL/0.9.7a zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test86 b/tests/data/test86
new file mode 100644
index 000000000..70c28e93b
--- /dev/null
+++ b/tests/data/test86
@@ -0,0 +1,96 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+[] range
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+-foo-
+</data>
+<data1>
+HTTP/1.0 200 OK
+Content-Type: text/html
+Funny-head: swsclose
+
+crap data
+</data1>
+<data2>
+HTTP/1.0 200 OK
+Content-Type: text/html
+Funny-head: swsclose
+
+crap data
+</data2>
+<data3>
+HTTP/1.0 200 OK
+Content-Type: text/html
+Funny-head: swsclose
+
+crap data
+</data3>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP, urlglob []-retrieval and -o #[num] usage
+ </name>
+ <command option="no-output">
+"http://%HOSTIP:%HTTPPORT/[860001-860003]" -o "log/dumpit#1.dump"
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /860001 HTTP/1.1
+User-Agent: curl/7.10.7-pre4 (i686-pc-linux-gnu) libcurl/7.10.7-pre4 OpenSSL/0.9.7a ipv6 zlib/1.1.3 GSS
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /860002 HTTP/1.1
+User-Agent: curl/7.10.7-pre4 (i686-pc-linux-gnu) libcurl/7.10.7-pre4 OpenSSL/0.9.7a ipv6 zlib/1.1.3 GSS
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /860003 HTTP/1.1
+User-Agent: curl/7.10.7-pre4 (i686-pc-linux-gnu) libcurl/7.10.7-pre4 OpenSSL/0.9.7a ipv6 zlib/1.1.3 GSS
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+
+# we check the second file
+<file name="log/dumpit860002.dump">
+HTTP/1.0 200 OK
+Content-Type: text/html
+Funny-head: swsclose
+
+crap data
+</file>
+</verify>
+</testcase>
diff --git a/tests/data/test87 b/tests/data/test87
new file mode 100644
index 000000000..40b274b2e
--- /dev/null
+++ b/tests/data/test87
@@ -0,0 +1,36 @@
+<testcase>
+<info>
+<keywords>
+[] range
+FAILURE
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+</reply>
+#
+# Client-side
+<client>
+<server>
+none
+</server>
+<features>
+http
+</features>
+ <name>
+urlglob with bad -o #[num] usage
+ </name>
+ <command option="no-output">
+"http://%HOSTIP:%HTTPPORT/[870001-870003]" -o "log/dumpit#2.dump"
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+2
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test88 b/tests/data/test88
new file mode 100644
index 000000000..2495aecfe
--- /dev/null
+++ b/tests/data/test88
@@ -0,0 +1,101 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP PUT
+HTTP Digest auth
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<servercmd>
+auth_required
+</servercmd>
+<data>
+HTTP/1.1 401 Authorization Required swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"
+Content-Type: text/html; charset=iso-8859-1
+Connection: close
+
+This is not the real page
+</data>
+
+# This is supposed to be returned when the server gets a
+# Authorization: Digest line passed-in from the client
+<data1000>
+HTTP/1.1 200 OK swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+Content-Type: text/html; charset=iso-8859-1
+Connection: close
+
+This IS the real page!
+</data1000>
+
+<datacheck>
+HTTP/1.1 401 Authorization Required swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"
+Content-Type: text/html; charset=iso-8859-1
+Connection: close
+
+HTTP/1.1 200 OK swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+Content-Type: text/html; charset=iso-8859-1
+Connection: close
+
+This IS the real page!
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+crypto
+</features>
+ <name>
+HTTP PUT with Digest authorization
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/88 -T log/put88 -u testuser:testpass --digest
+</command>
+<file name="log/put88">
+This is data we upload with PUT
+a second line
+line three
+four is the number of lines
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+PUT /88 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 0
+Expect: 100-continue
+
+PUT /88 HTTP/1.1
+Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/88", response="78a49fa53d0c228778297687d4168e71"
+User-Agent: curl/7.10.5 (i686-pc-linux-gnu) libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 85
+Expect: 100-continue
+
+This is data we upload with PUT
+a second line
+line three
+four is the number of lines
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test89 b/tests/data/test89
new file mode 100644
index 000000000..f348eb658
--- /dev/null
+++ b/tests/data/test89
@@ -0,0 +1,145 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP NTLM auth
+followlocation
+</keywords>
+</info>
+# Server-side
+<reply>
+
+<!-- no <data> in this test since we have NTLM from the start
+
+This is supposed to be returned when the server gets a first
+Authorization: NTLM line passed-in from the client -->
+
+<data1001>
+HTTP/1.1 401 Now gimme that second request of crap
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 34
+WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+
+This is not the real page either!
+</data1001>
+
+# This is supposed to be returned when the server gets the second
+# Authorization: NTLM line passed-in from the client
+<data1002>
+HTTP/1.1 301 Things are fine in server land swsclose
+Server: Microsoft-IIS/5.0
+Connection: close
+Location: /you/890010
+
+</data1002>
+
+# This is the first reply after the redirection
+<data1011>
+HTTP/1.1 401 Now gimme that second round of crap
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 34
+WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+
+This is not the real page either!
+</data1011>
+
+# This is supposed to be returned when the server gets the second
+# Authorization: NTLM line passed-in from the client
+<data1012>
+HTTP/1.1 200 Things are fine in server land swsclose
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 32
+
+Finally, this is the real page!
+</data1012>
+
+<datacheck>
+HTTP/1.1 401 Now gimme that second request of crap
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 34
+WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+
+HTTP/1.1 301 Things are fine in server land swsclose
+Server: Microsoft-IIS/5.0
+Connection: close
+Location: /you/890010
+
+HTTP/1.1 401 Now gimme that second round of crap
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 34
+WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+
+HTTP/1.1 200 Things are fine in server land swsclose
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 32
+
+Finally, this is the real page!
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+<features>
+NTLM
+</features>
+<server>
+http
+</server>
+ <name>
+HTTP with NTLM and follow-location
+ </name>
+ <setenv>
+# we force our own host name, in order to make the test machine independent
+CURL_GETHOSTNAME=curlhost
+# we try to use the LD_PRELOAD hack, if not a debug build
+LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
+ </setenv>
+ <command>
+http://%HOSTIP:%HTTPPORT/89 -u testuser:testpass --ntlm -L
+</command>
+<precheck>
+chkhostname curlhost
+</precheck>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /89 HTTP/1.1
+Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
+User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /89 HTTP/1.1
+Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoKBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyY3VybGhvc3Q=
+User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /you/890010 HTTP/1.1
+Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
+User-Agent: curl/7.10.8-pre1 (i686-pc-linux-gnu) libcurl/7.10.8-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3 GSS
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /you/890010 HTTP/1.1
+Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoKBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyY3VybGhvc3Q=
+User-Agent: curl/7.10.8-pre1 (i686-pc-linux-gnu) libcurl/7.10.8-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3 GSS
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test9 b/tests/data/test9
new file mode 100644
index 000000000..7905ac838
--- /dev/null
+++ b/tests/data/test9
@@ -0,0 +1,73 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP FORMPOST
+HTTP file upload
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.0 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+
+blablabla
+
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP RFC1867-type formposting
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/want/9 -F name=daniel -F tool=curl -F file=@log/test9.txt
+</command>
+# We create this file before the command is invoked!
+<file name="log/test9.txt">
+foo-
+This is a moo-
+bar
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^(User-Agent:|Content-Type: multipart/form-data;|------------).*
+</strip>
+<protocol>
+POST /we/want/9 HTTP/1.1
+User-Agent: curl/7.10.4 (i686-pc-linux-gnu) libcurl/7.10.4 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 407
+Expect: 100-continue
+Content-Type: multipart/form-data; boundary=----------------------------9ef8d6205763
+
+------------------------------9ef8d6205763
+Content-Disposition: form-data; name="name"
+
+daniel
+------------------------------9ef8d6205763
+Content-Disposition: form-data; name="tool"
+
+curl
+------------------------------9ef8d6205763
+Content-Disposition: form-data; name="file"; filename="test9.txt"
+Content-Type: text/plain
+
+foo-
+This is a moo-
+bar
+
+------------------------------9ef8d6205763--
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test90 b/tests/data/test90
new file mode 100644
index 000000000..24a7ff4d2
--- /dev/null
+++ b/tests/data/test90
@@ -0,0 +1,191 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP NTLM auth
+--anyauth
+followlocation
+</keywords>
+</info>
+# Server-side
+<reply>
+
+<data>
+HTTP/1.1 401 Authorization Required swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+WWW-Authenticate: Basic
+WWW-Authenticate: Wild-and-crazy
+WWW-Authenticate: NTLM
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 26
+
+This is not the real page
+</data>
+
+# This is supposed to be returned when the server gets a first
+# Authorization: NTLM line passed-in from the client
+<data1001>
+HTTP/1.1 401 Now gimme that second request of crap
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 34
+WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+
+This is not the real page either!
+</data1001>
+
+# This is supposed to be returned when the server gets the second
+# Authorization: NTLM line passed-in from the client
+<data1002>
+HTTP/1.1 301 Things are fine in server land swsclose
+Server: Microsoft-IIS/5.0
+Connection: close
+Location: /you/900010
+
+</data1002>
+
+# This is the first reply after the redirection
+<data10>
+HTTP/1.1 401 Authorization Required swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+WWW-Authenticate: Basic
+WWW-Authenticate: Wild-and-crazy
+WWW-Authenticate: NTLM
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 26
+
+This is not the real page
+</data10>
+
+<data1011>
+HTTP/1.1 401 Now gimme that second round of crap
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 34
+WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+
+This is not the real page either!
+</data1011>
+
+# This is supposed to be returned when the server gets the second
+# Authorization: NTLM line passed-in from the client
+<data1012>
+HTTP/1.1 200 Things are fine in server land swsclose
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 32
+
+Finally, this is the real page!
+</data1012>
+
+<datacheck>
+HTTP/1.1 401 Authorization Required swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+WWW-Authenticate: Basic
+WWW-Authenticate: Wild-and-crazy
+WWW-Authenticate: NTLM
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 26
+
+HTTP/1.1 401 Now gimme that second request of crap
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 34
+WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+
+HTTP/1.1 301 Things are fine in server land swsclose
+Server: Microsoft-IIS/5.0
+Connection: close
+Location: /you/900010
+
+HTTP/1.1 401 Authorization Required swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+WWW-Authenticate: Basic
+WWW-Authenticate: Wild-and-crazy
+WWW-Authenticate: NTLM
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 26
+
+HTTP/1.1 401 Now gimme that second round of crap
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 34
+WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+
+HTTP/1.1 200 Things are fine in server land swsclose
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 32
+
+Finally, this is the real page!
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+<features>
+NTLM
+</features>
+<server>
+http
+</server>
+ <name>
+HTTP with NTLM via --anyauth, and then follow-location with NTLM again
+ </name>
+ <setenv>
+# we force our own host name, in order to make the test machine independent
+CURL_GETHOSTNAME=curlhost
+# we try to use the LD_PRELOAD hack, if not a debug build
+LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
+ </setenv>
+ <command>
+http://%HOSTIP:%HTTPPORT/90 -u testuser:testpass --anyauth -L
+</command>
+<precheck>
+chkhostname curlhost
+</precheck>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /90 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /90 HTTP/1.1
+Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
+User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /90 HTTP/1.1
+Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoKBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyY3VybGhvc3Q=
+User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /you/900010 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /you/900010 HTTP/1.1
+Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
+User-Agent: curl/7.10.8-pre1 (i686-pc-linux-gnu) libcurl/7.10.8-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3 GSS
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /you/900010 HTTP/1.1
+Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoKBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyY3VybGhvc3Q=
+User-Agent: curl/7.10.8-pre1 (i686-pc-linux-gnu) libcurl/7.10.8-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3 GSS
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test91 b/tests/data/test91
new file mode 100644
index 000000000..e6f34aedf
--- /dev/null
+++ b/tests/data/test91
@@ -0,0 +1,122 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP NTLM auth
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 401 Authorization Required swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+WWW-Authenticate: Magic-Negotiate
+WWW-Authenticate: NTLM
+WWW-Authenticate: Basic realm="daniel"
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 0
+Connection: close
+
+</data>
+
+# This is supposed to be returned when the server gets a first
+# Authorization: NTLM line passed-in from the client
+<data1001>
+HTTP/1.1 401 Now gimme that second request of crap
+Server: Microsoft-IIS/5.0
+Content-Length: 34
+Content-Type: text/html; charset=iso-8859-1
+WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+
+This is not the real page either!
+</data1001>
+
+# This is supposed to be returned when the server gets the second
+# Authorization: NTLM line passed-in from the client
+<data1002>
+HTTP/1.1 200 Things are fine in server land swsclose
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 32
+
+Finally, this is the real page!
+</data1002>
+
+<datacheck>
+HTTP/1.1 401 Authorization Required swsclose
+Server: Apache/1.3.27 (Darwin) PHP/4.1.2
+WWW-Authenticate: Magic-Negotiate
+WWW-Authenticate: NTLM
+WWW-Authenticate: Basic realm="daniel"
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 0
+Connection: close
+
+HTTP/1.1 401 Now gimme that second request of crap
+Server: Microsoft-IIS/5.0
+Content-Length: 34
+Content-Type: text/html; charset=iso-8859-1
+WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
+
+HTTP/1.1 200 Things are fine in server land swsclose
+Server: Microsoft-IIS/5.0
+Content-Type: text/html; charset=iso-8859-1
+Content-Length: 32
+
+Finally, this is the real page!
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+<features>
+NTLM
+</features>
+<server>
+http
+</server>
+ <name>
+HTTP with NTLM/Negotiate/Basic, anyauth and user with domain, with size 0
+ </name>
+ <setenv>
+# we force our own host name, in order to make the test machine independent
+CURL_GETHOSTNAME=curlhost
+# we try to use the LD_PRELOAD hack, if not a debug build
+LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
+ </setenv>
+ <command>
+http://%HOSTIP:%HTTPPORT/91 --anyauth -u mydomain\\myself:secret
+</command>
+<precheck>
+chkhostname curlhost
+</precheck>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /91 HTTP/1.1
+User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /91 HTTP/1.1
+Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
+User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /91 HTTP/1.1
+Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAgACABwAAAABgAGAHgAAAAIAAgAfgAAAAAAAAAAAAAABoKBAMIyJpR5mHpg2FZha5kRaFZ9436GAxPu0C5llxexSQ5QzVkiLSfkcpVyRgCXXqR+Am15ZG9tYWlubXlzZWxmY3VybGhvc3Q=
+User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test92 b/tests/data/test92
new file mode 100644
index 000000000..726aa7919
--- /dev/null
+++ b/tests/data/test92
@@ -0,0 +1,55 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+Content-Range
+Resume
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 416 Requested Range Not Satisfiable
+Date: Fri, 24 Oct 2003 21:33:12 GMT
+Server: Apache/1.3.19 (Unix) (Red-Hat/Linux) mod_ssl/2.8.1 OpenSSL/0.9.6 PHP/4.3.1
+Last-Modified: Fri, 24 Oct 2003 18:01:23 GMT
+ETag: "ab57a-507-3f9968f3"
+Accept-Ranges: bytes
+Content-Length: 4
+Content-Range: bytes */87
+Content-Type: image/gif
+
+bad
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP resume transfer with the whole file already downloaded
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/want/92 -C 87
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /want/92 HTTP/1.1
+Range: bytes=87-
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+
+</verify>
+</testcase>
diff --git a/tests/data/test93 b/tests/data/test93
new file mode 100644
index 000000000..138724835
--- /dev/null
+++ b/tests/data/test93
@@ -0,0 +1,50 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP proxy
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 407 Needs proxy authentication
+Server: test-server/fake swsclose yesyes
+Proxy-Authenticate: Basic "oh please"
+Connection: close
+
+bing
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET with failed proxy auth
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/93 -x %HOSTIP:%HTTPPORT
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET http://%HOSTIP:%HTTPPORT/93 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test94 b/tests/data/test94
new file mode 100644
index 000000000..a7bafa695
--- /dev/null
+++ b/tests/data/test94
@@ -0,0 +1,58 @@
+<testcase>
+<info>
+<keywords>
+HTTPS
+HTTP GET
+HTTP CONNECT
+HTTP proxy
+FAILURE
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.1 407 Needs proxy authentication
+Server: test-server/fake swsclose yesyes
+Proxy-Authenticate: Basic "oh please"
+Connection: close
+
+bing
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+<features>
+SSL
+</features>
+ <name>
+HTTPS GET with failed proxy auth (CONNECT 1.0)
+ </name>
+ <command>
+https://test.anything.really.com:94 --proxy1.0 %HOSTIP:%HTTPPORT
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+56
+</errorcode>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+CONNECT test.anything.really.com:94 HTTP/1.0
+User-Agent: curl/7.11.0-CVS (i686-pc-linux-gnu) libcurl/7.11.0-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4
+Host: test.anything.really.com:94
+Proxy-Connection: Keep-Alive
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test95 b/tests/data/test95
new file mode 100644
index 000000000..9fea1bec1
--- /dev/null
+++ b/tests/data/test95
@@ -0,0 +1,74 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP POST
+HTTP CONNECT
+proxytunnel
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/html
+Funny-head: yesyes
+Content-Length: 9
+
+contents
+</data>
+<datacheck>
+HTTP/1.1 200 Mighty fine indeed
+
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/html
+Funny-head: yesyes
+Content-Length: 9
+
+contents
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP over proxytunnel using POST
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/want/that/page/95 -p -x %HOSTIP:%HTTPPORT -d "datatopost=ohthatsfunyesyes"
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol nonewline="yes">
+CONNECT %HOSTIP:%HTTPPORT HTTP/1.1
+User-Agent: curl/7.10.7-pre2 (i686-pc-linux-gnu) libcurl/7.10.7-pre2 OpenSSL/0.9.7a zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Proxy-Connection: Keep-Alive
+
+POST /we/want/that/page/95 HTTP/1.1
+User-Agent: curl/7.10.7-pre2 (i686-pc-linux-gnu) libcurl/7.10.7-pre2 OpenSSL/0.9.7a zlib/1.1.3
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 27
+Content-Type: application/x-www-form-urlencoded
+
+datatopost=ohthatsfunyesyes
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test97 b/tests/data/test97
new file mode 100644
index 000000000..c1065bb19
--- /dev/null
+++ b/tests/data/test97
@@ -0,0 +1,52 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP POST
+HTTP replaced headers
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.0 200 OK
+Server: test-server/fake
+Content-Type: text/html
+Content-Length: 6
+
+blaha
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP POST with custom content-type
+ </name>
+ <command>
+ -d "hejsanallabarn" -H "Content-Type: silly/type" http://%HOSTIP:%HTTPPORT/97
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol nonewline="yes">
+POST /97 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Type: silly/type
+Content-Length: 14
+
+hejsanallabarn
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test98 b/tests/data/test98
new file mode 100644
index 000000000..b6d1182c6
--- /dev/null
+++ b/tests/data/test98
@@ -0,0 +1,55 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP PUT
+chunked Transfer-Encoding
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.0 200 OK
+Server: test-server/fake
+Content-Type: text/html
+Content-Length: 6
+
+blaha
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP PUT from stdin with set size, disabling chunked transfer-encoding
+ </name>
+ <command>
+ -T - -H "Transfer-Encoding:" -H "Content-Length: 14" http://%HOSTIP:%HTTPPORT/98
+</command>
+<stdin>
+data on stdin
+</stdin>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+PUT /98 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 14
+Expect: 100-continue
+
+data on stdin
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test99 b/tests/data/test99
new file mode 100644
index 000000000..2517002f7
--- /dev/null
+++ b/tests/data/test99
@@ -0,0 +1,69 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+Resume
+Largefile
+FAILURE
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 404 Nah
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+Content-Length: 13
+Funny-head: yesyes
+
+0123456789123
+</data>
+
+<datacheck>
+HTTP/1.1 404 Nah
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Connection: close
+Content-Length: 13
+Funny-head: yesyes
+
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+large_file
+</features>
+<server>
+http
+</server>
+ <name>
+HTTP GET with large-file resume point and failed resume
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/99 -C 9999999999
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+# 33 is CURLE_RANGE_ERROR
+<errorcode>
+33
+</errorcode>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /99 HTTP/1.1
+Range: bytes=9999999999-
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/directories.pm b/tests/directories.pm
new file mode 100644
index 000000000..6f20e6feb
--- /dev/null
+++ b/tests/directories.pm
@@ -0,0 +1,266 @@
+%file_chmod1 = (
+ 'name' => 'chmod1',
+ 'content' => "This file should have permissions 444\n",
+ 'perm' => 'r--r--r--',
+ 'time' => 'Jan 11 10:00',
+ 'dostime' => '01-11-10 10:00AM',
+);
+
+%file_chmod2 = (
+ 'name' => 'chmod2',
+ 'content' => "This file should have permissions 666\n",
+ 'perm' => 'rw-rw-rw-',
+ 'time' => 'Feb 1 8:00',
+ 'dostime' => '02-01-10 08:00AM',
+);
+
+%file_chmod3 = (
+ 'name' => 'chmod3',
+ 'content' => "This file should have permissions 777\n",
+ 'perm' => 'rwxrwxrwx',
+ 'time' => 'Feb 1 8:00',
+ 'dostime' => '02-01-10 08:00AM',
+);
+
+%file_chmod4 = (
+ 'type' => 'd',
+ 'name' => 'chmod4',
+ 'content' => "This file should have permissions 001\n",
+ 'perm' => '--S--S--t',
+ 'time' => 'May 4 4:31',
+ 'dostime' => '05-04-10 04:31AM'
+);
+
+%file_chmod5 = (
+ 'type' => 'd',
+ 'name' => 'chmod5',
+ 'content' => "This file should have permissions 110\n",
+ 'perm' => '--s--s--T',
+ 'time' => 'May 4 4:31',
+ 'dostime' => '05-04-10 04:31AM'
+);
+
+%link_link = (
+ 'type' => 'l',
+ 'name' => 'link -> file.txt',
+ 'size' => '8',
+ 'perm' => 'rwxrwxrwx',
+ 'time' => 'Jan 6 4:42'
+);
+
+%link_link_absolute = (
+ 'type' => 'l',
+ 'name' => 'link_absolute -> /data/ftp/file.txt',
+ 'size' => '15',
+ 'perm' => 'rwxrwxrwx',
+ 'time' => 'Jan 6 4:45'
+);
+
+%dir_dot = (
+ 'type' => "d",
+ 'name' => ".",
+ 'hlink' => "4",
+ 'time' => "Apr 27 5:12",
+ 'size' => "20480",
+ 'dostime' => "04-27-10 05:12AM",
+ 'perm' => "rwxrwxrwx"
+);
+
+%dir_ddot = (
+ 'type' => "d",
+ 'name' => "..",
+ 'hlink' => "4",
+ 'size' => "20480",
+ 'time' => "Apr 23 3:12",
+ 'dostime' => "04-23-10 03:12AM",
+ 'perm' => "rwxrwxrwx"
+);
+
+%dir_weirddir_txt = (
+ 'type' => "d",
+ 'name' => "weirddir.txt",
+ 'hlink' => "2",
+ 'size' => "4096",
+ 'time' => "Apr 23 3:12",
+ 'dostime' => "04-23-10 03:12AM",
+ 'perm' => "rwxr-xrwx"
+);
+
+%dir_UNIX = (
+ 'type' => "d",
+ 'name' => "UNIX",
+ 'hlink' => "11",
+ 'size' => "4096",
+ 'time' => "Nov 01 2008",
+ 'dostime' => "11-01-08 11:11AM",
+ 'perm' => "rwx--x--x"
+);
+
+%dir_DOS = (
+ 'type' => "d",
+ 'name' => "DOS",
+ 'hlink' => "11",
+ 'size' => "4096",
+ 'time' => "Nov 01 2008",
+ 'dostime' => "11-01-08 11:11AM",
+ 'perm' => "rwx--x--x"
+);
+
+%dir_dot_NeXT = (
+ 'type' => "d",
+ 'name' => ".NeXT",
+ 'hlink' => "4",
+ 'size' => "4096",
+ 'time' => "Jan 23 2:05",
+ 'dostime' => "01-23-05 02:05AM",
+ 'perm' => "rwxrwxrwx"
+);
+
+%file_empty_file_dat = (
+ 'name' => "empty_file.dat",
+ 'content' => "",
+ 'perm' => "rw-r--r--",
+ 'time' => "Apr 27 11:01",
+ 'dostime' => "04-27-10 11:01AM"
+);
+
+%file_file_txt = (
+ 'name' => "file.txt",
+ 'content' => "This is content of file \"file.txt\"\n",
+ 'time' => "Apr 27 11:01",
+ 'dostime' => "04-27-10 11:01AM",
+ 'perm' => "rw-r--r--"
+);
+
+%file_someothertext_txt = (
+ 'name' => "someothertext.txt",
+ 'content' => "Some junk ;-) This file does not really exist.\n",
+ 'time' => "Apr 27 11:01",
+ 'dostime' => "04-27-10 11:01AM",
+ 'perm' => "rw-r--r--"
+);
+
+%lists = (
+ '/fully_simulated/' => {
+ 'files' => [ \%dir_dot, \%dir_ddot, \%dir_DOS, \%dir_UNIX ],
+ 'eol' => "\r\n",
+ 'type' => "unix"
+ },
+ '/fully_simulated/UNIX/' => {
+ 'files' => [ \%dir_dot, \%dir_ddot,
+ \%file_chmod1, \%file_chmod2, \%file_chmod3, \%file_chmod4, \%file_chmod5,
+ \%file_empty_file_dat, \%file_file_txt,
+ \%link_link, \%link_link_absolute, \%dir_dot_NeXT,
+ \%file_someothertext_txt, \%dir_weirddir_txt ],
+ 'eol' => "\r\n",
+ 'type' => 'unix'
+ },
+ '/fully_simulated/DOS/' => {
+ 'files' => [ \%dir_dot, \%dir_ddot,
+ \%file_chmod1, \%file_chmod2, \%file_chmod3, \%file_chmod4, \%file_chmod5,
+ \%file_empty_file_dat, \%file_file_txt,
+ \%dir_dot_NeXT, \%file_someothertext_txt, \%dir_weirddir_txt ],
+ 'eol' => "\r\n",
+ 'type' => 'dos'
+ }
+);
+
+sub ftp_createcontent($) {
+ my (%list) = @_;
+
+ $type = $$list{'type'};
+ $eol = $$list{'eol'};
+ $list_ref = $$list{'files'};
+
+ my @diroutput;
+ my @contentlist;
+ if($type eq "unix") {
+ for(@$list_ref) {
+ my %file = %$_;
+ my $line = "";
+ my $ftype = $file{'type'} ? $file{'type'} : "-";
+ my $fperm = $file{'perm'} ? $file{'perm'} : "rwxr-xr-x";
+ my $fuser = $file{'user'} ? sprintf("%15s", $file{'user'}) : "ftp-default";
+ my $fgroup = $file{'group'} ? sprintf("%15s", $file{'group'}) : "ftp-default";
+ my $fsize = "";
+ if($file{'type'} eq "d") {
+ $fsize = $file{'size'} ? sprintf("%7s", $file{'size'}) : sprintf("%7d", 4096);
+ }
+ else {
+ $fsize = sprintf("%7d", length $file{'content'});
+ }
+ my $fhlink = $file{'hlink'} ? sprintf("%4d", $file{'hlink'}) : " 1";
+ my $ftime = $file{'time'} ? sprintf("%10s", $file{'time'}) : "Jan 9 1933";
+ push(@contentlist, "$ftype$fperm $fhlink $fuser $fgroup $fsize $ftime $file{'name'}$eol");
+ }
+
+ return @contentlist;
+ }
+ elsif($type =~ /^dos$/) {
+ for(@$list_ref) {
+ my %file = %$_;
+ my $line = "";
+ my $time = $file{'dostime'} ? $file{'dostime'} : "06-25-97 09:12AM";
+ my $size_or_dir;
+ if($file{'type'} =~ /^d$/) {
+ $size_or_dir = " <DIR> ";
+ }
+ else {
+ $size_or_dir = sprintf("%20d", length $file{'content'});
+ }
+ push(@contentlist, "$time $size_or_dir $file{'name'}$eol");
+ }
+ return @contentlist;
+ }
+}
+
+sub wildcard_filesize($$) {
+ my ($list_type, $file) = @_;
+ $list = $lists{$list_type};
+ if($list) {
+ my $files = $list->{'files'};
+ for(@$files) {
+ my %f = %$_;
+ if ($f{'name'} eq $file) {
+ if($f{'content'}) {
+ return length $f{'content'};
+ }
+ elsif ($f{'type'} ne "d"){
+ return 0;
+ }
+ else {
+ return -1;
+ }
+ }
+ }
+ }
+ return -1;
+}
+sub wildcard_getfile($$) {
+ my ($list_type, $file) = @_;
+ $list = $lists{$list_type};
+ if($list) {
+ my $files = $list->{'files'};
+ for(@$files) {
+ my %f = %$_;
+ if ($f{'name'} eq $file) {
+ if($f{'content'}) {
+ return (length $f{'content'}, $f{'content'});
+ }
+ elsif ($f{'type'} ne "d"){
+ return (0, "");
+ }
+ else {
+ return (-1, 0);
+ }
+ }
+ }
+ }
+ return (-1, 0);
+}
+
+sub ftp_contentlist {
+ my $listname = $_[0];
+ $list = $lists{$listname};
+ return ftp_createcontent(\$list);
+}
diff --git a/tests/ftp.pm b/tests/ftp.pm
new file mode 100644
index 000000000..6a46e7651
--- /dev/null
+++ b/tests/ftp.pm
@@ -0,0 +1,254 @@
+#***************************************************************************
+# _ _ ____ _
+# Project ___| | | | _ \| |
+# / __| | | | |_) | |
+# | (__| |_| | _ <| |___
+# \___|\___/|_| \_\_____|
+#
+# Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+#
+# This software is licensed as described in the file COPYING, which
+# you should have received as part of this distribution. The terms
+# are also available at http://curl.haxx.se/docs/copyright.html.
+#
+# You may opt to use, copy, modify, merge, publish, distribute and/or sell
+# copies of the Software, and permit persons to whom the Software is
+# furnished to do so, under the terms of the COPYING file.
+#
+# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+# KIND, either express or implied.
+#
+###########################################################################
+
+use strict;
+use warnings;
+
+use serverhelp qw(
+ servername_id
+ mainsockf_pidfilename
+ datasockf_pidfilename
+ );
+
+#######################################################################
+# pidfromfile returns the pid stored in the given pidfile. The value
+# of the returned pid will never be a negative value. It will be zero
+# on any file related error or if a pid can not be extracted from the
+# given file.
+#
+sub pidfromfile {
+ my $pidfile = $_[0];
+ my $pid = 0;
+
+ if(-f $pidfile && -s $pidfile && open(PIDFH, "<$pidfile")) {
+ $pid = 0 + <PIDFH>;
+ close(PIDFH);
+ $pid = 0 unless($pid > 0);
+ }
+ return $pid;
+}
+
+#######################################################################
+# processexists checks if a process with the pid stored in the given
+# pidfile exists and is alive. This will return 0 on any file related
+# error or if a pid can not be extracted from the given file. When a
+# process with the same pid as the one extracted from the given file
+# is currently alive this returns that positive pid. Otherwise, when
+# the process is not alive, will return the negative value of the pid.
+#
+sub processexists {
+ use POSIX ":sys_wait_h";
+ my $pidfile = $_[0];
+
+ # fetch pid from pidfile
+ my $pid = pidfromfile($pidfile);
+
+ if($pid > 0) {
+ # verify if currently alive
+ if(kill(0, $pid)) {
+ return $pid;
+ }
+ else {
+ # get rid of the certainly invalid pidfile
+ unlink($pidfile) if($pid == pidfromfile($pidfile));
+ # reap its dead children, if not done yet
+ waitpid($pid, &WNOHANG);
+ # negative return value means dead process
+ return -$pid;
+ }
+ }
+ return 0;
+}
+
+#######################################################################
+# killpid attempts to gracefully stop processes in the given pid list
+# with a SIGTERM signal and SIGKILLs those which haven't died on time.
+#
+sub killpid {
+ use POSIX ":sys_wait_h";
+ my ($verbose, $pidlist) = @_;
+ my @requested;
+ my @signalled;
+ my @reapchild;
+
+ # The 'pidlist' argument is a string of whitespace separated pids.
+ return if(not defined($pidlist));
+
+ # Make 'requested' hold the non-duplicate pids from 'pidlist'.
+ @requested = split(' ', $pidlist);
+ return if(not @requested);
+ if(scalar(@requested) > 2) {
+ @requested = sort({$a <=> $b} @requested);
+ }
+ for(my $i = scalar(@requested) - 2; $i >= 0; $i--) {
+ if($requested[$i] == $requested[$i+1]) {
+ splice @requested, $i+1, 1;
+ }
+ }
+
+ # Send a SIGTERM to processes which are alive to gracefully stop them.
+ foreach my $tmp (@requested) {
+ chomp $tmp;
+ if($tmp =~ /^(\d+)$/) {
+ my $pid = $1;
+ if($pid > 0) {
+ if(kill(0, $pid)) {
+ print("RUN: Process with pid $pid signalled to die\n")
+ if($verbose);
+ kill("TERM", $pid);
+ push @signalled, $pid;
+ }
+ else {
+ print("RUN: Process with pid $pid already dead\n")
+ if($verbose);
+ # if possible reap its dead children
+ waitpid($pid, &WNOHANG);
+ push @reapchild, $pid;
+ }
+ }
+ }
+ }
+
+ # Allow all signalled processes five seconds to gracefully die.
+ if(@signalled) {
+ my $twentieths = 5 * 20;
+ while($twentieths--) {
+ for(my $i = scalar(@signalled) - 1; $i >= 0; $i--) {
+ my $pid = $signalled[$i];
+ if(!kill(0, $pid)) {
+ print("RUN: Process with pid $pid gracefully died\n")
+ if($verbose);
+ splice @signalled, $i, 1;
+ # if possible reap its dead children
+ waitpid($pid, &WNOHANG);
+ push @reapchild, $pid;
+ }
+ }
+ last if(not scalar(@signalled));
+ select(undef, undef, undef, 0.05);
+ }
+ }
+
+ # Mercilessly SIGKILL processes still alive.
+ if(@signalled) {
+ foreach my $pid (@signalled) {
+ if($pid > 0) {
+ print("RUN: Process with pid $pid forced to die with SIGKILL\n")
+ if($verbose);
+ kill("KILL", $pid);
+ # if possible reap its dead children
+ waitpid($pid, &WNOHANG);
+ push @reapchild, $pid;
+ }
+ }
+ }
+
+ # Reap processes dead children for sure.
+ if(@reapchild) {
+ foreach my $pid (@reapchild) {
+ if($pid > 0) {
+ waitpid($pid, 0);
+ }
+ }
+ }
+}
+
+#######################################################################
+# killsockfilters kills sockfilter processes for a given server.
+#
+sub killsockfilters {
+ my ($proto, $ipvnum, $idnum, $verbose, $which) = @_;
+ my $server;
+ my $pidfile;
+ my $pid;
+
+ return if($proto !~ /^(ftp|imap|pop3|smtp)$/);
+
+ die "unsupported sockfilter: $which"
+ if($which && ($which !~ /^(main|data)$/));
+
+ $server = servername_id($proto, $ipvnum, $idnum) if($verbose);
+
+ if(!$which || ($which eq 'main')) {
+ $pidfile = mainsockf_pidfilename($proto, $ipvnum, $idnum);
+ $pid = processexists($pidfile);
+ if($pid > 0) {
+ printf("* kill pid for %s-%s => %d\n", $server,
+ ($proto eq 'ftp')?'ctrl':'filt', $pid) if($verbose);
+ kill("KILL", $pid);
+ waitpid($pid, 0);
+ }
+ unlink($pidfile) if(-f $pidfile);
+ }
+
+ return if($proto ne 'ftp');
+
+ if(!$which || ($which eq 'data')) {
+ $pidfile = datasockf_pidfilename($proto, $ipvnum, $idnum);
+ $pid = processexists($pidfile);
+ if($pid > 0) {
+ printf("* kill pid for %s-data => %d\n", $server,
+ $pid) if($verbose);
+ kill("KILL", $pid);
+ waitpid($pid, 0);
+ }
+ unlink($pidfile) if(-f $pidfile);
+ }
+}
+
+#######################################################################
+# killallsockfilters kills sockfilter processes for all servers.
+#
+sub killallsockfilters {
+ my $verbose = $_[0];
+
+ for my $proto (('ftp', 'imap', 'pop3', 'smtp')) {
+ for my $ipvnum (('4', '6')) {
+ for my $idnum (('1', '2')) {
+ killsockfilters($proto, $ipvnum, $idnum, $verbose);
+ }
+ }
+ }
+}
+
+
+sub set_advisor_read_lock {
+ my ($filename) = @_;
+
+ if(open(FILEH, ">$filename")) {
+ close(FILEH);
+ return;
+ }
+ printf "Error creating lock file $filename error: $!";
+}
+
+
+sub clear_advisor_read_lock {
+ my ($filename) = @_;
+
+ if(-f $filename) {
+ unlink($filename);
+ }
+}
+
+
+1;
diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl
new file mode 100755
index 000000000..bbbf7be29
--- /dev/null
+++ b/tests/ftpserver.pl
@@ -0,0 +1,1574 @@
+#!/usr/bin/env perl
+#***************************************************************************
+# _ _ ____ _
+# Project ___| | | | _ \| |
+# / __| | | | |_) | |
+# | (__| |_| | _ <| |___
+# \___|\___/|_| \_\_____|
+#
+# Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+#
+# This software is licensed as described in the file COPYING, which
+# you should have received as part of this distribution. The terms
+# are also available at http://curl.haxx.se/docs/copyright.html.
+#
+# You may opt to use, copy, modify, merge, publish, distribute and/or sell
+# copies of the Software, and permit persons to whom the Software is
+# furnished to do so, under the terms of the COPYING file.
+#
+# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+# KIND, either express or implied.
+#
+###########################################################################
+
+# This is a server designed for the curl test suite.
+#
+# In December 2009 we started remaking the server to support more protocols
+# that are similar in spirit. Like POP3, IMAP and SMTP in addition to the FTP
+# it already supported since a long time. Note that it still only supports one
+# protocol per invoke. You need to start multiple servers to support multiple
+# protocols simultaneously.
+#
+# It is meant to exercise curl, it is not meant to be a fully working
+# or even very standard compliant server.
+#
+# You may optionally specify port on the command line, otherwise it'll
+# default to port 8921.
+#
+# All socket/network/TCP related stuff is done by the 'sockfilt' program.
+#
+
+BEGIN {
+ @INC=(@INC, $ENV{'srcdir'}, '.');
+ # sub second timestamping needs Time::HiRes
+ eval {
+ no warnings "all";
+ require Time::HiRes;
+ import Time::HiRes qw( gettimeofday );
+ }
+}
+
+use strict;
+use warnings;
+use IPC::Open2;
+
+require "getpart.pm";
+require "ftp.pm";
+require "directories.pm";
+
+use serverhelp qw(
+ servername_str
+ server_pidfilename
+ server_logfilename
+ mainsockf_pidfilename
+ mainsockf_logfilename
+ datasockf_pidfilename
+ datasockf_logfilename
+ );
+
+#**********************************************************************
+# global vars...
+#
+my $verbose = 0; # set to 1 for debugging
+my $idstr = ""; # server instance string
+my $idnum = 1; # server instance number
+my $ipvnum = 4; # server IPv number (4 or 6)
+my $proto = 'ftp'; # default server protocol
+my $srcdir; # directory where ftpserver.pl is located
+my $srvrname; # server name for presentation purposes
+my $grok_eprt;
+
+my $path = '.';
+my $logdir = $path .'/log';
+
+#**********************************************************************
+# global vars used for server address and primary listener port
+#
+my $port = 8921; # default primary listener port
+my $listenaddr = '127.0.0.1'; # default address for listener port
+
+#**********************************************************************
+# global vars used for file names
+#
+my $pidfile; # server pid file name
+my $logfile; # server log file name
+my $mainsockf_pidfile; # pid file for primary connection sockfilt process
+my $mainsockf_logfile; # log file for primary connection sockfilt process
+my $datasockf_pidfile; # pid file for secondary connection sockfilt process
+my $datasockf_logfile; # log file for secondary connection sockfilt process
+
+#**********************************************************************
+# global vars used for server logs advisor read lock handling
+#
+my $SERVERLOGS_LOCK = 'log/serverlogs.lock';
+my $serverlogslocked = 0;
+
+#**********************************************************************
+# global vars used for child processes PID tracking
+#
+my $sfpid; # PID for primary connection sockfilt process
+my $slavepid; # PID for secondary connection sockfilt process
+
+#**********************************************************************
+# global typeglob filehandle vars to read/write from/to sockfilters
+#
+local *SFREAD; # used to read from primary connection
+local *SFWRITE; # used to write to primary connection
+local *DREAD; # used to read from secondary connection
+local *DWRITE; # used to write to secondary connection
+
+#**********************************************************************
+# global vars which depend on server protocol selection
+#
+my %commandfunc; # protocol command specific function callbacks
+my %displaytext; # text returned to client before callback runs
+my @welcome; # text returned to client upon connection
+
+#**********************************************************************
+# global vars customized for each test from the server commands file
+#
+my $ctrldelay; # set if server should throttle ctrl stream
+my $datadelay; # set if server should throttle data stream
+my $retrweirdo; # set if ftp server should use RETRWEIRDO
+my $retrnosize; # set if ftp server should use RETRNOSIZE
+my $pasvbadip; # set if ftp server should use PASVBADIP
+my $nosave; # set if ftp server should not save uploaded data
+my %customreply; #
+my %customcount; #
+my %delayreply; #
+
+#**********************************************************************
+# global variables for to test ftp wildcardmatching or other test that
+# need flexible LIST responses.. and corresponding files.
+# $ftptargetdir is keeping the fake "name" of LIST directory.
+my $ftplistparserstate;
+my $ftptargetdir;
+
+#**********************************************************************
+# global vars used for signal handling
+#
+my $got_exit_signal = 0; # set if program should finish execution ASAP
+my $exit_signal; # first signal handled in exit_signal_handler
+
+#**********************************************************************
+# exit_signal_handler will be triggered to indicate that the program
+# should finish its execution in a controlled way as soon as possible.
+# For now, program will also terminate from within this handler.
+#
+sub exit_signal_handler {
+ my $signame = shift;
+ # For now, simply mimic old behavior.
+ killsockfilters($proto, $ipvnum, $idnum, $verbose);
+ unlink($pidfile);
+ if($serverlogslocked) {
+ $serverlogslocked = 0;
+ clear_advisor_read_lock($SERVERLOGS_LOCK);
+ }
+ exit;
+}
+
+#**********************************************************************
+# logmsg is general message logging subroutine for our test servers.
+#
+sub logmsg {
+ my $now;
+ # sub second timestamping needs Time::HiRes
+ if($Time::HiRes::VERSION) {
+ my ($seconds, $usec) = gettimeofday();
+ my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
+ localtime($seconds);
+ $now = sprintf("%02d:%02d:%02d.%06d ", $hour, $min, $sec, $usec);
+ }
+ else {
+ my $seconds = time();
+ my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
+ localtime($seconds);
+ $now = sprintf("%02d:%02d:%02d ", $hour, $min, $sec);
+ }
+ if(open(LOGFILEFH, ">>$logfile")) {
+ print LOGFILEFH $now;
+ print LOGFILEFH @_;
+ close(LOGFILEFH);
+ }
+}
+
+sub ftpmsg {
+ # append to the server.input file
+ open(INPUT, ">>log/server$idstr.input") ||
+ logmsg "failed to open log/server$idstr.input\n";
+
+ print INPUT @_;
+ close(INPUT);
+
+ # use this, open->print->close system only to make the file
+ # open as little as possible, to make the test suite run
+ # better on windows/cygwin
+}
+
+
+sub sysread_or_die {
+ my $FH = shift;
+ my $scalar = shift;
+ my $length = shift;
+ my $fcaller;
+ my $lcaller;
+ my $result;
+
+ $result = sysread($$FH, $$scalar, $length);
+
+ if(not defined $result) {
+ ($fcaller, $lcaller) = (caller)[1,2];
+ logmsg "Failed to read input\n";
+ logmsg "Error: $srvrname server, sysread error: $!\n";
+ logmsg "Exited from sysread_or_die() at $fcaller " .
+ "line $lcaller. $srvrname server, sysread error: $!\n";
+ killsockfilters($proto, $ipvnum, $idnum, $verbose);
+ unlink($pidfile);
+ if($serverlogslocked) {
+ $serverlogslocked = 0;
+ clear_advisor_read_lock($SERVERLOGS_LOCK);
+ }
+ exit;
+ }
+ elsif($result == 0) {
+ ($fcaller, $lcaller) = (caller)[1,2];
+ logmsg "Failed to read input\n";
+ logmsg "Error: $srvrname server, read zero\n";
+ logmsg "Exited from sysread_or_die() at $fcaller " .
+ "line $lcaller. $srvrname server, read zero\n";
+ killsockfilters($proto, $ipvnum, $idnum, $verbose);
+ unlink($pidfile);
+ if($serverlogslocked) {
+ $serverlogslocked = 0;
+ clear_advisor_read_lock($SERVERLOGS_LOCK);
+ }
+ exit;
+ }
+
+ return $result;
+}
+
+sub startsf {
+ my $mainsockfcmd = "./server/sockfilt " .
+ "--ipv$ipvnum --port $port " .
+ "--pidfile \"$mainsockf_pidfile\" " .
+ "--logfile \"$mainsockf_logfile\"";
+ $sfpid = open2(*SFREAD, *SFWRITE, $mainsockfcmd);
+
+ print STDERR "$mainsockfcmd\n" if($verbose);
+
+ print SFWRITE "PING\n";
+ my $pong;
+ sysread_or_die(\*SFREAD, \$pong, 5);
+
+ if($pong !~ /^PONG/) {
+ logmsg "Failed sockfilt command: $mainsockfcmd\n";
+ killsockfilters($proto, $ipvnum, $idnum, $verbose);
+ unlink($pidfile);
+ if($serverlogslocked) {
+ $serverlogslocked = 0;
+ clear_advisor_read_lock($SERVERLOGS_LOCK);
+ }
+ die "Failed to start sockfilt!";
+ }
+}
+
+
+sub sockfilt {
+ my $l;
+ foreach $l (@_) {
+ printf SFWRITE "DATA\n%04x\n", length($l);
+ print SFWRITE $l;
+ }
+}
+
+
+sub sockfiltsecondary {
+ my $l;
+ foreach $l (@_) {
+ printf DWRITE "DATA\n%04x\n", length($l);
+ print DWRITE $l;
+ }
+}
+
+
+# Send data to the client on the control stream, which happens to be plain
+# stdout.
+
+sub sendcontrol {
+ if(!$ctrldelay) {
+ # spit it all out at once
+ sockfilt @_;
+ }
+ else {
+ my $a = join("", @_);
+ my @a = split("", $a);
+
+ for(@a) {
+ sockfilt $_;
+ select(undef, undef, undef, 0.01);
+ }
+ }
+ my $log;
+ foreach $log (@_) {
+ my $l = $log;
+ $l =~ s/[\r\n]//g;
+ logmsg "> \"$l\"\n";
+ }
+}
+
+# Send data to the client on the data stream
+
+sub senddata {
+ my $l;
+ foreach $l (@_) {
+ if(!$datadelay) {
+ # spit it all out at once
+ sockfiltsecondary $l;
+ }
+ else {
+ # pause between each byte
+ for (split(//,$l)) {
+ sockfiltsecondary $_;
+ select(undef, undef, undef, 0.01);
+ }
+ }
+ }
+}
+
+#**********************************************************************
+# protocolsetup initializes the 'displaytext' and 'commandfunc' hashes
+# for the given protocol. References to protocol command callbacks are
+# stored in 'commandfunc' hash, and text which will be returned to the
+# client before the command callback runs is stored in 'displaytext'.
+#
+sub protocolsetup {
+ my $proto = $_[0];
+
+ if($proto eq 'ftp') {
+ %commandfunc = (
+ 'PORT' => \&PORT_ftp,
+ 'EPRT' => \&PORT_ftp,
+ 'LIST' => \&LIST_ftp,
+ 'NLST' => \&NLST_ftp,
+ 'PASV' => \&PASV_ftp,
+ 'CWD' => \&CWD_ftp,
+ 'PWD' => \&PWD_ftp,
+ 'EPSV' => \&PASV_ftp,
+ 'RETR' => \&RETR_ftp,
+ 'SIZE' => \&SIZE_ftp,
+ 'REST' => \&REST_ftp,
+ 'STOR' => \&STOR_ftp,
+ 'APPE' => \&STOR_ftp, # append looks like upload
+ 'MDTM' => \&MDTM_ftp,
+ );
+ %displaytext = (
+ 'USER' => '331 We are happy you popped in!',
+ 'PASS' => '230 Welcome you silly person',
+ 'PORT' => '200 You said PORT - I say FINE',
+ 'TYPE' => '200 I modify TYPE as you wanted',
+ 'LIST' => '150 here comes a directory',
+ 'NLST' => '150 here comes a directory',
+ 'CWD' => '250 CWD command successful.',
+ 'SYST' => '215 UNIX Type: L8', # just fake something
+ 'QUIT' => '221 bye bye baby', # just reply something
+ 'MKD' => '257 Created your requested directory',
+ 'REST' => '350 Yeah yeah we set it there for you',
+ 'DELE' => '200 OK OK OK whatever you say',
+ 'RNFR' => '350 Received your order. Please provide more',
+ 'RNTO' => '250 Ok, thanks. File renaming completed.',
+ 'NOOP' => '200 Yes, I\'m very good at doing nothing.',
+ 'PBSZ' => '500 PBSZ not implemented',
+ 'PROT' => '500 PROT not implemented',
+ );
+ @welcome = (
+ '220- _ _ ____ _ '."\r\n",
+ '220- ___| | | | _ \| | '."\r\n",
+ '220- / __| | | | |_) | | '."\r\n",
+ '220- | (__| |_| | _ <| |___ '."\r\n",
+ '220 \___|\___/|_| \_\_____|'."\r\n"
+ );
+ }
+ elsif($proto eq 'pop3') {
+ %commandfunc = (
+ 'RETR' => \&RETR_pop3,
+ );
+ %displaytext = (
+ 'USER' => '+OK We are happy you popped in!',
+ 'PASS' => '+OK Access granted',
+ 'QUIT' => '+OK byebye',
+ );
+ @welcome = (
+ ' _ _ ____ _ '."\r\n",
+ ' ___| | | | _ \| | '."\r\n",
+ ' / __| | | | |_) | | '."\r\n",
+ ' | (__| |_| | _ <| |___ '."\r\n",
+ ' \___|\___/|_| \_\_____|'."\r\n",
+ '+OK cURL POP3 server ready to serve'."\r\n"
+ );
+ }
+ elsif($proto eq 'imap') {
+ %commandfunc = (
+ 'FETCH' => \&FETCH_imap,
+ 'SELECT' => \&SELECT_imap,
+ );
+ %displaytext = (
+ 'LOGIN' => ' OK We are happy you popped in!',
+ 'SELECT' => ' OK selection done',
+ 'LOGOUT' => ' OK thanks for the fish',
+ );
+ @welcome = (
+ ' _ _ ____ _ '."\r\n",
+ ' ___| | | | _ \| | '."\r\n",
+ ' / __| | | | |_) | | '."\r\n",
+ ' | (__| |_| | _ <| |___ '."\r\n",
+ ' \___|\___/|_| \_\_____|'."\r\n",
+ '* OK cURL IMAP server ready to serve'."\r\n"
+ );
+ }
+ elsif($proto eq 'smtp') {
+ %commandfunc = (
+ 'DATA' => \&DATA_smtp,
+ 'RCPT' => \&RCPT_smtp,
+ );
+ %displaytext = (
+ 'EHLO' => '230 We are happy you popped in!',
+ 'MAIL' => '200 Note taken',
+ 'RCPT' => '200 Receivers accepted',
+ 'QUIT' => '200 byebye',
+ );
+ @welcome = (
+ '220- _ _ ____ _ '."\r\n",
+ '220- ___| | | | _ \| | '."\r\n",
+ '220- / __| | | | |_) | | '."\r\n",
+ '220- | (__| |_| | _ <| |___ '."\r\n",
+ '220 \___|\___/|_| \_\_____|'."\r\n"
+ );
+ }
+}
+
+sub close_dataconn {
+ my ($closed)=@_; # non-zero if already disconnected
+
+ my $datapid = processexists($datasockf_pidfile);
+
+ if(!$closed) {
+ logmsg "* disconnect data connection\n";
+ if($datapid > 0) {
+ print DWRITE "DISC\n";
+ my $i;
+ sysread DREAD, $i, 5;
+ }
+ }
+ else {
+ logmsg "data connection already disconnected\n";
+ }
+ logmsg "=====> Closed data connection\n";
+
+ logmsg "* quit sockfilt for data (pid $datapid)\n";
+ if($datapid > 0) {
+ print DWRITE "QUIT\n";
+ waitpid($datapid, 0);
+ unlink($datasockf_pidfile) if(-f $datasockf_pidfile);
+ }
+}
+
+################
+################ SMTP commands
+################
+
+# what set by "RCPT"
+my $smtp_rcpt;
+
+sub DATA_smtp {
+ my $testno;
+
+ if($smtp_rcpt =~ /^TO:(.*)/) {
+ $testno = $1;
+ }
+ else {
+ return; # failure
+ }
+
+ if($testno eq "<verifiedserver>") {
+ sendcontrol "554 WE ROOLZ: $$\r\n";
+ return 0; # don't wait for data now
+ }
+ else {
+ $testno =~ s/^([^0-9]*)([0-9]+).*/$2/;
+ sendcontrol "354 Show me the mail\r\n";
+ }
+
+ logmsg "===> rcpt $testno was $smtp_rcpt\n";
+
+ my $filename = "log/upload.$testno";
+
+ logmsg "Store test number $testno in $filename\n";
+
+ open(FILE, ">$filename") ||
+ return 0; # failed to open output
+
+ my $line;
+ my $ulsize=0;
+ my $disc=0;
+ my $raw;
+ while (5 == (sysread \*SFREAD, $line, 5)) {
+ if($line eq "DATA\n") {
+ my $i;
+ my $eob;
+ sysread \*SFREAD, $i, 5;
+
+ my $size = 0;
+ if($i =~ /^([0-9a-fA-F]{4})\n/) {
+ $size = hex($1);
+ }
+
+ sysread \*SFREAD, $line, $size;
+
+ $ulsize += $size;
+ print FILE $line if(!$nosave);
+
+ $raw .= $line;
+ if($raw =~ /\x0d\x0a\x2e\x0d\x0a/) {
+ # end of data marker!
+ $eob = 1;
+ }
+ logmsg "> Appending $size bytes to file\n";
+ if($eob) {
+ logmsg "Found SMTP EOB marker\n";
+ last;
+ }
+ }
+ elsif($line eq "DISC\n") {
+ # disconnect!
+ $disc=1;
+ last;
+ }
+ else {
+ logmsg "No support for: $line";
+ last;
+ }
+ }
+ if($nosave) {
+ print FILE "$ulsize bytes would've been stored here\n";
+ }
+ close(FILE);
+ sendcontrol "250 OK, data received!\r\n";
+ logmsg "received $ulsize bytes upload\n";
+
+}
+
+sub RCPT_smtp {
+ my ($args) = @_;
+
+ $smtp_rcpt = $args;
+}
+
+################
+################ IMAP commands
+################
+
+# global to allow the command functions to read it
+my $cmdid;
+
+# what was picked by SELECT
+my $selected;
+
+sub SELECT_imap {
+ my ($testno) = @_;
+ my @data;
+ my $size;
+
+ logmsg "SELECT_imap got test $testno\n";
+
+ $selected = $testno;
+
+ return 0;
+}
+
+
+sub FETCH_imap {
+ my ($testno) = @_;
+ my @data;
+ my $size;
+
+ logmsg "FETCH_imap got test $testno\n";
+
+ $testno = $selected;
+
+ if($testno =~ /^verifiedserver$/) {
+ # this is the secret command that verifies that this actually is
+ # the curl test server
+ my $response = "WE ROOLZ: $$\r\n";
+ if($verbose) {
+ print STDERR "FTPD: We returned proof we are the test server\n";
+ }
+ $data[0] = $response;
+ logmsg "return proof we are we\n";
+ }
+ else {
+ logmsg "retrieve a mail\n";
+
+ $testno =~ s/^([^0-9]*)//;
+ my $testpart = "";
+ if ($testno > 10000) {
+ $testpart = $testno % 10000;
+ $testno = int($testno / 10000);
+ }
+
+ # send mail content
+ loadtest("$srcdir/data/test$testno");
+
+ @data = getpart("reply", "data$testpart");
+ }
+
+ for (@data) {
+ $size += length($_);
+ }
+
+ sendcontrol "* FETCH starts {$size}\r\n";
+
+ for my $d (@data) {
+ sendcontrol $d;
+ }
+
+ sendcontrol "$cmdid OK FETCH completed\r\n";
+
+ return 0;
+}
+
+################
+################ POP3 commands
+################
+
+sub RETR_pop3 {
+ my ($testno) = @_;
+ my @data;
+
+ if($testno =~ /^verifiedserver$/) {
+ # this is the secret command that verifies that this actually is
+ # the curl test server
+ my $response = "WE ROOLZ: $$\r\n";
+ if($verbose) {
+ print STDERR "FTPD: We returned proof we are the test server\n";
+ }
+ $data[0] = $response;
+ logmsg "return proof we are we\n";
+ }
+ else {
+ logmsg "retrieve a mail\n";
+
+ $testno =~ s/^([^0-9]*)//;
+ my $testpart = "";
+ if ($testno > 10000) {
+ $testpart = $testno % 10000;
+ $testno = int($testno / 10000);
+ }
+
+ # send mail content
+ loadtest("$srcdir/data/test$testno");
+
+ @data = getpart("reply", "data$testpart");
+ }
+
+ sendcontrol "+OK Mail transfer starts\r\n";
+
+ for my $d (@data) {
+ sendcontrol $d;
+ }
+
+ # end with the magic 5-byte end of mail marker
+ sendcontrol "\r\n.\r\n";
+
+ return 0;
+}
+
+################
+################ FTP commands
+################
+my $rest=0;
+sub REST_ftp {
+ $rest = $_[0];
+ logmsg "Set REST position to $rest\n"
+}
+
+sub switch_directory_goto {
+ my $target_dir = $_;
+
+ if(!$ftptargetdir) {
+ $ftptargetdir = "/";
+ }
+
+ if($target_dir eq "") {
+ $ftptargetdir = "/";
+ }
+ elsif($target_dir eq "..") {
+ if($ftptargetdir eq "/") {
+ $ftptargetdir = "/";
+ }
+ else {
+ $ftptargetdir =~ s/[[:alnum:]]+\/$//;
+ }
+ }
+ else {
+ $ftptargetdir .= $target_dir . "/";
+ }
+}
+
+sub switch_directory {
+ my $target_dir = $_[0];
+
+ if($target_dir eq "/") {
+ $ftptargetdir = "/";
+ }
+ else {
+ my @dirs = split("/", $target_dir);
+ for(@dirs) {
+ switch_directory_goto($_);
+ }
+ }
+}
+
+sub CWD_ftp {
+ my ($folder, $fullcommand) = $_[0];
+ switch_directory($folder);
+ if($ftptargetdir =~ /^\/fully_simulated/) {
+ $ftplistparserstate = "enabled";
+ }
+ else {
+ undef $ftplistparserstate;
+ }
+}
+
+sub PWD_ftp {
+ my $mydir;
+ $mydir = $ftptargetdir ? $ftptargetdir : "/";
+
+ if($mydir ne "/") {
+ $mydir =~ s/\/$//;
+ }
+ sendcontrol "257 \"$mydir\" is current directory\r\n";
+}
+
+sub LIST_ftp {
+ # print "150 ASCII data connection for /bin/ls (193.15.23.1,59196) (0 bytes)\r\n";
+
+# this is a built-in fake-dir ;-)
+my @ftpdir=("total 20\r\n",
+"drwxr-xr-x 8 98 98 512 Oct 22 13:06 .\r\n",
+"drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..\r\n",
+"drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT\r\n",
+"-r--r--r-- 1 0 1 35 Jul 16 1996 README\r\n",
+"lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin\r\n",
+"dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev\r\n",
+"drwxrwxrwx 2 98 98 512 May 29 16:04 download.html\r\n",
+"dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc\r\n",
+"drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub\r\n",
+"dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr\r\n");
+
+ if($ftplistparserstate) {
+ @ftpdir = ftp_contentlist($ftptargetdir);
+ }
+
+ logmsg "pass LIST data on data connection\n";
+ for(@ftpdir) {
+ senddata $_;
+ }
+ close_dataconn(0);
+ sendcontrol "226 ASCII transfer complete\r\n";
+ return 0;
+}
+
+sub NLST_ftp {
+ my @ftpdir=("file", "with space", "fake", "..", " ..", "funny", "README");
+ logmsg "pass NLST data on data connection\n";
+ for(@ftpdir) {
+ senddata "$_\r\n";
+ }
+ close_dataconn(0);
+ sendcontrol "226 ASCII transfer complete\r\n";
+ return 0;
+}
+
+sub MDTM_ftp {
+ my $testno = $_[0];
+ my $testpart = "";
+ if ($testno > 10000) {
+ $testpart = $testno % 10000;
+ $testno = int($testno / 10000);
+ }
+
+ loadtest("$srcdir/data/test$testno");
+
+ my @data = getpart("reply", "mdtm");
+
+ my $reply = $data[0];
+ chomp $reply if($reply);
+
+ if($reply && ($reply =~ /^[+-]?\d+$/) && ($reply < 0)) {
+ sendcontrol "550 $testno: no such file.\r\n";
+ }
+ elsif($reply) {
+ sendcontrol "$reply\r\n";
+ }
+ else {
+ sendcontrol "500 MDTM: no such command.\r\n";
+ }
+ return 0;
+}
+
+sub SIZE_ftp {
+ my $testno = $_[0];
+ if($ftplistparserstate) {
+ my $size = wildcard_filesize($ftptargetdir, $testno);
+ if($size == -1) {
+ sendcontrol "550 $testno: No such file or directory.\r\n";
+ }
+ else {
+ sendcontrol "213 $size\r\n";
+ }
+ return 0;
+ }
+
+ if($testno =~ /^verifiedserver$/) {
+ my $response = "WE ROOLZ: $$\r\n";
+ my $size = length($response);
+ sendcontrol "213 $size\r\n";
+ return 0;
+ }
+
+ if($testno =~ /(\d+)\/?$/) {
+ $testno = $1;
+ }
+ else {
+ print STDERR "SIZE_ftp: invalid test number: $testno\n";
+ return 1;
+ }
+
+ my $testpart = "";
+ if($testno > 10000) {
+ $testpart = $testno % 10000;
+ $testno = int($testno / 10000);
+ }
+
+ loadtest("$srcdir/data/test$testno");
+
+ my @data = getpart("reply", "size");
+
+ my $size = $data[0];
+
+ if($size) {
+ if($size > -1) {
+ sendcontrol "213 $size\r\n";
+ }
+ else {
+ sendcontrol "550 $testno: No such file or directory.\r\n";
+ }
+ }
+ else {
+ $size=0;
+ @data = getpart("reply", "data$testpart");
+ for(@data) {
+ $size += length($_);
+ }
+ if($size) {
+ sendcontrol "213 $size\r\n";
+ }
+ else {
+ sendcontrol "550 $testno: No such file or directory.\r\n";
+ }
+ }
+ return 0;
+}
+
+sub RETR_ftp {
+ my ($testno) = @_;
+
+ if($ftplistparserstate) {
+ my @content = wildcard_getfile($ftptargetdir, $testno);
+ if($content[0] == -1) {
+ #file not found
+ }
+ else {
+ my $size = length $content[1];
+ sendcontrol "150 Binary data connection for $testno ($size bytes).\r\n",
+ senddata $content[1];
+ close_dataconn(0);
+ sendcontrol "226 File transfer complete\r\n";
+ }
+ return 0;
+ }
+
+ if($testno =~ /^verifiedserver$/) {
+ # this is the secret command that verifies that this actually is
+ # the curl test server
+ my $response = "WE ROOLZ: $$\r\n";
+ my $len = length($response);
+ sendcontrol "150 Binary junk ($len bytes).\r\n";
+ senddata "WE ROOLZ: $$\r\n";
+ close_dataconn(0);
+ sendcontrol "226 File transfer complete\r\n";
+ if($verbose) {
+ print STDERR "FTPD: We returned proof we are the test server\n";
+ }
+ return 0;
+ }
+
+ $testno =~ s/^([^0-9]*)//;
+ my $testpart = "";
+ if ($testno > 10000) {
+ $testpart = $testno % 10000;
+ $testno = int($testno / 10000);
+ }
+
+ loadtest("$srcdir/data/test$testno");
+
+ my @data = getpart("reply", "data$testpart");
+
+ my $size=0;
+ for(@data) {
+ $size += length($_);
+ }
+
+ my %hash = getpartattr("reply", "data$testpart");
+
+ if($size || $hash{'sendzero'}) {
+
+ if($rest) {
+ # move read pointer forward
+ $size -= $rest;
+ logmsg "REST $rest was removed from size, makes $size left\n";
+ $rest = 0; # reset REST offset again
+ }
+ if($retrweirdo) {
+ sendcontrol "150 Binary data connection for $testno () ($size bytes).\r\n",
+ "226 File transfer complete\r\n";
+
+ for(@data) {
+ my $send = $_;
+ senddata $send;
+ }
+ close_dataconn(0);
+ $retrweirdo=0; # switch off the weirdo again!
+ }
+ else {
+ my $sz = "($size bytes)";
+ if($retrnosize) {
+ $sz = "size?";
+ }
+
+ sendcontrol "150 Binary data connection for $testno () $sz.\r\n";
+
+ for(@data) {
+ my $send = $_;
+ senddata $send;
+ }
+ close_dataconn(0);
+ sendcontrol "226 File transfer complete\r\n";
+ }
+ }
+ else {
+ sendcontrol "550 $testno: No such file or directory.\r\n";
+ }
+ return 0;
+}
+
+sub STOR_ftp {
+ my $testno=$_[0];
+
+ my $filename = "log/upload.$testno";
+
+ logmsg "STOR test number $testno in $filename\n";
+
+ sendcontrol "125 Gimme gimme gimme!\r\n";
+
+ open(FILE, ">$filename") ||
+ return 0; # failed to open output
+
+ my $line;
+ my $ulsize=0;
+ my $disc=0;
+ while (5 == (sysread DREAD, $line, 5)) {
+ if($line eq "DATA\n") {
+ my $i;
+ sysread DREAD, $i, 5;
+
+ my $size = 0;
+ if($i =~ /^([0-9a-fA-F]{4})\n/) {
+ $size = hex($1);
+ }
+
+ sysread DREAD, $line, $size;
+
+ #print STDERR " GOT: $size bytes\n";
+
+ $ulsize += $size;
+ print FILE $line if(!$nosave);
+ logmsg "> Appending $size bytes to file\n";
+ }
+ elsif($line eq "DISC\n") {
+ # disconnect!
+ $disc=1;
+ last;
+ }
+ else {
+ logmsg "No support for: $line";
+ last;
+ }
+ }
+ if($nosave) {
+ print FILE "$ulsize bytes would've been stored here\n";
+ }
+ close(FILE);
+ close_dataconn($disc);
+ logmsg "received $ulsize bytes upload\n";
+ sendcontrol "226 File transfer complete\r\n";
+ return 0;
+}
+
+sub PASV_ftp {
+ my ($arg, $cmd)=@_;
+ my $pasvport;
+
+ # kill previous data connection sockfilt when alive
+ killsockfilters($proto, $ipvnum, $idnum, $verbose, 'data');
+
+ # We fire up a new sockfilt to do the data transfer for us.
+ my $datasockfcmd = "./server/sockfilt " .
+ "--ipv$ipvnum --port 0 " .
+ "--pidfile \"$datasockf_pidfile\" " .
+ "--logfile \"$datasockf_logfile\"";
+ $slavepid = open2(\*DREAD, \*DWRITE, $datasockfcmd);
+
+ print DWRITE "PING\n";
+ my $pong;
+ sysread_or_die(\*DREAD, \$pong, 5);
+
+ if($pong !~ /^PONG/) {
+ logmsg "failed to run sockfilt for data connection\n";
+ killsockfilters($proto, $ipvnum, $idnum, $verbose, 'data');
+ sendcontrol "500 no free ports!\r\n";
+ return 0;
+ }
+
+ logmsg "Run sockfilt for data on pid $slavepid\n";
+
+ # Find out what port we listen on
+ my $i;
+ print DWRITE "PORT\n";
+
+ # READ the response code
+ sysread_or_die(\*DREAD, \$i, 5);
+
+ # READ the response size
+ sysread_or_die(\*DREAD, \$i, 5);
+
+ my $size = 0;
+ if($i =~ /^([0-9a-fA-F]{4})\n/) {
+ $size = hex($1);
+ }
+
+ # READ the response data
+ sysread_or_die(\*DREAD, \$i, $size);
+
+ # The data is in the format
+ # IPvX/NNN
+
+ if($i =~ /IPv(\d)\/(\d+)/) {
+ # FIX: deal with IP protocol version
+ $pasvport = $2;
+ }
+
+ if($cmd ne "EPSV") {
+ # PASV reply
+ my $p=$listenaddr;
+ $p =~ s/\./,/g;
+ if($pasvbadip) {
+ $p="1,2,3,4";
+ }
+ sendcontrol sprintf("227 Entering Passive Mode ($p,%d,%d)\n",
+ ($pasvport/256), ($pasvport%256));
+ }
+ else {
+ # EPSV reply
+ sendcontrol sprintf("229 Entering Passive Mode (|||%d|)\n", $pasvport);
+ }
+
+ eval {
+ local $SIG{ALRM} = sub { die "alarm\n" };
+
+ # assume swift operations unless explicitly slow
+ alarm ($datadelay?20:10);
+
+ # Wait for 'CNCT'
+ my $input;
+
+ while(sysread(DREAD, $input, 5)) {
+
+ if($input !~ /^CNCT/) {
+ # we wait for a connected client
+ logmsg "Odd, we got $input from client\n";
+ next;
+ }
+ logmsg "====> Client DATA connect\n";
+ last;
+ }
+ alarm 0;
+ };
+ if ($@) {
+ # timed out
+ logmsg "$srvrname server timed out awaiting data connection ".
+ "on port $pasvport\n";
+ logmsg "accept failed or connection not even attempted\n";
+ killsockfilters($proto, $ipvnum, $idnum, $verbose, 'data');
+ return;
+ }
+ else {
+ logmsg "data connection setup on port $pasvport\n";
+ }
+
+ return;
+}
+
+# Support both PORT and EPRT here. Consider LPRT too.
+
+sub PORT_ftp {
+ my ($arg, $cmd) = @_;
+ my $port;
+ my $addr;
+
+ # We always ignore the given IP and use localhost.
+
+ if($cmd eq "PORT") {
+ if($arg !~ /(\d+),(\d+),(\d+),(\d+),(\d+),(\d+)/) {
+ logmsg "bad PORT-line: $arg\n";
+ sendcontrol "500 silly you, go away\r\n";
+ return 0;
+ }
+ $port = ($5<<8)+$6;
+ $addr = "$1.$2.$3.$4";
+ }
+ # EPRT |2|::1|49706|
+ elsif(($cmd eq "EPRT") && ($grok_eprt)) {
+ if($arg !~ /(\d+)\|([^\|]+)\|(\d+)/) {
+ sendcontrol "500 silly you, go away\r\n";
+ return 0;
+ }
+ sendcontrol "200 Thanks for dropping by. We contact you later\r\n";
+ $port = $3;
+ $addr = $2;
+ }
+ else {
+ sendcontrol "500 we don't like $cmd now\r\n";
+ return 0;
+ }
+
+ if(!$port || $port > 65535) {
+ print STDERR "very illegal PORT number: $port\n";
+ return 1;
+ }
+
+ # We fire up a new sockfilt to do the data transfer for us.
+ my $datasockfcmd = "./server/sockfilt " .
+ "--ipv$ipvnum --connect $port --addr \"$addr\" " .
+ "--pidfile \"$datasockf_pidfile\" " .
+ "--logfile \"$datasockf_logfile\"";
+ $slavepid = open2(\*DREAD, \*DWRITE, $datasockfcmd);
+
+ print STDERR "$datasockfcmd\n" if($verbose);
+
+ print DWRITE "PING\n";
+ my $pong;
+ sysread_or_die(\*DREAD, \$pong, 5);
+
+ if($pong !~ /^PONG/) {
+ logmsg "Failed sockfilt for data connection\n";
+ killsockfilters($proto, $ipvnum, $idnum, $verbose, 'data');
+ }
+
+ logmsg "====> Client DATA connect to port $port\n";
+
+ return;
+}
+
+#**********************************************************************
+# customize configures test server operation for each curl test, reading
+# configuration commands/parameters from server commands file each time
+# a new client control connection is established with the test server.
+# On success returns 1, otherwise zero.
+#
+sub customize {
+ $ctrldelay = 0; # default is no throttling of the ctrl stream
+ $datadelay = 0; # default is no throttling of the data stream
+ $retrweirdo = 0; # default is no use of RETRWEIRDO
+ $retrnosize = 0; # default is no use of RETRNOSIZE
+ $pasvbadip = 0; # default is no use of PASVBADIP
+ $nosave = 0; # default is to actually save uploaded data to file
+ %customreply = (); #
+ %customcount = (); #
+ %delayreply = (); #
+
+ open(CUSTOM, "<log/ftpserver.cmd") ||
+ return 1;
+
+ logmsg "FTPD: Getting commands from log/ftpserver.cmd\n";
+
+ while(<CUSTOM>) {
+ if($_ =~ /REPLY ([A-Za-z0-9+\/=]+) (.*)/) {
+ $customreply{$1}=eval "qq{$2}";
+ logmsg "FTPD: set custom reply for $1\n";
+ }
+ if($_ =~ /COUNT ([A-Z]+) (.*)/) {
+ # we blank the customreply for this command when having
+ # been used this number of times
+ $customcount{$1}=$2;
+ logmsg "FTPD: blank custom reply for $1 after $2 uses\n";
+ }
+ elsif($_ =~ /DELAY ([A-Z]+) (\d*)/) {
+ $delayreply{$1}=$2;
+ logmsg "FTPD: delay reply for $1 with $2 seconds\n";
+ }
+ elsif($_ =~ /SLOWDOWN/) {
+ $ctrldelay=1;
+ $datadelay=1;
+ logmsg "FTPD: send response with 0.01 sec delay between each byte\n";
+ }
+ elsif($_ =~ /RETRWEIRDO/) {
+ logmsg "FTPD: instructed to use RETRWEIRDO\n";
+ $retrweirdo=1;
+ }
+ elsif($_ =~ /RETRNOSIZE/) {
+ logmsg "FTPD: instructed to use RETRNOSIZE\n";
+ $retrnosize=1;
+ }
+ elsif($_ =~ /PASVBADIP/) {
+ logmsg "FTPD: instructed to use PASVBADIP\n";
+ $pasvbadip=1;
+ }
+ elsif($_ =~ /NOSAVE/) {
+ # don't actually store the file we upload - to be used when
+ # uploading insanely huge amounts
+ $nosave = 1;
+ logmsg "FTPD: NOSAVE prevents saving of uploaded data\n";
+ }
+ }
+ close(CUSTOM);
+}
+
+#----------------------------------------------------------------------
+#----------------------------------------------------------------------
+#--------------------------- END OF SUBS ----------------------------
+#----------------------------------------------------------------------
+#----------------------------------------------------------------------
+
+#**********************************************************************
+# Parse command line options
+#
+# Options:
+#
+# --verbose # verbose
+# --srcdir # source directory
+# --id # server instance number
+# --proto # server protocol
+# --pidfile # server pid file
+# --logfile # server log file
+# --ipv4 # server IP version 4
+# --ipv6 # server IP version 6
+# --port # server listener port
+# --addr # server address for listener port binding
+#
+while(@ARGV) {
+ if($ARGV[0] eq '--verbose') {
+ $verbose = 1;
+ }
+ elsif($ARGV[0] eq '--srcdir') {
+ if($ARGV[1]) {
+ $srcdir = $ARGV[1];
+ shift @ARGV;
+ }
+ }
+ elsif($ARGV[0] eq '--id') {
+ if($ARGV[1] && ($ARGV[1] =~ /^(\d+)$/)) {
+ $idnum = $1 if($1 > 0);
+ shift @ARGV;
+ }
+ }
+ elsif($ARGV[0] eq '--proto') {
+ if($ARGV[1] && ($ARGV[1] =~ /^(ftp|imap|pop3|smtp)$/)) {
+ $proto = $1;
+ shift @ARGV;
+ }
+ else {
+ die "unsupported protocol $ARGV[1]";
+ }
+ }
+ elsif($ARGV[0] eq '--pidfile') {
+ if($ARGV[1]) {
+ $pidfile = $ARGV[1];
+ shift @ARGV;
+ }
+ }
+ elsif($ARGV[0] eq '--logfile') {
+ if($ARGV[1]) {
+ $logfile = $ARGV[1];
+ shift @ARGV;
+ }
+ }
+ elsif($ARGV[0] eq '--ipv4') {
+ $ipvnum = 4;
+ $listenaddr = '127.0.0.1' if($listenaddr eq '::1');
+ $grok_eprt = 0;
+ }
+ elsif($ARGV[0] eq '--ipv6') {
+ $ipvnum = 6;
+ $listenaddr = '::1' if($listenaddr eq '127.0.0.1');
+ $grok_eprt = 1;
+ }
+ elsif($ARGV[0] eq '--port') {
+ if($ARGV[1] && ($ARGV[1] =~ /^(\d+)$/)) {
+ $port = $1 if($1 > 1024);
+ shift @ARGV;
+ }
+ }
+ elsif($ARGV[0] eq '--addr') {
+ if($ARGV[1]) {
+ my $tmpstr = $ARGV[1];
+ if($tmpstr =~ /^(\d\d?\d?)\.(\d\d?\d?)\.(\d\d?\d?)\.(\d\d?\d?)$/) {
+ $listenaddr = "$1.$2.$3.$4" if($ipvnum == 4);
+ }
+ elsif($ipvnum == 6) {
+ $listenaddr = $tmpstr;
+ $listenaddr =~ s/^\[(.*)\]$/$1/;
+ }
+ shift @ARGV;
+ }
+ }
+ else {
+ print STDERR "\nWarning: ftpserver.pl unknown parameter: $ARGV[0]\n";
+ }
+ shift @ARGV;
+}
+
+#***************************************************************************
+# Initialize command line option dependant variables
+#
+
+if(!$srcdir) {
+ $srcdir = $ENV{'srcdir'} || '.';
+}
+if(!$pidfile) {
+ $pidfile = "$path/". server_pidfilename($proto, $ipvnum, $idnum);
+}
+if(!$logfile) {
+ $logfile = server_logfilename($logdir, $proto, $ipvnum, $idnum);
+}
+
+$mainsockf_pidfile = "$path/".
+ mainsockf_pidfilename($proto, $ipvnum, $idnum);
+$mainsockf_logfile =
+ mainsockf_logfilename($logdir, $proto, $ipvnum, $idnum);
+
+if($proto eq 'ftp') {
+ $datasockf_pidfile = "$path/".
+ datasockf_pidfilename($proto, $ipvnum, $idnum);
+ $datasockf_logfile =
+ datasockf_logfilename($logdir, $proto, $ipvnum, $idnum);
+}
+
+$srvrname = servername_str($proto, $ipvnum, $idnum);
+
+$idstr = "$idnum" if($idnum > 1);
+
+protocolsetup($proto);
+
+$SIG{INT} = \&exit_signal_handler;
+$SIG{TERM} = \&exit_signal_handler;
+
+startsf();
+
+logmsg sprintf("%s server listens on port IPv${ipvnum}/${port}\n", uc($proto));
+
+open(PID, ">$pidfile");
+print PID $$."\n";
+close(PID);
+
+logmsg("logged pid $$ in $pidfile\n");
+
+
+while(1) {
+ #
+ # We read 'sockfilt' commands.
+ #
+ my $input;
+
+ logmsg "Awaiting input\n";
+ sysread_or_die(\*SFREAD, \$input, 5);
+
+ if($input !~ /^CNCT/) {
+ # we wait for a connected client
+ logmsg "sockfilt said: $input";
+ next;
+ }
+ logmsg "====> Client connect\n";
+
+ set_advisor_read_lock($SERVERLOGS_LOCK);
+ $serverlogslocked = 1;
+
+ # flush data:
+ $| = 1;
+
+ killsockfilters($proto, $ipvnum, $idnum, $verbose, 'data');
+
+ &customize(); # read test control instructions
+
+ sendcontrol @welcome;
+
+ #remove global variables from last connection
+ if($ftplistparserstate) {
+ undef $ftplistparserstate;
+ }
+ if($ftptargetdir) {
+ undef $ftptargetdir;
+ }
+
+ if($verbose) {
+ for(@welcome) {
+ print STDERR "OUT: $_";
+ }
+ }
+
+ while(1) {
+ my $i;
+
+ # Now we expect to read DATA\n[hex size]\n[prot], where the [prot]
+ # part only is FTP lingo.
+
+ # COMMAND
+ sysread_or_die(\*SFREAD, \$i, 5);
+
+ if($i !~ /^DATA/) {
+ logmsg "sockfilt said $i";
+ if($i =~ /^DISC/) {
+ # disconnect
+ last;
+ }
+ next;
+ }
+
+ # SIZE of data
+ sysread_or_die(\*SFREAD, \$i, 5);
+
+ my $size = 0;
+ if($i =~ /^([0-9a-fA-F]{4})\n/) {
+ $size = hex($1);
+ }
+
+ # data
+ sysread SFREAD, $_, $size;
+
+ ftpmsg $_;
+
+ # Remove trailing CRLF.
+ s/[\n\r]+$//;
+
+ my $FTPCMD;
+ my $FTPARG;
+ my $full=$_;
+ if($proto eq "imap") {
+ # IMAP is different with its identifier first on the command line
+ unless (m/^([^ ]+) ([^ ]+) (.*)/ ||
+ m/^([^ ]+) ([^ ]+)/) {
+ sendcontrol "$1 '$_': command not understood.\r\n";
+ last;
+ }
+ $cmdid=$1; # set the global variable
+ $FTPCMD=$2;
+ $FTPARG=$3;
+ }
+ elsif (m/^([A-Z]{3,4})(\s(.*))?$/i) {
+ $FTPCMD=$1;
+ $FTPARG=$3;
+ }
+ elsif($proto eq "smtp" && m/^[A-Z0-9+\/]{0,512}={0,2}$/i) {
+ # SMTP long "commands" are base64 authentication data.
+ $FTPCMD=$_;
+ $FTPARG="";
+ }
+ else {
+ sendcontrol "500 '$_': command not understood.\r\n";
+ last;
+ }
+
+ logmsg "< \"$full\"\n";
+
+ if($verbose) {
+ print STDERR "IN: $full\n";
+ }
+
+ my $delay = $delayreply{$FTPCMD};
+ if($delay) {
+ # just go sleep this many seconds!
+ logmsg("Sleep for $delay seconds\n");
+ my $twentieths = $delay * 20;
+ while($twentieths--) {
+ select(undef, undef, undef, 0.05) unless($got_exit_signal);
+ }
+ }
+
+ my $text;
+ $text = $customreply{$FTPCMD};
+ my $fake = $text;
+
+ if($text && ($text ne "")) {
+ if($customcount{$FTPCMD} && (!--$customcount{$FTPCMD})) {
+ # used enough number of times, now blank the customreply
+ $customreply{$FTPCMD}="";
+ }
+ }
+ else {
+ $text = $displaytext{$FTPCMD};
+ }
+ my $check;
+ if($text && ($text ne "")) {
+ if($cmdid && ($cmdid ne "")) {
+ sendcontrol "$cmdid$text\r\n";
+ }
+ else {
+ sendcontrol "$text\r\n";
+ }
+ }
+ else {
+ $check=1; # no response yet
+ }
+
+ unless($fake && ($fake ne "")) {
+ # only perform this if we're not faking a reply
+ my $func = $commandfunc{$FTPCMD};
+ if($func) {
+ &$func($FTPARG, $FTPCMD);
+ $check=0; # taken care of
+ }
+ }
+
+ if($check) {
+ logmsg "$FTPCMD wasn't handled!\n";
+ sendcontrol "500 $FTPCMD is not dealt with!\r\n";
+ }
+
+ } # while(1)
+ logmsg "====> Client disconnected\n";
+
+ if($serverlogslocked) {
+ $serverlogslocked = 0;
+ clear_advisor_read_lock($SERVERLOGS_LOCK);
+ }
+}
+
+killsockfilters($proto, $ipvnum, $idnum, $verbose);
+unlink($pidfile);
+if($serverlogslocked) {
+ $serverlogslocked = 0;
+ clear_advisor_read_lock($SERVERLOGS_LOCK);
+}
+
+exit;
diff --git a/tests/getpart.pm b/tests/getpart.pm
new file mode 100644
index 000000000..42e3b2b2e
--- /dev/null
+++ b/tests/getpart.pm
@@ -0,0 +1,224 @@
+
+#use strict;
+
+my @xml;
+
+my $warning=0;
+my $trace=0;
+
+sub decode_base64 {
+ tr:A-Za-z0-9+/::cd; # remove non-base64 chars
+ tr:A-Za-z0-9+/: -_:; # convert to uuencoded format
+ my $len = pack("c", 32 + 0.75*length); # compute length byte
+ return unpack("u", $len . $_); # uudecode and print
+}
+
+sub getpartattr {
+ # if $part is undefined (ie only one argument) then
+ # return the attributes of the section
+
+ my ($section, $part)=@_;
+
+ my %hash;
+ my $inside=0;
+
+ # print "Section: $section, part: $part\n";
+
+ for(@xml) {
+ # print "$inside: $_";
+ if(!$inside && ($_ =~ /^ *\<$section/)) {
+ $inside++;
+ }
+ if((1 ==$inside) && ( ($_ =~ /^ *\<$part([^>]*)/) ||
+ !(defined($part)) )
+ ) {
+ $inside++;
+ my $attr=$1;
+
+ while($attr =~ s/ *([^=]*)= *(\"([^\"]*)\"|([^\"> ]*))//) {
+ my ($var, $cont)=($1, $2);
+ $cont =~ s/^\"(.*)\"$/$1/;
+ $hash{$var}=$cont;
+ }
+ last;
+ }
+ elsif((2 ==$inside) && ($_ =~ /^ *\<\/$part/)) {
+ $inside--;
+ }
+ }
+ return %hash;
+}
+
+sub getpart {
+ my ($section, $part)=@_;
+
+ my @this;
+ my $inside=0;
+ my $base64=0;
+
+ # print "Section: $section, part: $part\n";
+
+ for(@xml) {
+ # print "$inside: $_";
+ if(!$inside && ($_ =~ /^ *\<$section/)) {
+ $inside++;
+ }
+ elsif((1 ==$inside) && ($_ =~ /^ *\<$part[ \>]/)) {
+ if($_ =~ /$part [^>]*base64=/) {
+ # attempt to detect base64 encoded parts
+ $base64=1;
+ }
+ $inside++;
+ }
+ elsif((2 ==$inside) && ($_ =~ /^ *\<\/$part/)) {
+ $inside--;
+ }
+ elsif((1==$inside) && ($_ =~ /^ *\<\/$section/)) {
+ if($trace) {
+ print STDERR "*** getpart.pm: $section/$part returned data!\n";
+ }
+ if(!@this && $warning) {
+ print STDERR "*** getpart.pm: $section/$part returned empty!\n";
+ }
+ if($base64) {
+ # decode the whole array before returning it!
+ for(@this) {
+ my $decoded = decode_base64($_);
+ $_ = $decoded;
+ }
+ }
+ return @this;
+ }
+ elsif(2==$inside) {
+ push @this, $_;
+ }
+ }
+ if($warning) {
+ print STDERR "*** getpart.pm: $section/$part returned empty!\n";
+ }
+ return @this; #empty!
+}
+
+sub loadtest {
+ my ($file)=@_;
+
+ undef @xml;
+
+ if(open(XML, "<$file")) {
+ binmode XML; # for crapage systems, use binary
+ while(<XML>) {
+ push @xml, $_;
+ }
+ close(XML);
+ }
+ else {
+ # failure
+ if($warning) {
+ print STDERR "file $file wouldn't open!\n";
+ }
+ return 1;
+ }
+ return 0;
+}
+
+#
+# Strip off all lines that match the specified pattern and return
+# the new array.
+#
+
+sub striparray {
+ my ($pattern, $arrayref) = @_;
+
+ my @array;
+
+ for(@$arrayref) {
+ if($_ !~ /$pattern/) {
+ push @array, $_;
+ }
+ }
+ return @array;
+}
+
+#
+# pass array *REFERENCES* !
+#
+sub compareparts {
+ my ($firstref, $secondref)=@_;
+
+ my $first = join("", @$firstref);
+ my $second = join("", @$secondref);
+
+ # we cannot compare arrays index per index since with the base64 chunks,
+ # they may not be "evenly" distributed
+
+ # NOTE: this no longer strips off carriage returns from the arrays. Is that
+ # really necessary? It ruins the testing of newlines. I believe it was once
+ # added to enable tests on win32.
+
+ if($first ne $second) {
+ return 1;
+ }
+
+ return 0;
+}
+
+#
+# Write a given array to the specified file
+#
+sub writearray {
+ my ($filename, $arrayref)=@_;
+
+ open(TEMP, ">$filename");
+ binmode(TEMP,":raw"); # cygwin fix by Kevin Roth
+ for(@$arrayref) {
+ print TEMP $_;
+ }
+ close(TEMP);
+}
+
+#
+# Load a specified file an return it as an array
+#
+sub loadarray {
+ my ($filename)=@_;
+ my @array;
+
+ open(TEMP, "<$filename");
+ while(<TEMP>) {
+ push @array, $_;
+ }
+ close(TEMP);
+ return @array;
+}
+
+# Given two array references, this function will store them in two temporary
+# files, run 'diff' on them, store the result and return the diff output!
+
+sub showdiff {
+ my ($logdir, $firstref, $secondref)=@_;
+
+ my $file1="$logdir/check-generated";
+ my $file2="$logdir/check-expected";
+
+ open(TEMP, ">$file1");
+ for(@$firstref) {
+ print TEMP $_;
+ }
+ close(TEMP);
+
+ open(TEMP, ">$file2");
+ for(@$secondref) {
+ print TEMP $_;
+ }
+ close(TEMP);
+ my @out = `diff -u $file2 $file1 2>/dev/null`;
+
+ if(!$out[0]) {
+ @out = `diff -c $file2 $file1 2>/dev/null`;
+ }
+
+ return @out;
+}
+
+
+1;
diff --git a/tests/httpserver.pl b/tests/httpserver.pl
new file mode 100755
index 000000000..37161f061
--- /dev/null
+++ b/tests/httpserver.pl
@@ -0,0 +1,118 @@
+#!/usr/bin/env perl
+#***************************************************************************
+# _ _ ____ _
+# Project ___| | | | _ \| |
+# / __| | | | |_) | |
+# | (__| |_| | _ <| |___
+# \___|\___/|_| \_\_____|
+#
+# Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+#
+# This software is licensed as described in the file COPYING, which
+# you should have received as part of this distribution. The terms
+# are also available at http://curl.haxx.se/docs/copyright.html.
+#
+# You may opt to use, copy, modify, merge, publish, distribute and/or sell
+# copies of the Software, and permit persons to whom the Software is
+# furnished to do so, under the terms of the COPYING file.
+#
+# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+# KIND, either express or implied.
+#
+#***************************************************************************
+
+BEGIN {
+ @INC=(@INC, $ENV{'srcdir'}, '.');
+}
+
+use strict;
+use warnings;
+
+use serverhelp qw(
+ server_pidfilename
+ server_logfilename
+ );
+
+my $verbose = 0; # set to 1 for debugging
+my $port = 8990; # just a default
+my $ipvnum = 4; # default IP version of http server
+my $idnum = 1; # dafault http server instance number
+my $proto = 'http'; # protocol the http server speaks
+my $pidfile; # http server pid file
+my $logfile; # http server log file
+my $srcdir;
+my $fork;
+my $gopher = 0;
+
+my $flags = "";
+my $path = '.';
+my $logdir = $path .'/log';
+
+while(@ARGV) {
+ if($ARGV[0] eq '--pidfile') {
+ if($ARGV[1]) {
+ $pidfile = $ARGV[1];
+ shift @ARGV;
+ }
+ }
+ elsif($ARGV[0] eq '--logfile') {
+ if($ARGV[1]) {
+ $logfile = $ARGV[1];
+ shift @ARGV;
+ }
+ }
+ elsif($ARGV[0] eq '--srcdir') {
+ if($ARGV[1]) {
+ $srcdir = $ARGV[1];
+ shift @ARGV;
+ }
+ }
+ elsif($ARGV[0] eq '--ipv4') {
+ $ipvnum = 4;
+ }
+ elsif($ARGV[0] eq '--ipv6') {
+ $ipvnum = 6;
+ }
+ elsif($ARGV[0] eq '--gopher') {
+ $gopher = 1;
+ }
+ elsif($ARGV[0] eq '--port') {
+ if($ARGV[1] =~ /^(\d+)$/) {
+ $port = $1;
+ shift @ARGV;
+ }
+ }
+ elsif($ARGV[0] eq '--id') {
+ if($ARGV[1] =~ /^(\d+)$/) {
+ $idnum = $1 if($1 > 0);
+ shift @ARGV;
+ }
+ }
+ elsif($ARGV[0] eq '--verbose') {
+ $verbose = 1;
+ }
+ elsif($ARGV[0] eq '--fork') {
+ $fork = $ARGV[0];
+ }
+ else {
+ print STDERR "\nWarning: httpserver.pl unknown parameter: $ARGV[0]\n";
+ }
+ shift @ARGV;
+}
+
+if(!$srcdir) {
+ $srcdir = $ENV{'srcdir'} || '.';
+}
+if(!$pidfile) {
+ $pidfile = "$path/". server_pidfilename($proto, $ipvnum, $idnum);
+}
+if(!$logfile) {
+ $logfile = server_logfilename($logdir, $proto, $ipvnum, $idnum);
+}
+
+$flags .= "--gopher " if($gopher);
+$flags .= "--fork " if(defined($fork));
+$flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
+$flags .= "--ipv$ipvnum --port $port --srcdir \"$srcdir\"";
+
+exec("server/sws $flags");
diff --git a/tests/libtest/Makefile.am b/tests/libtest/Makefile.am
new file mode 100644
index 000000000..9c0d59507
--- /dev/null
+++ b/tests/libtest/Makefile.am
@@ -0,0 +1,83 @@
+#***************************************************************************
+# _ _ ____ _
+# Project ___| | | | _ \| |
+# / __| | | | |_) | |
+# | (__| |_| | _ <| |___
+# \___|\___/|_| \_\_____|
+#
+# Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+#
+# This software is licensed as described in the file COPYING, which
+# you should have received as part of this distribution. The terms
+# are also available at http://curl.haxx.se/docs/copyright.html.
+#
+# You may opt to use, copy, modify, merge, publish, distribute and/or sell
+# copies of the Software, and permit persons to whom the Software is
+# furnished to do so, under the terms of the COPYING file.
+#
+# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+# KIND, either express or implied.
+#
+###########################################################################
+AUTOMAKE_OPTIONS = foreign nostdinc
+
+# Specify our include paths here, and do it relative to $(top_srcdir) and
+# $(top_builddir), to ensure that these paths which belong to the library
+# being currently built and tested are searched before the library which
+# might possibly already be installed in the system.
+#
+# $(top_builddir)/include/curl for generated curlbuild.h included from curl.h
+# $(top_builddir)/include for generated curlbuild.h included from lib/setup.h
+# $(top_srcdir)/include is for libcurl's external include files
+# $(top_builddir)/lib is for libcurl's generated lib/curl_config.h file
+# $(top_srcdir)/lib is for libcurl's lib/setup.h and other "borrowed" files
+# $(top_builddir)/ares is for in-tree c-ares's generated ares_build.h file
+# $(top_srcdir)/ares is for in-tree c-ares's external include files
+
+if USE_EMBEDDED_ARES
+INCLUDES = -I$(top_builddir)/include/curl \
+ -I$(top_builddir)/include \
+ -I$(top_srcdir)/include \
+ -I$(top_builddir)/lib \
+ -I$(top_srcdir)/lib \
+ -I$(top_builddir)/ares \
+ -I$(top_srcdir)/ares
+else
+INCLUDES = -I$(top_builddir)/include/curl \
+ -I$(top_builddir)/include \
+ -I$(top_srcdir)/include \
+ -I$(top_builddir)/lib \
+ -I$(top_srcdir)/lib
+endif
+
+EXTRA_DIST = test75.pl test307.pl test610.pl test613.pl test1013.pl \
+test1022.pl Makefile.inc
+
+# Dependencies (may need to be overriden)
+LDADD = $(top_builddir)/lib/libcurl.la @CURL_LIBS@
+DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+
+# Makefile.inc provides the source defines (TESTUTIL, SUPPORTFILES,
+# noinst_PROGRAMS, lib*_SOURCES, and lib*_CFLAGS)
+include Makefile.inc
+
+# Preloading of libhostname allows host name overriding,
+# this is used to make some tests machine independent.
+
+if BUILD_LIBHOSTNAME
+noinst_LTLIBRARIES = libhostname.la
+else
+noinst_LTLIBRARIES =
+endif
+
+if NO_UNDEFINED
+# The -no-undefined flag is crucial to build fine on some platforms
+UNDEF = -no-undefined
+endif
+
+libhostname_la_SOURCES = sethostname.c sethostname.h
+
+libhostname_la_LIBADD =
+libhostname_la_DEPENDENCIES =
+libhostname_la_LDFLAGS = -module -avoid-version $(UNDEF) -rpath /nowhere
+
diff --git a/tests/libtest/Makefile.in b/tests/libtest/Makefile.in
new file mode 100644
index 000000000..bce2c39bd
--- /dev/null
+++ b/tests/libtest/Makefile.in
@@ -0,0 +1,1720 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(srcdir)/Makefile.inc
+noinst_PROGRAMS = lib500$(EXEEXT) lib501$(EXEEXT) lib502$(EXEEXT) \
+ lib503$(EXEEXT) lib504$(EXEEXT) lib505$(EXEEXT) \
+ lib506$(EXEEXT) lib507$(EXEEXT) lib508$(EXEEXT) \
+ lib510$(EXEEXT) lib511$(EXEEXT) lib512$(EXEEXT) \
+ lib513$(EXEEXT) lib514$(EXEEXT) lib515$(EXEEXT) \
+ lib516$(EXEEXT) lib517$(EXEEXT) lib518$(EXEEXT) \
+ lib519$(EXEEXT) lib520$(EXEEXT) lib521$(EXEEXT) \
+ lib523$(EXEEXT) lib524$(EXEEXT) lib525$(EXEEXT) \
+ lib526$(EXEEXT) lib527$(EXEEXT) lib574$(EXEEXT) \
+ lib575$(EXEEXT) lib576$(EXEEXT) lib577$(EXEEXT) \
+ lib578$(EXEEXT) lib579$(EXEEXT) lib529$(EXEEXT) \
+ lib530$(EXEEXT) lib532$(EXEEXT) lib533$(EXEEXT) \
+ lib536$(EXEEXT) lib537$(EXEEXT) lib540$(EXEEXT) \
+ lib541$(EXEEXT) lib542$(EXEEXT) lib543$(EXEEXT) \
+ lib544$(EXEEXT) lib545$(EXEEXT) lib547$(EXEEXT) \
+ lib548$(EXEEXT) lib549$(EXEEXT) lib552$(EXEEXT) \
+ lib553$(EXEEXT) lib554$(EXEEXT) lib555$(EXEEXT) \
+ lib556$(EXEEXT) lib539$(EXEEXT) lib557$(EXEEXT) \
+ lib558$(EXEEXT) lib559$(EXEEXT) lib560$(EXEEXT) \
+ lib562$(EXEEXT) lib564$(EXEEXT) lib565$(EXEEXT) \
+ lib566$(EXEEXT) lib567$(EXEEXT) lib568$(EXEEXT) \
+ lib569$(EXEEXT) lib570$(EXEEXT) lib571$(EXEEXT) \
+ lib572$(EXEEXT) lib573$(EXEEXT) chkhostname$(EXEEXT)
+subdir = tests/libtest
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/curl-compilers.m4 \
+ $(top_srcdir)/m4/curl-confopts.m4 \
+ $(top_srcdir)/m4/curl-functions.m4 \
+ $(top_srcdir)/m4/curl-override.m4 \
+ $(top_srcdir)/m4/curl-reentrant.m4 \
+ $(top_srcdir)/m4/curl-system.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/lib/curl_config.h \
+ $(top_builddir)/src/curl_config.h \
+ $(top_builddir)/include/curl/curlbuild.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+am_libhostname_la_OBJECTS = sethostname.lo
+libhostname_la_OBJECTS = $(am_libhostname_la_OBJECTS)
+@BUILD_LIBHOSTNAME_TRUE@am_libhostname_la_rpath =
+PROGRAMS = $(noinst_PROGRAMS)
+am_chkhostname_OBJECTS = chkhostname-chkhostname.$(OBJEXT) \
+ chkhostname-curl_gethostname.$(OBJEXT)
+chkhostname_OBJECTS = $(am_chkhostname_OBJECTS)
+am__objects_1 = first.$(OBJEXT)
+am_lib500_OBJECTS = lib500.$(OBJEXT) $(am__objects_1)
+lib500_OBJECTS = $(am_lib500_OBJECTS)
+lib500_LDADD = $(LDADD)
+lib500_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib501_OBJECTS = lib501.$(OBJEXT) $(am__objects_1)
+lib501_OBJECTS = $(am_lib501_OBJECTS)
+lib501_LDADD = $(LDADD)
+lib501_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am__objects_2 = testutil.$(OBJEXT)
+am_lib502_OBJECTS = lib502.$(OBJEXT) $(am__objects_1) $(am__objects_2)
+lib502_OBJECTS = $(am_lib502_OBJECTS)
+lib502_LDADD = $(LDADD)
+lib502_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib503_OBJECTS = lib503.$(OBJEXT) $(am__objects_1) $(am__objects_2)
+lib503_OBJECTS = $(am_lib503_OBJECTS)
+lib503_LDADD = $(LDADD)
+lib503_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib504_OBJECTS = lib504.$(OBJEXT) $(am__objects_1) $(am__objects_2)
+lib504_OBJECTS = $(am_lib504_OBJECTS)
+lib504_LDADD = $(LDADD)
+lib504_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib505_OBJECTS = lib505.$(OBJEXT) $(am__objects_1)
+lib505_OBJECTS = $(am_lib505_OBJECTS)
+lib505_LDADD = $(LDADD)
+lib505_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib506_OBJECTS = lib506.$(OBJEXT) $(am__objects_1)
+lib506_OBJECTS = $(am_lib506_OBJECTS)
+lib506_LDADD = $(LDADD)
+lib506_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib507_OBJECTS = lib507.$(OBJEXT) $(am__objects_1) $(am__objects_2)
+lib507_OBJECTS = $(am_lib507_OBJECTS)
+lib507_LDADD = $(LDADD)
+lib507_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib508_OBJECTS = lib508.$(OBJEXT) $(am__objects_1)
+lib508_OBJECTS = $(am_lib508_OBJECTS)
+lib508_LDADD = $(LDADD)
+lib508_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib510_OBJECTS = lib510.$(OBJEXT) $(am__objects_1)
+lib510_OBJECTS = $(am_lib510_OBJECTS)
+lib510_LDADD = $(LDADD)
+lib510_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib511_OBJECTS = lib511.$(OBJEXT) $(am__objects_1)
+lib511_OBJECTS = $(am_lib511_OBJECTS)
+lib511_LDADD = $(LDADD)
+lib511_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib512_OBJECTS = lib512.$(OBJEXT) $(am__objects_1)
+lib512_OBJECTS = $(am_lib512_OBJECTS)
+lib512_LDADD = $(LDADD)
+lib512_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib513_OBJECTS = lib513.$(OBJEXT) $(am__objects_1)
+lib513_OBJECTS = $(am_lib513_OBJECTS)
+lib513_LDADD = $(LDADD)
+lib513_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib514_OBJECTS = lib514.$(OBJEXT) $(am__objects_1)
+lib514_OBJECTS = $(am_lib514_OBJECTS)
+lib514_LDADD = $(LDADD)
+lib514_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib515_OBJECTS = lib515.$(OBJEXT) $(am__objects_1)
+lib515_OBJECTS = $(am_lib515_OBJECTS)
+lib515_LDADD = $(LDADD)
+lib515_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib516_OBJECTS = lib516.$(OBJEXT) $(am__objects_1)
+lib516_OBJECTS = $(am_lib516_OBJECTS)
+lib516_LDADD = $(LDADD)
+lib516_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib517_OBJECTS = lib517.$(OBJEXT) $(am__objects_1)
+lib517_OBJECTS = $(am_lib517_OBJECTS)
+lib517_LDADD = $(LDADD)
+lib517_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib518_OBJECTS = lib518.$(OBJEXT) $(am__objects_1)
+lib518_OBJECTS = $(am_lib518_OBJECTS)
+lib518_LDADD = $(LDADD)
+lib518_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib519_OBJECTS = lib519.$(OBJEXT) $(am__objects_1)
+lib519_OBJECTS = $(am_lib519_OBJECTS)
+lib519_LDADD = $(LDADD)
+lib519_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib520_OBJECTS = lib520.$(OBJEXT) $(am__objects_1)
+lib520_OBJECTS = $(am_lib520_OBJECTS)
+lib520_LDADD = $(LDADD)
+lib520_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib521_OBJECTS = lib521.$(OBJEXT) $(am__objects_1)
+lib521_OBJECTS = $(am_lib521_OBJECTS)
+lib521_LDADD = $(LDADD)
+lib521_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib523_OBJECTS = lib523.$(OBJEXT) $(am__objects_1)
+lib523_OBJECTS = $(am_lib523_OBJECTS)
+lib523_LDADD = $(LDADD)
+lib523_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib524_OBJECTS = lib524.$(OBJEXT) $(am__objects_1)
+lib524_OBJECTS = $(am_lib524_OBJECTS)
+lib524_LDADD = $(LDADD)
+lib524_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib525_OBJECTS = lib525.$(OBJEXT) $(am__objects_1) $(am__objects_2)
+lib525_OBJECTS = $(am_lib525_OBJECTS)
+lib525_LDADD = $(LDADD)
+lib525_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am__objects_3 = lib526-first.$(OBJEXT)
+am__objects_4 = lib526-testutil.$(OBJEXT)
+am_lib526_OBJECTS = lib526-lib526.$(OBJEXT) $(am__objects_3) \
+ $(am__objects_4)
+lib526_OBJECTS = $(am_lib526_OBJECTS)
+lib526_LDADD = $(LDADD)
+lib526_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am__objects_5 = lib527-first.$(OBJEXT)
+am__objects_6 = lib527-testutil.$(OBJEXT)
+am_lib527_OBJECTS = lib527-lib526.$(OBJEXT) $(am__objects_5) \
+ $(am__objects_6)
+lib527_OBJECTS = $(am_lib527_OBJECTS)
+lib527_LDADD = $(LDADD)
+lib527_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am__objects_7 = lib529-first.$(OBJEXT)
+am__objects_8 = lib529-testutil.$(OBJEXT)
+am_lib529_OBJECTS = lib529-lib525.$(OBJEXT) $(am__objects_7) \
+ $(am__objects_8)
+lib529_OBJECTS = $(am_lib529_OBJECTS)
+lib529_LDADD = $(LDADD)
+lib529_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am__objects_9 = lib530-first.$(OBJEXT)
+am__objects_10 = lib530-testutil.$(OBJEXT)
+am_lib530_OBJECTS = lib530-lib530.$(OBJEXT) $(am__objects_9) \
+ $(am__objects_10)
+lib530_OBJECTS = $(am_lib530_OBJECTS)
+lib530_LDADD = $(LDADD)
+lib530_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am__objects_11 = lib532-first.$(OBJEXT)
+am__objects_12 = lib532-testutil.$(OBJEXT)
+am_lib532_OBJECTS = lib532-lib526.$(OBJEXT) $(am__objects_11) \
+ $(am__objects_12)
+lib532_OBJECTS = $(am_lib532_OBJECTS)
+lib532_LDADD = $(LDADD)
+lib532_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib533_OBJECTS = lib533.$(OBJEXT) $(am__objects_1) $(am__objects_2)
+lib533_OBJECTS = $(am_lib533_OBJECTS)
+lib533_LDADD = $(LDADD)
+lib533_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib536_OBJECTS = lib536.$(OBJEXT) $(am__objects_1) $(am__objects_2)
+lib536_OBJECTS = $(am_lib536_OBJECTS)
+lib536_LDADD = $(LDADD)
+lib536_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib537_OBJECTS = lib537.$(OBJEXT) $(am__objects_1)
+lib537_OBJECTS = $(am_lib537_OBJECTS)
+lib537_LDADD = $(LDADD)
+lib537_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib539_OBJECTS = lib539.$(OBJEXT) $(am__objects_1)
+lib539_OBJECTS = $(am_lib539_OBJECTS)
+lib539_LDADD = $(LDADD)
+lib539_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib540_OBJECTS = lib540.$(OBJEXT) $(am__objects_1)
+lib540_OBJECTS = $(am_lib540_OBJECTS)
+lib540_LDADD = $(LDADD)
+lib540_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib541_OBJECTS = lib541.$(OBJEXT) $(am__objects_1)
+lib541_OBJECTS = $(am_lib541_OBJECTS)
+lib541_LDADD = $(LDADD)
+lib541_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib542_OBJECTS = lib542.$(OBJEXT) $(am__objects_1)
+lib542_OBJECTS = $(am_lib542_OBJECTS)
+lib542_LDADD = $(LDADD)
+lib542_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib543_OBJECTS = lib543.$(OBJEXT) $(am__objects_1)
+lib543_OBJECTS = $(am_lib543_OBJECTS)
+lib543_LDADD = $(LDADD)
+lib543_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib544_OBJECTS = lib544.$(OBJEXT) $(am__objects_1)
+lib544_OBJECTS = $(am_lib544_OBJECTS)
+lib544_LDADD = $(LDADD)
+lib544_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am__objects_13 = lib545-first.$(OBJEXT)
+am_lib545_OBJECTS = lib545-lib544.$(OBJEXT) $(am__objects_13)
+lib545_OBJECTS = $(am_lib545_OBJECTS)
+lib545_LDADD = $(LDADD)
+lib545_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib547_OBJECTS = lib547.$(OBJEXT) $(am__objects_1)
+lib547_OBJECTS = $(am_lib547_OBJECTS)
+lib547_LDADD = $(LDADD)
+lib547_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am__objects_14 = lib548-first.$(OBJEXT)
+am_lib548_OBJECTS = lib548-lib547.$(OBJEXT) $(am__objects_14)
+lib548_OBJECTS = $(am_lib548_OBJECTS)
+lib548_LDADD = $(LDADD)
+lib548_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib549_OBJECTS = lib549.$(OBJEXT) $(am__objects_1)
+lib549_OBJECTS = $(am_lib549_OBJECTS)
+lib549_LDADD = $(LDADD)
+lib549_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib552_OBJECTS = lib552.$(OBJEXT) $(am__objects_1)
+lib552_OBJECTS = $(am_lib552_OBJECTS)
+lib552_LDADD = $(LDADD)
+lib552_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib553_OBJECTS = lib553.$(OBJEXT) $(am__objects_1)
+lib553_OBJECTS = $(am_lib553_OBJECTS)
+lib553_LDADD = $(LDADD)
+lib553_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib554_OBJECTS = lib554.$(OBJEXT) $(am__objects_1)
+lib554_OBJECTS = $(am_lib554_OBJECTS)
+lib554_LDADD = $(LDADD)
+lib554_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib555_OBJECTS = lib555.$(OBJEXT) $(am__objects_1) $(am__objects_2)
+lib555_OBJECTS = $(am_lib555_OBJECTS)
+lib555_LDADD = $(LDADD)
+lib555_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib556_OBJECTS = lib556.$(OBJEXT) $(am__objects_1)
+lib556_OBJECTS = $(am_lib556_OBJECTS)
+lib556_LDADD = $(LDADD)
+lib556_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib557_OBJECTS = lib557.$(OBJEXT) $(am__objects_1)
+lib557_OBJECTS = $(am_lib557_OBJECTS)
+lib557_LDADD = $(LDADD)
+lib557_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am__objects_15 = lib558-first.$(OBJEXT)
+am_lib558_OBJECTS = lib558-lib558.$(OBJEXT) $(am__objects_15)
+lib558_OBJECTS = $(am_lib558_OBJECTS)
+lib558_LDADD = $(LDADD)
+lib558_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am__objects_16 = lib559-first.$(OBJEXT)
+am_lib559_OBJECTS = lib559-lib558.$(OBJEXT) $(am__objects_16)
+lib559_OBJECTS = $(am_lib559_OBJECTS)
+lib559_LDADD = $(LDADD)
+lib559_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib560_OBJECTS = lib560.$(OBJEXT) $(am__objects_1)
+lib560_OBJECTS = $(am_lib560_OBJECTS)
+lib560_LDADD = $(LDADD)
+lib560_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib562_OBJECTS = lib562.$(OBJEXT) $(am__objects_1)
+lib562_OBJECTS = $(am_lib562_OBJECTS)
+lib562_LDADD = $(LDADD)
+lib562_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib564_OBJECTS = lib564.$(OBJEXT) $(am__objects_1) $(am__objects_2)
+lib564_OBJECTS = $(am_lib564_OBJECTS)
+lib564_LDADD = $(LDADD)
+lib564_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am__objects_17 = lib565-first.$(OBJEXT)
+am_lib565_OBJECTS = lib565-lib510.$(OBJEXT) $(am__objects_17)
+lib565_OBJECTS = $(am_lib565_OBJECTS)
+lib565_LDADD = $(LDADD)
+lib565_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib566_OBJECTS = lib566.$(OBJEXT) $(am__objects_1)
+lib566_OBJECTS = $(am_lib566_OBJECTS)
+lib566_LDADD = $(LDADD)
+lib566_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib567_OBJECTS = lib567.$(OBJEXT) $(am__objects_1)
+lib567_OBJECTS = $(am_lib567_OBJECTS)
+lib567_LDADD = $(LDADD)
+lib567_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib568_OBJECTS = lib568.$(OBJEXT) $(am__objects_1)
+lib568_OBJECTS = $(am_lib568_OBJECTS)
+lib568_LDADD = $(LDADD)
+lib568_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib569_OBJECTS = lib569.$(OBJEXT) $(am__objects_1)
+lib569_OBJECTS = $(am_lib569_OBJECTS)
+lib569_LDADD = $(LDADD)
+lib569_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib570_OBJECTS = lib570.$(OBJEXT) $(am__objects_1)
+lib570_OBJECTS = $(am_lib570_OBJECTS)
+lib570_LDADD = $(LDADD)
+lib570_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib571_OBJECTS = lib571.$(OBJEXT) $(am__objects_1)
+lib571_OBJECTS = $(am_lib571_OBJECTS)
+lib571_LDADD = $(LDADD)
+lib571_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib572_OBJECTS = lib572.$(OBJEXT) $(am__objects_1)
+lib572_OBJECTS = $(am_lib572_OBJECTS)
+lib572_LDADD = $(LDADD)
+lib572_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib573_OBJECTS = lib573.$(OBJEXT) $(am__objects_1) $(am__objects_2)
+lib573_OBJECTS = $(am_lib573_OBJECTS)
+lib573_LDADD = $(LDADD)
+lib573_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib574_OBJECTS = lib574.$(OBJEXT) $(am__objects_1)
+lib574_OBJECTS = $(am_lib574_OBJECTS)
+lib574_LDADD = $(LDADD)
+lib574_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib575_OBJECTS = lib575.$(OBJEXT) $(am__objects_1)
+lib575_OBJECTS = $(am_lib575_OBJECTS)
+lib575_LDADD = $(LDADD)
+lib575_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib576_OBJECTS = lib576.$(OBJEXT) $(am__objects_1)
+lib576_OBJECTS = $(am_lib576_OBJECTS)
+lib576_LDADD = $(LDADD)
+lib576_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib577_OBJECTS = lib577.$(OBJEXT) $(am__objects_1)
+lib577_OBJECTS = $(am_lib577_OBJECTS)
+lib577_LDADD = $(LDADD)
+lib577_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib578_OBJECTS = lib578.$(OBJEXT) $(am__objects_1)
+lib578_OBJECTS = $(am_lib578_OBJECTS)
+lib578_LDADD = $(LDADD)
+lib578_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+am_lib579_OBJECTS = lib579.$(OBJEXT) $(am__objects_1)
+lib579_OBJECTS = $(am_lib579_OBJECTS)
+lib579_LDADD = $(LDADD)
+lib579_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+DEFAULT_INCLUDES =
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libhostname_la_SOURCES) $(chkhostname_SOURCES) \
+ $(lib500_SOURCES) $(lib501_SOURCES) $(lib502_SOURCES) \
+ $(lib503_SOURCES) $(lib504_SOURCES) $(lib505_SOURCES) \
+ $(lib506_SOURCES) $(lib507_SOURCES) $(lib508_SOURCES) \
+ $(lib510_SOURCES) $(lib511_SOURCES) $(lib512_SOURCES) \
+ $(lib513_SOURCES) $(lib514_SOURCES) $(lib515_SOURCES) \
+ $(lib516_SOURCES) $(lib517_SOURCES) $(lib518_SOURCES) \
+ $(lib519_SOURCES) $(lib520_SOURCES) $(lib521_SOURCES) \
+ $(lib523_SOURCES) $(lib524_SOURCES) $(lib525_SOURCES) \
+ $(lib526_SOURCES) $(lib527_SOURCES) $(lib529_SOURCES) \
+ $(lib530_SOURCES) $(lib532_SOURCES) $(lib533_SOURCES) \
+ $(lib536_SOURCES) $(lib537_SOURCES) $(lib539_SOURCES) \
+ $(lib540_SOURCES) $(lib541_SOURCES) $(lib542_SOURCES) \
+ $(lib543_SOURCES) $(lib544_SOURCES) $(lib545_SOURCES) \
+ $(lib547_SOURCES) $(lib548_SOURCES) $(lib549_SOURCES) \
+ $(lib552_SOURCES) $(lib553_SOURCES) $(lib554_SOURCES) \
+ $(lib555_SOURCES) $(lib556_SOURCES) $(lib557_SOURCES) \
+ $(lib558_SOURCES) $(lib559_SOURCES) $(lib560_SOURCES) \
+ $(lib562_SOURCES) $(lib564_SOURCES) $(lib565_SOURCES) \
+ $(lib566_SOURCES) $(lib567_SOURCES) $(lib568_SOURCES) \
+ $(lib569_SOURCES) $(lib570_SOURCES) $(lib571_SOURCES) \
+ $(lib572_SOURCES) $(lib573_SOURCES) $(lib574_SOURCES) \
+ $(lib575_SOURCES) $(lib576_SOURCES) $(lib577_SOURCES) \
+ $(lib578_SOURCES) $(lib579_SOURCES)
+DIST_SOURCES = $(libhostname_la_SOURCES) $(chkhostname_SOURCES) \
+ $(lib500_SOURCES) $(lib501_SOURCES) $(lib502_SOURCES) \
+ $(lib503_SOURCES) $(lib504_SOURCES) $(lib505_SOURCES) \
+ $(lib506_SOURCES) $(lib507_SOURCES) $(lib508_SOURCES) \
+ $(lib510_SOURCES) $(lib511_SOURCES) $(lib512_SOURCES) \
+ $(lib513_SOURCES) $(lib514_SOURCES) $(lib515_SOURCES) \
+ $(lib516_SOURCES) $(lib517_SOURCES) $(lib518_SOURCES) \
+ $(lib519_SOURCES) $(lib520_SOURCES) $(lib521_SOURCES) \
+ $(lib523_SOURCES) $(lib524_SOURCES) $(lib525_SOURCES) \
+ $(lib526_SOURCES) $(lib527_SOURCES) $(lib529_SOURCES) \
+ $(lib530_SOURCES) $(lib532_SOURCES) $(lib533_SOURCES) \
+ $(lib536_SOURCES) $(lib537_SOURCES) $(lib539_SOURCES) \
+ $(lib540_SOURCES) $(lib541_SOURCES) $(lib542_SOURCES) \
+ $(lib543_SOURCES) $(lib544_SOURCES) $(lib545_SOURCES) \
+ $(lib547_SOURCES) $(lib548_SOURCES) $(lib549_SOURCES) \
+ $(lib552_SOURCES) $(lib553_SOURCES) $(lib554_SOURCES) \
+ $(lib555_SOURCES) $(lib556_SOURCES) $(lib557_SOURCES) \
+ $(lib558_SOURCES) $(lib559_SOURCES) $(lib560_SOURCES) \
+ $(lib562_SOURCES) $(lib564_SOURCES) $(lib565_SOURCES) \
+ $(lib566_SOURCES) $(lib567_SOURCES) $(lib568_SOURCES) \
+ $(lib569_SOURCES) $(lib570_SOURCES) $(lib571_SOURCES) \
+ $(lib572_SOURCES) $(lib573_SOURCES) $(lib574_SOURCES) \
+ $(lib575_SOURCES) $(lib576_SOURCES) $(lib577_SOURCES) \
+ $(lib578_SOURCES) $(lib579_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_LIBHOSTNAME_FALSE = @BUILD_LIBHOSTNAME_FALSE@
+BUILD_LIBHOSTNAME_TRUE = @BUILD_LIBHOSTNAME_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONFIGURE_OPTIONS = @CONFIGURE_OPTIONS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CROSSCOMPILING_FALSE = @CROSSCOMPILING_FALSE@
+CROSSCOMPILING_TRUE = @CROSSCOMPILING_TRUE@
+CURLDEBUG_FALSE = @CURLDEBUG_FALSE@
+CURLDEBUG_TRUE = @CURLDEBUG_TRUE@
+CURL_CA_BUNDLE = @CURL_CA_BUNDLE@
+CURL_CFLAG_EXTRAS = @CURL_CFLAG_EXTRAS@
+CURL_DISABLE_DICT = @CURL_DISABLE_DICT@
+CURL_DISABLE_FILE = @CURL_DISABLE_FILE@
+CURL_DISABLE_FTP = @CURL_DISABLE_FTP@
+CURL_DISABLE_GOPHER = @CURL_DISABLE_GOPHER@
+CURL_DISABLE_HTTP = @CURL_DISABLE_HTTP@
+CURL_DISABLE_IMAP = @CURL_DISABLE_IMAP@
+CURL_DISABLE_LDAP = @CURL_DISABLE_LDAP@
+CURL_DISABLE_LDAPS = @CURL_DISABLE_LDAPS@
+CURL_DISABLE_POP3 = @CURL_DISABLE_POP3@
+CURL_DISABLE_PROXY = @CURL_DISABLE_PROXY@
+CURL_DISABLE_RTSP = @CURL_DISABLE_RTSP@
+CURL_DISABLE_SMTP = @CURL_DISABLE_SMTP@
+CURL_DISABLE_TELNET = @CURL_DISABLE_TELNET@
+CURL_DISABLE_TFTP = @CURL_DISABLE_TFTP@
+CURL_LIBS = @CURL_LIBS@
+CURL_NETWORK_LIBS = @CURL_NETWORK_LIBS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_SHARED = @ENABLE_SHARED@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+HAVE_LDAP_SSL = @HAVE_LDAP_SSL@
+HAVE_LIBZ = @HAVE_LIBZ@
+HAVE_LIBZ_FALSE = @HAVE_LIBZ_FALSE@
+HAVE_LIBZ_TRUE = @HAVE_LIBZ_TRUE@
+HAVE_PK11_CREATEGENERICOBJECT = @HAVE_PK11_CREATEGENERICOBJECT@
+IDN_ENABLED = @IDN_ENABLED@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+IPV6_ENABLED = @IPV6_ENABLED@
+KRB4_ENABLED = @KRB4_ENABLED@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBCURL_LIBS = @LIBCURL_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+MANOPT = @MANOPT@
+MIMPURE_FALSE = @MIMPURE_FALSE@
+MIMPURE_TRUE = @MIMPURE_TRUE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NO_UNDEFINED_FALSE = @NO_UNDEFINED_FALSE@
+NO_UNDEFINED_TRUE = @NO_UNDEFINED_TRUE@
+NROFF = @NROFF@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH = @PATH@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+PKGADD_NAME = @PKGADD_NAME@
+PKGADD_PKG = @PKGADD_PKG@
+PKGADD_VENDOR = @PKGADD_VENDOR@
+PKGCONFIG = @PKGCONFIG@
+RANDOM_FILE = @RANDOM_FILE@
+RANLIB = @RANLIB@
+REQUIRE_LIB_DEPS = @REQUIRE_LIB_DEPS@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SONAME_BUMP_FALSE = @SONAME_BUMP_FALSE@
+SONAME_BUMP_TRUE = @SONAME_BUMP_TRUE@
+SSL_ENABLED = @SSL_ENABLED@
+STATICLIB_FALSE = @STATICLIB_FALSE@
+STATICLIB_TRUE = @STATICLIB_TRUE@
+STRIP = @STRIP@
+SUPPORT_FEATURES = @SUPPORT_FEATURES@
+SUPPORT_PROTOCOLS = @SUPPORT_PROTOCOLS@
+TEST_SERVER_LIBS = @TEST_SERVER_LIBS@
+USE_ARES = @USE_ARES@
+USE_EMBEDDED_ARES_FALSE = @USE_EMBEDDED_ARES_FALSE@
+USE_EMBEDDED_ARES_TRUE = @USE_EMBEDDED_ARES_TRUE@
+USE_GNUTLS = @USE_GNUTLS@
+USE_LIBRTMP = @USE_LIBRTMP@
+USE_LIBSSH2 = @USE_LIBSSH2@
+USE_MANUAL_FALSE = @USE_MANUAL_FALSE@
+USE_MANUAL_TRUE = @USE_MANUAL_TRUE@
+USE_NSS = @USE_NSS@
+USE_OPENLDAP = @USE_OPENLDAP@
+USE_POLARSSL = @USE_POLARSSL@
+USE_SSLEAY = @USE_SSLEAY@
+USE_WINDOWS_SSPI = @USE_WINDOWS_SSPI@
+VERSION = @VERSION@
+VERSIONNUM = @VERSIONNUM@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+libext = @libext@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+subdirs = @subdirs@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+
+#***************************************************************************
+# _ _ ____ _
+# Project ___| | | | _ \| |
+# / __| | | | |_) | |
+# | (__| |_| | _ <| |___
+# \___|\___/|_| \_\_____|
+#
+# Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+#
+# This software is licensed as described in the file COPYING, which
+# you should have received as part of this distribution. The terms
+# are also available at http://curl.haxx.se/docs/copyright.html.
+#
+# You may opt to use, copy, modify, merge, publish, distribute and/or sell
+# copies of the Software, and permit persons to whom the Software is
+# furnished to do so, under the terms of the COPYING file.
+#
+# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+# KIND, either express or implied.
+#
+###########################################################################
+AUTOMAKE_OPTIONS = foreign nostdinc
+@USE_EMBEDDED_ARES_FALSE@INCLUDES = -I$(top_builddir)/include/curl \
+@USE_EMBEDDED_ARES_FALSE@ -I$(top_builddir)/include \
+@USE_EMBEDDED_ARES_FALSE@ -I$(top_srcdir)/include \
+@USE_EMBEDDED_ARES_FALSE@ -I$(top_builddir)/lib \
+@USE_EMBEDDED_ARES_FALSE@ -I$(top_srcdir)/lib
+
+
+# Specify our include paths here, and do it relative to $(top_srcdir) and
+# $(top_builddir), to ensure that these paths which belong to the library
+# being currently built and tested are searched before the library which
+# might possibly already be installed in the system.
+#
+# $(top_builddir)/include/curl for generated curlbuild.h included from curl.h
+# $(top_builddir)/include for generated curlbuild.h included from lib/setup.h
+# $(top_srcdir)/include is for libcurl's external include files
+# $(top_builddir)/lib is for libcurl's generated lib/curl_config.h file
+# $(top_srcdir)/lib is for libcurl's lib/setup.h and other "borrowed" files
+# $(top_builddir)/ares is for in-tree c-ares's generated ares_build.h file
+# $(top_srcdir)/ares is for in-tree c-ares's external include files
+@USE_EMBEDDED_ARES_TRUE@INCLUDES = -I$(top_builddir)/include/curl \
+@USE_EMBEDDED_ARES_TRUE@ -I$(top_builddir)/include \
+@USE_EMBEDDED_ARES_TRUE@ -I$(top_srcdir)/include \
+@USE_EMBEDDED_ARES_TRUE@ -I$(top_builddir)/lib \
+@USE_EMBEDDED_ARES_TRUE@ -I$(top_srcdir)/lib \
+@USE_EMBEDDED_ARES_TRUE@ -I$(top_builddir)/ares \
+@USE_EMBEDDED_ARES_TRUE@ -I$(top_srcdir)/ares
+
+EXTRA_DIST = test75.pl test307.pl test610.pl test613.pl test1013.pl \
+test1022.pl Makefile.inc
+
+
+# Dependencies (may need to be overriden)
+LDADD = $(top_builddir)/lib/libcurl.la @CURL_LIBS@
+DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+
+# files used only in some libcurl test programs
+TESTUTIL = testutil.c testutil.h
+
+# these files are used in every single test program below
+SUPPORTFILES = first.c test.h
+chkhostname_SOURCES = chkhostname.c $(top_srcdir)/lib/curl_gethostname.c
+chkhostname_LDADD = @CURL_NETWORK_LIBS@
+chkhostname_DEPENDENCIES =
+chkhostname_CFLAGS = $(AM_CFLAGS)
+lib500_SOURCES = lib500.c $(SUPPORTFILES)
+lib501_SOURCES = lib501.c $(SUPPORTFILES)
+lib502_SOURCES = lib502.c $(SUPPORTFILES) $(TESTUTIL)
+lib503_SOURCES = lib503.c $(SUPPORTFILES) $(TESTUTIL)
+lib504_SOURCES = lib504.c $(SUPPORTFILES) $(TESTUTIL)
+lib505_SOURCES = lib505.c $(SUPPORTFILES)
+lib506_SOURCES = lib506.c $(SUPPORTFILES)
+lib507_SOURCES = lib507.c $(SUPPORTFILES) $(TESTUTIL)
+lib508_SOURCES = lib508.c $(SUPPORTFILES)
+lib510_SOURCES = lib510.c $(SUPPORTFILES)
+lib511_SOURCES = lib511.c $(SUPPORTFILES)
+lib512_SOURCES = lib512.c $(SUPPORTFILES)
+lib513_SOURCES = lib513.c $(SUPPORTFILES)
+lib514_SOURCES = lib514.c $(SUPPORTFILES)
+lib515_SOURCES = lib515.c $(SUPPORTFILES)
+lib516_SOURCES = lib516.c $(SUPPORTFILES)
+lib517_SOURCES = lib517.c $(SUPPORTFILES)
+lib518_SOURCES = lib518.c $(SUPPORTFILES)
+lib519_SOURCES = lib519.c $(SUPPORTFILES)
+lib520_SOURCES = lib520.c $(SUPPORTFILES)
+lib521_SOURCES = lib521.c $(SUPPORTFILES)
+lib523_SOURCES = lib523.c $(SUPPORTFILES)
+lib524_SOURCES = lib524.c $(SUPPORTFILES)
+lib525_SOURCES = lib525.c $(SUPPORTFILES) $(TESTUTIL)
+lib526_SOURCES = lib526.c $(SUPPORTFILES) $(TESTUTIL)
+lib526_CFLAGS = -DLIB526
+lib527_SOURCES = lib526.c $(SUPPORTFILES) $(TESTUTIL)
+lib527_CFLAGS = -DLIB527
+lib529_SOURCES = lib525.c $(SUPPORTFILES) $(TESTUTIL)
+lib529_CFLAGS = -DLIB529
+lib530_SOURCES = lib530.c $(SUPPORTFILES) $(TESTUTIL)
+lib530_CFLAGS = -DLIB530
+lib532_SOURCES = lib526.c $(SUPPORTFILES) $(TESTUTIL)
+lib532_CFLAGS = -DLIB532
+lib533_SOURCES = lib533.c $(SUPPORTFILES) $(TESTUTIL)
+lib536_SOURCES = lib536.c $(SUPPORTFILES) $(TESTUTIL)
+lib537_SOURCES = lib537.c $(SUPPORTFILES)
+lib539_SOURCES = lib539.c $(SUPPORTFILES)
+lib540_SOURCES = lib540.c $(SUPPORTFILES)
+lib541_SOURCES = lib541.c $(SUPPORTFILES)
+lib542_SOURCES = lib542.c $(SUPPORTFILES)
+lib543_SOURCES = lib543.c $(SUPPORTFILES)
+lib544_SOURCES = lib544.c $(SUPPORTFILES)
+lib545_SOURCES = lib544.c $(SUPPORTFILES)
+lib545_CFLAGS = -DLIB545
+lib547_SOURCES = lib547.c $(SUPPORTFILES)
+lib548_SOURCES = lib547.c $(SUPPORTFILES)
+lib548_CFLAGS = -DLIB548
+lib549_SOURCES = lib549.c $(SUPPORTFILES)
+lib555_SOURCES = lib555.c $(SUPPORTFILES) $(TESTUTIL)
+lib552_SOURCES = lib552.c $(SUPPORTFILES)
+lib553_SOURCES = lib553.c $(SUPPORTFILES)
+lib554_SOURCES = lib554.c $(SUPPORTFILES)
+lib556_SOURCES = lib556.c $(SUPPORTFILES)
+lib557_SOURCES = lib557.c $(SUPPORTFILES)
+lib558_SOURCES = lib558.c $(SUPPORTFILES)
+lib558_CFLAGS = -DLIB558
+lib559_SOURCES = lib558.c $(SUPPORTFILES)
+lib559_CFLAGS = -DLIB559
+lib560_SOURCES = lib560.c $(SUPPORTFILES)
+lib574_SOURCES = lib574.c $(SUPPORTFILES)
+lib575_SOURCES = lib575.c $(SUPPORTFILES)
+lib576_SOURCES = lib576.c $(SUPPORTFILES)
+lib577_SOURCES = lib577.c $(SUPPORTFILES)
+lib562_SOURCES = lib562.c $(SUPPORTFILES)
+lib564_SOURCES = lib564.c $(SUPPORTFILES) $(TESTUTIL)
+lib565_SOURCES = lib510.c $(SUPPORTFILES)
+lib565_CFLAGS = -DLIB565
+lib566_SOURCES = lib566.c $(SUPPORTFILES)
+lib567_SOURCES = lib567.c $(SUPPORTFILES)
+lib568_SOURCES = lib568.c $(SUPPORTFILES)
+lib569_SOURCES = lib569.c $(SUPPORTFILES)
+lib570_SOURCES = lib570.c $(SUPPORTFILES)
+lib571_SOURCES = lib571.c $(SUPPORTFILES)
+lib572_SOURCES = lib572.c $(SUPPORTFILES)
+lib573_SOURCES = lib573.c $(SUPPORTFILES) $(TESTUTIL)
+lib578_SOURCES = lib578.c $(SUPPORTFILES)
+lib579_SOURCES = lib579.c $(SUPPORTFILES)
+@BUILD_LIBHOSTNAME_FALSE@noinst_LTLIBRARIES =
+
+# Makefile.inc provides the source defines (TESTUTIL, SUPPORTFILES,
+# noinst_PROGRAMS, lib*_SOURCES, and lib*_CFLAGS)
+
+# Preloading of libhostname allows host name overriding,
+# this is used to make some tests machine independent.
+@BUILD_LIBHOSTNAME_TRUE@noinst_LTLIBRARIES = libhostname.la
+
+# The -no-undefined flag is crucial to build fine on some platforms
+@NO_UNDEFINED_TRUE@UNDEF = -no-undefined
+libhostname_la_SOURCES = sethostname.c sethostname.h
+libhostname_la_LIBADD =
+libhostname_la_DEPENDENCIES =
+libhostname_la_LDFLAGS = -module -avoid-version $(UNDEF) -rpath /nowhere
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/Makefile.inc $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/libtest/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign tests/libtest/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libhostname.la: $(libhostname_la_OBJECTS) $(libhostname_la_DEPENDENCIES)
+ $(LINK) $(am_libhostname_la_rpath) $(libhostname_la_LDFLAGS) $(libhostname_la_OBJECTS) $(libhostname_la_LIBADD) $(LIBS)
+
+clean-noinstPROGRAMS:
+ @list='$(noinst_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+chkhostname$(EXEEXT): $(chkhostname_OBJECTS) $(chkhostname_DEPENDENCIES)
+ @rm -f chkhostname$(EXEEXT)
+ $(LINK) $(chkhostname_LDFLAGS) $(chkhostname_OBJECTS) $(chkhostname_LDADD) $(LIBS)
+lib500$(EXEEXT): $(lib500_OBJECTS) $(lib500_DEPENDENCIES)
+ @rm -f lib500$(EXEEXT)
+ $(LINK) $(lib500_LDFLAGS) $(lib500_OBJECTS) $(lib500_LDADD) $(LIBS)
+lib501$(EXEEXT): $(lib501_OBJECTS) $(lib501_DEPENDENCIES)
+ @rm -f lib501$(EXEEXT)
+ $(LINK) $(lib501_LDFLAGS) $(lib501_OBJECTS) $(lib501_LDADD) $(LIBS)
+lib502$(EXEEXT): $(lib502_OBJECTS) $(lib502_DEPENDENCIES)
+ @rm -f lib502$(EXEEXT)
+ $(LINK) $(lib502_LDFLAGS) $(lib502_OBJECTS) $(lib502_LDADD) $(LIBS)
+lib503$(EXEEXT): $(lib503_OBJECTS) $(lib503_DEPENDENCIES)
+ @rm -f lib503$(EXEEXT)
+ $(LINK) $(lib503_LDFLAGS) $(lib503_OBJECTS) $(lib503_LDADD) $(LIBS)
+lib504$(EXEEXT): $(lib504_OBJECTS) $(lib504_DEPENDENCIES)
+ @rm -f lib504$(EXEEXT)
+ $(LINK) $(lib504_LDFLAGS) $(lib504_OBJECTS) $(lib504_LDADD) $(LIBS)
+lib505$(EXEEXT): $(lib505_OBJECTS) $(lib505_DEPENDENCIES)
+ @rm -f lib505$(EXEEXT)
+ $(LINK) $(lib505_LDFLAGS) $(lib505_OBJECTS) $(lib505_LDADD) $(LIBS)
+lib506$(EXEEXT): $(lib506_OBJECTS) $(lib506_DEPENDENCIES)
+ @rm -f lib506$(EXEEXT)
+ $(LINK) $(lib506_LDFLAGS) $(lib506_OBJECTS) $(lib506_LDADD) $(LIBS)
+lib507$(EXEEXT): $(lib507_OBJECTS) $(lib507_DEPENDENCIES)
+ @rm -f lib507$(EXEEXT)
+ $(LINK) $(lib507_LDFLAGS) $(lib507_OBJECTS) $(lib507_LDADD) $(LIBS)
+lib508$(EXEEXT): $(lib508_OBJECTS) $(lib508_DEPENDENCIES)
+ @rm -f lib508$(EXEEXT)
+ $(LINK) $(lib508_LDFLAGS) $(lib508_OBJECTS) $(lib508_LDADD) $(LIBS)
+lib510$(EXEEXT): $(lib510_OBJECTS) $(lib510_DEPENDENCIES)
+ @rm -f lib510$(EXEEXT)
+ $(LINK) $(lib510_LDFLAGS) $(lib510_OBJECTS) $(lib510_LDADD) $(LIBS)
+lib511$(EXEEXT): $(lib511_OBJECTS) $(lib511_DEPENDENCIES)
+ @rm -f lib511$(EXEEXT)
+ $(LINK) $(lib511_LDFLAGS) $(lib511_OBJECTS) $(lib511_LDADD) $(LIBS)
+lib512$(EXEEXT): $(lib512_OBJECTS) $(lib512_DEPENDENCIES)
+ @rm -f lib512$(EXEEXT)
+ $(LINK) $(lib512_LDFLAGS) $(lib512_OBJECTS) $(lib512_LDADD) $(LIBS)
+lib513$(EXEEXT): $(lib513_OBJECTS) $(lib513_DEPENDENCIES)
+ @rm -f lib513$(EXEEXT)
+ $(LINK) $(lib513_LDFLAGS) $(lib513_OBJECTS) $(lib513_LDADD) $(LIBS)
+lib514$(EXEEXT): $(lib514_OBJECTS) $(lib514_DEPENDENCIES)
+ @rm -f lib514$(EXEEXT)
+ $(LINK) $(lib514_LDFLAGS) $(lib514_OBJECTS) $(lib514_LDADD) $(LIBS)
+lib515$(EXEEXT): $(lib515_OBJECTS) $(lib515_DEPENDENCIES)
+ @rm -f lib515$(EXEEXT)
+ $(LINK) $(lib515_LDFLAGS) $(lib515_OBJECTS) $(lib515_LDADD) $(LIBS)
+lib516$(EXEEXT): $(lib516_OBJECTS) $(lib516_DEPENDENCIES)
+ @rm -f lib516$(EXEEXT)
+ $(LINK) $(lib516_LDFLAGS) $(lib516_OBJECTS) $(lib516_LDADD) $(LIBS)
+lib517$(EXEEXT): $(lib517_OBJECTS) $(lib517_DEPENDENCIES)
+ @rm -f lib517$(EXEEXT)
+ $(LINK) $(lib517_LDFLAGS) $(lib517_OBJECTS) $(lib517_LDADD) $(LIBS)
+lib518$(EXEEXT): $(lib518_OBJECTS) $(lib518_DEPENDENCIES)
+ @rm -f lib518$(EXEEXT)
+ $(LINK) $(lib518_LDFLAGS) $(lib518_OBJECTS) $(lib518_LDADD) $(LIBS)
+lib519$(EXEEXT): $(lib519_OBJECTS) $(lib519_DEPENDENCIES)
+ @rm -f lib519$(EXEEXT)
+ $(LINK) $(lib519_LDFLAGS) $(lib519_OBJECTS) $(lib519_LDADD) $(LIBS)
+lib520$(EXEEXT): $(lib520_OBJECTS) $(lib520_DEPENDENCIES)
+ @rm -f lib520$(EXEEXT)
+ $(LINK) $(lib520_LDFLAGS) $(lib520_OBJECTS) $(lib520_LDADD) $(LIBS)
+lib521$(EXEEXT): $(lib521_OBJECTS) $(lib521_DEPENDENCIES)
+ @rm -f lib521$(EXEEXT)
+ $(LINK) $(lib521_LDFLAGS) $(lib521_OBJECTS) $(lib521_LDADD) $(LIBS)
+lib523$(EXEEXT): $(lib523_OBJECTS) $(lib523_DEPENDENCIES)
+ @rm -f lib523$(EXEEXT)
+ $(LINK) $(lib523_LDFLAGS) $(lib523_OBJECTS) $(lib523_LDADD) $(LIBS)
+lib524$(EXEEXT): $(lib524_OBJECTS) $(lib524_DEPENDENCIES)
+ @rm -f lib524$(EXEEXT)
+ $(LINK) $(lib524_LDFLAGS) $(lib524_OBJECTS) $(lib524_LDADD) $(LIBS)
+lib525$(EXEEXT): $(lib525_OBJECTS) $(lib525_DEPENDENCIES)
+ @rm -f lib525$(EXEEXT)
+ $(LINK) $(lib525_LDFLAGS) $(lib525_OBJECTS) $(lib525_LDADD) $(LIBS)
+lib526$(EXEEXT): $(lib526_OBJECTS) $(lib526_DEPENDENCIES)
+ @rm -f lib526$(EXEEXT)
+ $(LINK) $(lib526_LDFLAGS) $(lib526_OBJECTS) $(lib526_LDADD) $(LIBS)
+lib527$(EXEEXT): $(lib527_OBJECTS) $(lib527_DEPENDENCIES)
+ @rm -f lib527$(EXEEXT)
+ $(LINK) $(lib527_LDFLAGS) $(lib527_OBJECTS) $(lib527_LDADD) $(LIBS)
+lib529$(EXEEXT): $(lib529_OBJECTS) $(lib529_DEPENDENCIES)
+ @rm -f lib529$(EXEEXT)
+ $(LINK) $(lib529_LDFLAGS) $(lib529_OBJECTS) $(lib529_LDADD) $(LIBS)
+lib530$(EXEEXT): $(lib530_OBJECTS) $(lib530_DEPENDENCIES)
+ @rm -f lib530$(EXEEXT)
+ $(LINK) $(lib530_LDFLAGS) $(lib530_OBJECTS) $(lib530_LDADD) $(LIBS)
+lib532$(EXEEXT): $(lib532_OBJECTS) $(lib532_DEPENDENCIES)
+ @rm -f lib532$(EXEEXT)
+ $(LINK) $(lib532_LDFLAGS) $(lib532_OBJECTS) $(lib532_LDADD) $(LIBS)
+lib533$(EXEEXT): $(lib533_OBJECTS) $(lib533_DEPENDENCIES)
+ @rm -f lib533$(EXEEXT)
+ $(LINK) $(lib533_LDFLAGS) $(lib533_OBJECTS) $(lib533_LDADD) $(LIBS)
+lib536$(EXEEXT): $(lib536_OBJECTS) $(lib536_DEPENDENCIES)
+ @rm -f lib536$(EXEEXT)
+ $(LINK) $(lib536_LDFLAGS) $(lib536_OBJECTS) $(lib536_LDADD) $(LIBS)
+lib537$(EXEEXT): $(lib537_OBJECTS) $(lib537_DEPENDENCIES)
+ @rm -f lib537$(EXEEXT)
+ $(LINK) $(lib537_LDFLAGS) $(lib537_OBJECTS) $(lib537_LDADD) $(LIBS)
+lib539$(EXEEXT): $(lib539_OBJECTS) $(lib539_DEPENDENCIES)
+ @rm -f lib539$(EXEEXT)
+ $(LINK) $(lib539_LDFLAGS) $(lib539_OBJECTS) $(lib539_LDADD) $(LIBS)
+lib540$(EXEEXT): $(lib540_OBJECTS) $(lib540_DEPENDENCIES)
+ @rm -f lib540$(EXEEXT)
+ $(LINK) $(lib540_LDFLAGS) $(lib540_OBJECTS) $(lib540_LDADD) $(LIBS)
+lib541$(EXEEXT): $(lib541_OBJECTS) $(lib541_DEPENDENCIES)
+ @rm -f lib541$(EXEEXT)
+ $(LINK) $(lib541_LDFLAGS) $(lib541_OBJECTS) $(lib541_LDADD) $(LIBS)
+lib542$(EXEEXT): $(lib542_OBJECTS) $(lib542_DEPENDENCIES)
+ @rm -f lib542$(EXEEXT)
+ $(LINK) $(lib542_LDFLAGS) $(lib542_OBJECTS) $(lib542_LDADD) $(LIBS)
+lib543$(EXEEXT): $(lib543_OBJECTS) $(lib543_DEPENDENCIES)
+ @rm -f lib543$(EXEEXT)
+ $(LINK) $(lib543_LDFLAGS) $(lib543_OBJECTS) $(lib543_LDADD) $(LIBS)
+lib544$(EXEEXT): $(lib544_OBJECTS) $(lib544_DEPENDENCIES)
+ @rm -f lib544$(EXEEXT)
+ $(LINK) $(lib544_LDFLAGS) $(lib544_OBJECTS) $(lib544_LDADD) $(LIBS)
+lib545$(EXEEXT): $(lib545_OBJECTS) $(lib545_DEPENDENCIES)
+ @rm -f lib545$(EXEEXT)
+ $(LINK) $(lib545_LDFLAGS) $(lib545_OBJECTS) $(lib545_LDADD) $(LIBS)
+lib547$(EXEEXT): $(lib547_OBJECTS) $(lib547_DEPENDENCIES)
+ @rm -f lib547$(EXEEXT)
+ $(LINK) $(lib547_LDFLAGS) $(lib547_OBJECTS) $(lib547_LDADD) $(LIBS)
+lib548$(EXEEXT): $(lib548_OBJECTS) $(lib548_DEPENDENCIES)
+ @rm -f lib548$(EXEEXT)
+ $(LINK) $(lib548_LDFLAGS) $(lib548_OBJECTS) $(lib548_LDADD) $(LIBS)
+lib549$(EXEEXT): $(lib549_OBJECTS) $(lib549_DEPENDENCIES)
+ @rm -f lib549$(EXEEXT)
+ $(LINK) $(lib549_LDFLAGS) $(lib549_OBJECTS) $(lib549_LDADD) $(LIBS)
+lib552$(EXEEXT): $(lib552_OBJECTS) $(lib552_DEPENDENCIES)
+ @rm -f lib552$(EXEEXT)
+ $(LINK) $(lib552_LDFLAGS) $(lib552_OBJECTS) $(lib552_LDADD) $(LIBS)
+lib553$(EXEEXT): $(lib553_OBJECTS) $(lib553_DEPENDENCIES)
+ @rm -f lib553$(EXEEXT)
+ $(LINK) $(lib553_LDFLAGS) $(lib553_OBJECTS) $(lib553_LDADD) $(LIBS)
+lib554$(EXEEXT): $(lib554_OBJECTS) $(lib554_DEPENDENCIES)
+ @rm -f lib554$(EXEEXT)
+ $(LINK) $(lib554_LDFLAGS) $(lib554_OBJECTS) $(lib554_LDADD) $(LIBS)
+lib555$(EXEEXT): $(lib555_OBJECTS) $(lib555_DEPENDENCIES)
+ @rm -f lib555$(EXEEXT)
+ $(LINK) $(lib555_LDFLAGS) $(lib555_OBJECTS) $(lib555_LDADD) $(LIBS)
+lib556$(EXEEXT): $(lib556_OBJECTS) $(lib556_DEPENDENCIES)
+ @rm -f lib556$(EXEEXT)
+ $(LINK) $(lib556_LDFLAGS) $(lib556_OBJECTS) $(lib556_LDADD) $(LIBS)
+lib557$(EXEEXT): $(lib557_OBJECTS) $(lib557_DEPENDENCIES)
+ @rm -f lib557$(EXEEXT)
+ $(LINK) $(lib557_LDFLAGS) $(lib557_OBJECTS) $(lib557_LDADD) $(LIBS)
+lib558$(EXEEXT): $(lib558_OBJECTS) $(lib558_DEPENDENCIES)
+ @rm -f lib558$(EXEEXT)
+ $(LINK) $(lib558_LDFLAGS) $(lib558_OBJECTS) $(lib558_LDADD) $(LIBS)
+lib559$(EXEEXT): $(lib559_OBJECTS) $(lib559_DEPENDENCIES)
+ @rm -f lib559$(EXEEXT)
+ $(LINK) $(lib559_LDFLAGS) $(lib559_OBJECTS) $(lib559_LDADD) $(LIBS)
+lib560$(EXEEXT): $(lib560_OBJECTS) $(lib560_DEPENDENCIES)
+ @rm -f lib560$(EXEEXT)
+ $(LINK) $(lib560_LDFLAGS) $(lib560_OBJECTS) $(lib560_LDADD) $(LIBS)
+lib562$(EXEEXT): $(lib562_OBJECTS) $(lib562_DEPENDENCIES)
+ @rm -f lib562$(EXEEXT)
+ $(LINK) $(lib562_LDFLAGS) $(lib562_OBJECTS) $(lib562_LDADD) $(LIBS)
+lib564$(EXEEXT): $(lib564_OBJECTS) $(lib564_DEPENDENCIES)
+ @rm -f lib564$(EXEEXT)
+ $(LINK) $(lib564_LDFLAGS) $(lib564_OBJECTS) $(lib564_LDADD) $(LIBS)
+lib565$(EXEEXT): $(lib565_OBJECTS) $(lib565_DEPENDENCIES)
+ @rm -f lib565$(EXEEXT)
+ $(LINK) $(lib565_LDFLAGS) $(lib565_OBJECTS) $(lib565_LDADD) $(LIBS)
+lib566$(EXEEXT): $(lib566_OBJECTS) $(lib566_DEPENDENCIES)
+ @rm -f lib566$(EXEEXT)
+ $(LINK) $(lib566_LDFLAGS) $(lib566_OBJECTS) $(lib566_LDADD) $(LIBS)
+lib567$(EXEEXT): $(lib567_OBJECTS) $(lib567_DEPENDENCIES)
+ @rm -f lib567$(EXEEXT)
+ $(LINK) $(lib567_LDFLAGS) $(lib567_OBJECTS) $(lib567_LDADD) $(LIBS)
+lib568$(EXEEXT): $(lib568_OBJECTS) $(lib568_DEPENDENCIES)
+ @rm -f lib568$(EXEEXT)
+ $(LINK) $(lib568_LDFLAGS) $(lib568_OBJECTS) $(lib568_LDADD) $(LIBS)
+lib569$(EXEEXT): $(lib569_OBJECTS) $(lib569_DEPENDENCIES)
+ @rm -f lib569$(EXEEXT)
+ $(LINK) $(lib569_LDFLAGS) $(lib569_OBJECTS) $(lib569_LDADD) $(LIBS)
+lib570$(EXEEXT): $(lib570_OBJECTS) $(lib570_DEPENDENCIES)
+ @rm -f lib570$(EXEEXT)
+ $(LINK) $(lib570_LDFLAGS) $(lib570_OBJECTS) $(lib570_LDADD) $(LIBS)
+lib571$(EXEEXT): $(lib571_OBJECTS) $(lib571_DEPENDENCIES)
+ @rm -f lib571$(EXEEXT)
+ $(LINK) $(lib571_LDFLAGS) $(lib571_OBJECTS) $(lib571_LDADD) $(LIBS)
+lib572$(EXEEXT): $(lib572_OBJECTS) $(lib572_DEPENDENCIES)
+ @rm -f lib572$(EXEEXT)
+ $(LINK) $(lib572_LDFLAGS) $(lib572_OBJECTS) $(lib572_LDADD) $(LIBS)
+lib573$(EXEEXT): $(lib573_OBJECTS) $(lib573_DEPENDENCIES)
+ @rm -f lib573$(EXEEXT)
+ $(LINK) $(lib573_LDFLAGS) $(lib573_OBJECTS) $(lib573_LDADD) $(LIBS)
+lib574$(EXEEXT): $(lib574_OBJECTS) $(lib574_DEPENDENCIES)
+ @rm -f lib574$(EXEEXT)
+ $(LINK) $(lib574_LDFLAGS) $(lib574_OBJECTS) $(lib574_LDADD) $(LIBS)
+lib575$(EXEEXT): $(lib575_OBJECTS) $(lib575_DEPENDENCIES)
+ @rm -f lib575$(EXEEXT)
+ $(LINK) $(lib575_LDFLAGS) $(lib575_OBJECTS) $(lib575_LDADD) $(LIBS)
+lib576$(EXEEXT): $(lib576_OBJECTS) $(lib576_DEPENDENCIES)
+ @rm -f lib576$(EXEEXT)
+ $(LINK) $(lib576_LDFLAGS) $(lib576_OBJECTS) $(lib576_LDADD) $(LIBS)
+lib577$(EXEEXT): $(lib577_OBJECTS) $(lib577_DEPENDENCIES)
+ @rm -f lib577$(EXEEXT)
+ $(LINK) $(lib577_LDFLAGS) $(lib577_OBJECTS) $(lib577_LDADD) $(LIBS)
+lib578$(EXEEXT): $(lib578_OBJECTS) $(lib578_DEPENDENCIES)
+ @rm -f lib578$(EXEEXT)
+ $(LINK) $(lib578_LDFLAGS) $(lib578_OBJECTS) $(lib578_LDADD) $(LIBS)
+lib579$(EXEEXT): $(lib579_OBJECTS) $(lib579_DEPENDENCIES)
+ @rm -f lib579$(EXEEXT)
+ $(LINK) $(lib579_LDFLAGS) $(lib579_OBJECTS) $(lib579_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chkhostname-chkhostname.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chkhostname-curl_gethostname.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/first.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib500.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib501.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib502.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib503.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib504.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib505.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib506.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib507.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib508.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib510.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib511.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib512.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib513.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib514.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib515.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib516.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib517.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib518.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib519.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib520.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib521.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib523.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib524.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib525.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib526-first.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib526-lib526.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib526-testutil.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib527-first.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib527-lib526.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib527-testutil.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib529-first.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib529-lib525.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib529-testutil.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib530-first.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib530-lib530.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib530-testutil.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib532-first.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib532-lib526.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib532-testutil.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib533.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib536.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib537.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib539.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib540.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib541.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib542.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib543.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib544.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib545-first.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib545-lib544.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib547.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib548-first.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib548-lib547.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib549.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib552.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib553.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib554.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib555.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib556.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib557.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib558-first.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib558-lib558.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib559-first.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib559-lib558.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib560.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib562.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib564.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib565-first.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib565-lib510.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib566.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib567.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib568.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib569.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib570.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib571.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib572.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib573.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib574.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib575.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib576.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib577.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib578.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib579.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sethostname.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testutil.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+chkhostname-chkhostname.o: chkhostname.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chkhostname_CFLAGS) $(CFLAGS) -MT chkhostname-chkhostname.o -MD -MP -MF "$(DEPDIR)/chkhostname-chkhostname.Tpo" -c -o chkhostname-chkhostname.o `test -f 'chkhostname.c' || echo '$(srcdir)/'`chkhostname.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/chkhostname-chkhostname.Tpo" "$(DEPDIR)/chkhostname-chkhostname.Po"; else rm -f "$(DEPDIR)/chkhostname-chkhostname.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='chkhostname.c' object='chkhostname-chkhostname.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chkhostname_CFLAGS) $(CFLAGS) -c -o chkhostname-chkhostname.o `test -f 'chkhostname.c' || echo '$(srcdir)/'`chkhostname.c
+
+chkhostname-chkhostname.obj: chkhostname.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chkhostname_CFLAGS) $(CFLAGS) -MT chkhostname-chkhostname.obj -MD -MP -MF "$(DEPDIR)/chkhostname-chkhostname.Tpo" -c -o chkhostname-chkhostname.obj `if test -f 'chkhostname.c'; then $(CYGPATH_W) 'chkhostname.c'; else $(CYGPATH_W) '$(srcdir)/chkhostname.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/chkhostname-chkhostname.Tpo" "$(DEPDIR)/chkhostname-chkhostname.Po"; else rm -f "$(DEPDIR)/chkhostname-chkhostname.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='chkhostname.c' object='chkhostname-chkhostname.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chkhostname_CFLAGS) $(CFLAGS) -c -o chkhostname-chkhostname.obj `if test -f 'chkhostname.c'; then $(CYGPATH_W) 'chkhostname.c'; else $(CYGPATH_W) '$(srcdir)/chkhostname.c'; fi`
+
+chkhostname-curl_gethostname.o: $(top_srcdir)/lib/curl_gethostname.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chkhostname_CFLAGS) $(CFLAGS) -MT chkhostname-curl_gethostname.o -MD -MP -MF "$(DEPDIR)/chkhostname-curl_gethostname.Tpo" -c -o chkhostname-curl_gethostname.o `test -f '$(top_srcdir)/lib/curl_gethostname.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/curl_gethostname.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/chkhostname-curl_gethostname.Tpo" "$(DEPDIR)/chkhostname-curl_gethostname.Po"; else rm -f "$(DEPDIR)/chkhostname-curl_gethostname.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/curl_gethostname.c' object='chkhostname-curl_gethostname.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chkhostname_CFLAGS) $(CFLAGS) -c -o chkhostname-curl_gethostname.o `test -f '$(top_srcdir)/lib/curl_gethostname.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/curl_gethostname.c
+
+chkhostname-curl_gethostname.obj: $(top_srcdir)/lib/curl_gethostname.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chkhostname_CFLAGS) $(CFLAGS) -MT chkhostname-curl_gethostname.obj -MD -MP -MF "$(DEPDIR)/chkhostname-curl_gethostname.Tpo" -c -o chkhostname-curl_gethostname.obj `if test -f '$(top_srcdir)/lib/curl_gethostname.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/curl_gethostname.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/curl_gethostname.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/chkhostname-curl_gethostname.Tpo" "$(DEPDIR)/chkhostname-curl_gethostname.Po"; else rm -f "$(DEPDIR)/chkhostname-curl_gethostname.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/curl_gethostname.c' object='chkhostname-curl_gethostname.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chkhostname_CFLAGS) $(CFLAGS) -c -o chkhostname-curl_gethostname.obj `if test -f '$(top_srcdir)/lib/curl_gethostname.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/curl_gethostname.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/curl_gethostname.c'; fi`
+
+lib526-lib526.o: lib526.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib526_CFLAGS) $(CFLAGS) -MT lib526-lib526.o -MD -MP -MF "$(DEPDIR)/lib526-lib526.Tpo" -c -o lib526-lib526.o `test -f 'lib526.c' || echo '$(srcdir)/'`lib526.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib526-lib526.Tpo" "$(DEPDIR)/lib526-lib526.Po"; else rm -f "$(DEPDIR)/lib526-lib526.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lib526.c' object='lib526-lib526.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib526_CFLAGS) $(CFLAGS) -c -o lib526-lib526.o `test -f 'lib526.c' || echo '$(srcdir)/'`lib526.c
+
+lib526-lib526.obj: lib526.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib526_CFLAGS) $(CFLAGS) -MT lib526-lib526.obj -MD -MP -MF "$(DEPDIR)/lib526-lib526.Tpo" -c -o lib526-lib526.obj `if test -f 'lib526.c'; then $(CYGPATH_W) 'lib526.c'; else $(CYGPATH_W) '$(srcdir)/lib526.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib526-lib526.Tpo" "$(DEPDIR)/lib526-lib526.Po"; else rm -f "$(DEPDIR)/lib526-lib526.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lib526.c' object='lib526-lib526.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib526_CFLAGS) $(CFLAGS) -c -o lib526-lib526.obj `if test -f 'lib526.c'; then $(CYGPATH_W) 'lib526.c'; else $(CYGPATH_W) '$(srcdir)/lib526.c'; fi`
+
+lib526-first.o: first.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib526_CFLAGS) $(CFLAGS) -MT lib526-first.o -MD -MP -MF "$(DEPDIR)/lib526-first.Tpo" -c -o lib526-first.o `test -f 'first.c' || echo '$(srcdir)/'`first.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib526-first.Tpo" "$(DEPDIR)/lib526-first.Po"; else rm -f "$(DEPDIR)/lib526-first.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='first.c' object='lib526-first.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib526_CFLAGS) $(CFLAGS) -c -o lib526-first.o `test -f 'first.c' || echo '$(srcdir)/'`first.c
+
+lib526-first.obj: first.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib526_CFLAGS) $(CFLAGS) -MT lib526-first.obj -MD -MP -MF "$(DEPDIR)/lib526-first.Tpo" -c -o lib526-first.obj `if test -f 'first.c'; then $(CYGPATH_W) 'first.c'; else $(CYGPATH_W) '$(srcdir)/first.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib526-first.Tpo" "$(DEPDIR)/lib526-first.Po"; else rm -f "$(DEPDIR)/lib526-first.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='first.c' object='lib526-first.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib526_CFLAGS) $(CFLAGS) -c -o lib526-first.obj `if test -f 'first.c'; then $(CYGPATH_W) 'first.c'; else $(CYGPATH_W) '$(srcdir)/first.c'; fi`
+
+lib526-testutil.o: testutil.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib526_CFLAGS) $(CFLAGS) -MT lib526-testutil.o -MD -MP -MF "$(DEPDIR)/lib526-testutil.Tpo" -c -o lib526-testutil.o `test -f 'testutil.c' || echo '$(srcdir)/'`testutil.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib526-testutil.Tpo" "$(DEPDIR)/lib526-testutil.Po"; else rm -f "$(DEPDIR)/lib526-testutil.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testutil.c' object='lib526-testutil.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib526_CFLAGS) $(CFLAGS) -c -o lib526-testutil.o `test -f 'testutil.c' || echo '$(srcdir)/'`testutil.c
+
+lib526-testutil.obj: testutil.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib526_CFLAGS) $(CFLAGS) -MT lib526-testutil.obj -MD -MP -MF "$(DEPDIR)/lib526-testutil.Tpo" -c -o lib526-testutil.obj `if test -f 'testutil.c'; then $(CYGPATH_W) 'testutil.c'; else $(CYGPATH_W) '$(srcdir)/testutil.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib526-testutil.Tpo" "$(DEPDIR)/lib526-testutil.Po"; else rm -f "$(DEPDIR)/lib526-testutil.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testutil.c' object='lib526-testutil.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib526_CFLAGS) $(CFLAGS) -c -o lib526-testutil.obj `if test -f 'testutil.c'; then $(CYGPATH_W) 'testutil.c'; else $(CYGPATH_W) '$(srcdir)/testutil.c'; fi`
+
+lib527-lib526.o: lib526.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib527_CFLAGS) $(CFLAGS) -MT lib527-lib526.o -MD -MP -MF "$(DEPDIR)/lib527-lib526.Tpo" -c -o lib527-lib526.o `test -f 'lib526.c' || echo '$(srcdir)/'`lib526.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib527-lib526.Tpo" "$(DEPDIR)/lib527-lib526.Po"; else rm -f "$(DEPDIR)/lib527-lib526.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lib526.c' object='lib527-lib526.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib527_CFLAGS) $(CFLAGS) -c -o lib527-lib526.o `test -f 'lib526.c' || echo '$(srcdir)/'`lib526.c
+
+lib527-lib526.obj: lib526.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib527_CFLAGS) $(CFLAGS) -MT lib527-lib526.obj -MD -MP -MF "$(DEPDIR)/lib527-lib526.Tpo" -c -o lib527-lib526.obj `if test -f 'lib526.c'; then $(CYGPATH_W) 'lib526.c'; else $(CYGPATH_W) '$(srcdir)/lib526.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib527-lib526.Tpo" "$(DEPDIR)/lib527-lib526.Po"; else rm -f "$(DEPDIR)/lib527-lib526.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lib526.c' object='lib527-lib526.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib527_CFLAGS) $(CFLAGS) -c -o lib527-lib526.obj `if test -f 'lib526.c'; then $(CYGPATH_W) 'lib526.c'; else $(CYGPATH_W) '$(srcdir)/lib526.c'; fi`
+
+lib527-first.o: first.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib527_CFLAGS) $(CFLAGS) -MT lib527-first.o -MD -MP -MF "$(DEPDIR)/lib527-first.Tpo" -c -o lib527-first.o `test -f 'first.c' || echo '$(srcdir)/'`first.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib527-first.Tpo" "$(DEPDIR)/lib527-first.Po"; else rm -f "$(DEPDIR)/lib527-first.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='first.c' object='lib527-first.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib527_CFLAGS) $(CFLAGS) -c -o lib527-first.o `test -f 'first.c' || echo '$(srcdir)/'`first.c
+
+lib527-first.obj: first.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib527_CFLAGS) $(CFLAGS) -MT lib527-first.obj -MD -MP -MF "$(DEPDIR)/lib527-first.Tpo" -c -o lib527-first.obj `if test -f 'first.c'; then $(CYGPATH_W) 'first.c'; else $(CYGPATH_W) '$(srcdir)/first.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib527-first.Tpo" "$(DEPDIR)/lib527-first.Po"; else rm -f "$(DEPDIR)/lib527-first.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='first.c' object='lib527-first.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib527_CFLAGS) $(CFLAGS) -c -o lib527-first.obj `if test -f 'first.c'; then $(CYGPATH_W) 'first.c'; else $(CYGPATH_W) '$(srcdir)/first.c'; fi`
+
+lib527-testutil.o: testutil.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib527_CFLAGS) $(CFLAGS) -MT lib527-testutil.o -MD -MP -MF "$(DEPDIR)/lib527-testutil.Tpo" -c -o lib527-testutil.o `test -f 'testutil.c' || echo '$(srcdir)/'`testutil.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib527-testutil.Tpo" "$(DEPDIR)/lib527-testutil.Po"; else rm -f "$(DEPDIR)/lib527-testutil.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testutil.c' object='lib527-testutil.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib527_CFLAGS) $(CFLAGS) -c -o lib527-testutil.o `test -f 'testutil.c' || echo '$(srcdir)/'`testutil.c
+
+lib527-testutil.obj: testutil.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib527_CFLAGS) $(CFLAGS) -MT lib527-testutil.obj -MD -MP -MF "$(DEPDIR)/lib527-testutil.Tpo" -c -o lib527-testutil.obj `if test -f 'testutil.c'; then $(CYGPATH_W) 'testutil.c'; else $(CYGPATH_W) '$(srcdir)/testutil.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib527-testutil.Tpo" "$(DEPDIR)/lib527-testutil.Po"; else rm -f "$(DEPDIR)/lib527-testutil.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testutil.c' object='lib527-testutil.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib527_CFLAGS) $(CFLAGS) -c -o lib527-testutil.obj `if test -f 'testutil.c'; then $(CYGPATH_W) 'testutil.c'; else $(CYGPATH_W) '$(srcdir)/testutil.c'; fi`
+
+lib529-lib525.o: lib525.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib529_CFLAGS) $(CFLAGS) -MT lib529-lib525.o -MD -MP -MF "$(DEPDIR)/lib529-lib525.Tpo" -c -o lib529-lib525.o `test -f 'lib525.c' || echo '$(srcdir)/'`lib525.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib529-lib525.Tpo" "$(DEPDIR)/lib529-lib525.Po"; else rm -f "$(DEPDIR)/lib529-lib525.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lib525.c' object='lib529-lib525.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib529_CFLAGS) $(CFLAGS) -c -o lib529-lib525.o `test -f 'lib525.c' || echo '$(srcdir)/'`lib525.c
+
+lib529-lib525.obj: lib525.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib529_CFLAGS) $(CFLAGS) -MT lib529-lib525.obj -MD -MP -MF "$(DEPDIR)/lib529-lib525.Tpo" -c -o lib529-lib525.obj `if test -f 'lib525.c'; then $(CYGPATH_W) 'lib525.c'; else $(CYGPATH_W) '$(srcdir)/lib525.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib529-lib525.Tpo" "$(DEPDIR)/lib529-lib525.Po"; else rm -f "$(DEPDIR)/lib529-lib525.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lib525.c' object='lib529-lib525.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib529_CFLAGS) $(CFLAGS) -c -o lib529-lib525.obj `if test -f 'lib525.c'; then $(CYGPATH_W) 'lib525.c'; else $(CYGPATH_W) '$(srcdir)/lib525.c'; fi`
+
+lib529-first.o: first.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib529_CFLAGS) $(CFLAGS) -MT lib529-first.o -MD -MP -MF "$(DEPDIR)/lib529-first.Tpo" -c -o lib529-first.o `test -f 'first.c' || echo '$(srcdir)/'`first.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib529-first.Tpo" "$(DEPDIR)/lib529-first.Po"; else rm -f "$(DEPDIR)/lib529-first.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='first.c' object='lib529-first.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib529_CFLAGS) $(CFLAGS) -c -o lib529-first.o `test -f 'first.c' || echo '$(srcdir)/'`first.c
+
+lib529-first.obj: first.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib529_CFLAGS) $(CFLAGS) -MT lib529-first.obj -MD -MP -MF "$(DEPDIR)/lib529-first.Tpo" -c -o lib529-first.obj `if test -f 'first.c'; then $(CYGPATH_W) 'first.c'; else $(CYGPATH_W) '$(srcdir)/first.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib529-first.Tpo" "$(DEPDIR)/lib529-first.Po"; else rm -f "$(DEPDIR)/lib529-first.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='first.c' object='lib529-first.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib529_CFLAGS) $(CFLAGS) -c -o lib529-first.obj `if test -f 'first.c'; then $(CYGPATH_W) 'first.c'; else $(CYGPATH_W) '$(srcdir)/first.c'; fi`
+
+lib529-testutil.o: testutil.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib529_CFLAGS) $(CFLAGS) -MT lib529-testutil.o -MD -MP -MF "$(DEPDIR)/lib529-testutil.Tpo" -c -o lib529-testutil.o `test -f 'testutil.c' || echo '$(srcdir)/'`testutil.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib529-testutil.Tpo" "$(DEPDIR)/lib529-testutil.Po"; else rm -f "$(DEPDIR)/lib529-testutil.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testutil.c' object='lib529-testutil.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib529_CFLAGS) $(CFLAGS) -c -o lib529-testutil.o `test -f 'testutil.c' || echo '$(srcdir)/'`testutil.c
+
+lib529-testutil.obj: testutil.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib529_CFLAGS) $(CFLAGS) -MT lib529-testutil.obj -MD -MP -MF "$(DEPDIR)/lib529-testutil.Tpo" -c -o lib529-testutil.obj `if test -f 'testutil.c'; then $(CYGPATH_W) 'testutil.c'; else $(CYGPATH_W) '$(srcdir)/testutil.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib529-testutil.Tpo" "$(DEPDIR)/lib529-testutil.Po"; else rm -f "$(DEPDIR)/lib529-testutil.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testutil.c' object='lib529-testutil.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib529_CFLAGS) $(CFLAGS) -c -o lib529-testutil.obj `if test -f 'testutil.c'; then $(CYGPATH_W) 'testutil.c'; else $(CYGPATH_W) '$(srcdir)/testutil.c'; fi`
+
+lib530-lib530.o: lib530.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib530_CFLAGS) $(CFLAGS) -MT lib530-lib530.o -MD -MP -MF "$(DEPDIR)/lib530-lib530.Tpo" -c -o lib530-lib530.o `test -f 'lib530.c' || echo '$(srcdir)/'`lib530.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib530-lib530.Tpo" "$(DEPDIR)/lib530-lib530.Po"; else rm -f "$(DEPDIR)/lib530-lib530.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lib530.c' object='lib530-lib530.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib530_CFLAGS) $(CFLAGS) -c -o lib530-lib530.o `test -f 'lib530.c' || echo '$(srcdir)/'`lib530.c
+
+lib530-lib530.obj: lib530.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib530_CFLAGS) $(CFLAGS) -MT lib530-lib530.obj -MD -MP -MF "$(DEPDIR)/lib530-lib530.Tpo" -c -o lib530-lib530.obj `if test -f 'lib530.c'; then $(CYGPATH_W) 'lib530.c'; else $(CYGPATH_W) '$(srcdir)/lib530.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib530-lib530.Tpo" "$(DEPDIR)/lib530-lib530.Po"; else rm -f "$(DEPDIR)/lib530-lib530.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lib530.c' object='lib530-lib530.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib530_CFLAGS) $(CFLAGS) -c -o lib530-lib530.obj `if test -f 'lib530.c'; then $(CYGPATH_W) 'lib530.c'; else $(CYGPATH_W) '$(srcdir)/lib530.c'; fi`
+
+lib530-first.o: first.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib530_CFLAGS) $(CFLAGS) -MT lib530-first.o -MD -MP -MF "$(DEPDIR)/lib530-first.Tpo" -c -o lib530-first.o `test -f 'first.c' || echo '$(srcdir)/'`first.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib530-first.Tpo" "$(DEPDIR)/lib530-first.Po"; else rm -f "$(DEPDIR)/lib530-first.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='first.c' object='lib530-first.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib530_CFLAGS) $(CFLAGS) -c -o lib530-first.o `test -f 'first.c' || echo '$(srcdir)/'`first.c
+
+lib530-first.obj: first.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib530_CFLAGS) $(CFLAGS) -MT lib530-first.obj -MD -MP -MF "$(DEPDIR)/lib530-first.Tpo" -c -o lib530-first.obj `if test -f 'first.c'; then $(CYGPATH_W) 'first.c'; else $(CYGPATH_W) '$(srcdir)/first.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib530-first.Tpo" "$(DEPDIR)/lib530-first.Po"; else rm -f "$(DEPDIR)/lib530-first.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='first.c' object='lib530-first.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib530_CFLAGS) $(CFLAGS) -c -o lib530-first.obj `if test -f 'first.c'; then $(CYGPATH_W) 'first.c'; else $(CYGPATH_W) '$(srcdir)/first.c'; fi`
+
+lib530-testutil.o: testutil.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib530_CFLAGS) $(CFLAGS) -MT lib530-testutil.o -MD -MP -MF "$(DEPDIR)/lib530-testutil.Tpo" -c -o lib530-testutil.o `test -f 'testutil.c' || echo '$(srcdir)/'`testutil.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib530-testutil.Tpo" "$(DEPDIR)/lib530-testutil.Po"; else rm -f "$(DEPDIR)/lib530-testutil.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testutil.c' object='lib530-testutil.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib530_CFLAGS) $(CFLAGS) -c -o lib530-testutil.o `test -f 'testutil.c' || echo '$(srcdir)/'`testutil.c
+
+lib530-testutil.obj: testutil.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib530_CFLAGS) $(CFLAGS) -MT lib530-testutil.obj -MD -MP -MF "$(DEPDIR)/lib530-testutil.Tpo" -c -o lib530-testutil.obj `if test -f 'testutil.c'; then $(CYGPATH_W) 'testutil.c'; else $(CYGPATH_W) '$(srcdir)/testutil.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib530-testutil.Tpo" "$(DEPDIR)/lib530-testutil.Po"; else rm -f "$(DEPDIR)/lib530-testutil.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testutil.c' object='lib530-testutil.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib530_CFLAGS) $(CFLAGS) -c -o lib530-testutil.obj `if test -f 'testutil.c'; then $(CYGPATH_W) 'testutil.c'; else $(CYGPATH_W) '$(srcdir)/testutil.c'; fi`
+
+lib532-lib526.o: lib526.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib532_CFLAGS) $(CFLAGS) -MT lib532-lib526.o -MD -MP -MF "$(DEPDIR)/lib532-lib526.Tpo" -c -o lib532-lib526.o `test -f 'lib526.c' || echo '$(srcdir)/'`lib526.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib532-lib526.Tpo" "$(DEPDIR)/lib532-lib526.Po"; else rm -f "$(DEPDIR)/lib532-lib526.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lib526.c' object='lib532-lib526.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib532_CFLAGS) $(CFLAGS) -c -o lib532-lib526.o `test -f 'lib526.c' || echo '$(srcdir)/'`lib526.c
+
+lib532-lib526.obj: lib526.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib532_CFLAGS) $(CFLAGS) -MT lib532-lib526.obj -MD -MP -MF "$(DEPDIR)/lib532-lib526.Tpo" -c -o lib532-lib526.obj `if test -f 'lib526.c'; then $(CYGPATH_W) 'lib526.c'; else $(CYGPATH_W) '$(srcdir)/lib526.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib532-lib526.Tpo" "$(DEPDIR)/lib532-lib526.Po"; else rm -f "$(DEPDIR)/lib532-lib526.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lib526.c' object='lib532-lib526.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib532_CFLAGS) $(CFLAGS) -c -o lib532-lib526.obj `if test -f 'lib526.c'; then $(CYGPATH_W) 'lib526.c'; else $(CYGPATH_W) '$(srcdir)/lib526.c'; fi`
+
+lib532-first.o: first.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib532_CFLAGS) $(CFLAGS) -MT lib532-first.o -MD -MP -MF "$(DEPDIR)/lib532-first.Tpo" -c -o lib532-first.o `test -f 'first.c' || echo '$(srcdir)/'`first.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib532-first.Tpo" "$(DEPDIR)/lib532-first.Po"; else rm -f "$(DEPDIR)/lib532-first.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='first.c' object='lib532-first.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib532_CFLAGS) $(CFLAGS) -c -o lib532-first.o `test -f 'first.c' || echo '$(srcdir)/'`first.c
+
+lib532-first.obj: first.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib532_CFLAGS) $(CFLAGS) -MT lib532-first.obj -MD -MP -MF "$(DEPDIR)/lib532-first.Tpo" -c -o lib532-first.obj `if test -f 'first.c'; then $(CYGPATH_W) 'first.c'; else $(CYGPATH_W) '$(srcdir)/first.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib532-first.Tpo" "$(DEPDIR)/lib532-first.Po"; else rm -f "$(DEPDIR)/lib532-first.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='first.c' object='lib532-first.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib532_CFLAGS) $(CFLAGS) -c -o lib532-first.obj `if test -f 'first.c'; then $(CYGPATH_W) 'first.c'; else $(CYGPATH_W) '$(srcdir)/first.c'; fi`
+
+lib532-testutil.o: testutil.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib532_CFLAGS) $(CFLAGS) -MT lib532-testutil.o -MD -MP -MF "$(DEPDIR)/lib532-testutil.Tpo" -c -o lib532-testutil.o `test -f 'testutil.c' || echo '$(srcdir)/'`testutil.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib532-testutil.Tpo" "$(DEPDIR)/lib532-testutil.Po"; else rm -f "$(DEPDIR)/lib532-testutil.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testutil.c' object='lib532-testutil.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib532_CFLAGS) $(CFLAGS) -c -o lib532-testutil.o `test -f 'testutil.c' || echo '$(srcdir)/'`testutil.c
+
+lib532-testutil.obj: testutil.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib532_CFLAGS) $(CFLAGS) -MT lib532-testutil.obj -MD -MP -MF "$(DEPDIR)/lib532-testutil.Tpo" -c -o lib532-testutil.obj `if test -f 'testutil.c'; then $(CYGPATH_W) 'testutil.c'; else $(CYGPATH_W) '$(srcdir)/testutil.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib532-testutil.Tpo" "$(DEPDIR)/lib532-testutil.Po"; else rm -f "$(DEPDIR)/lib532-testutil.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testutil.c' object='lib532-testutil.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib532_CFLAGS) $(CFLAGS) -c -o lib532-testutil.obj `if test -f 'testutil.c'; then $(CYGPATH_W) 'testutil.c'; else $(CYGPATH_W) '$(srcdir)/testutil.c'; fi`
+
+lib545-lib544.o: lib544.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib545_CFLAGS) $(CFLAGS) -MT lib545-lib544.o -MD -MP -MF "$(DEPDIR)/lib545-lib544.Tpo" -c -o lib545-lib544.o `test -f 'lib544.c' || echo '$(srcdir)/'`lib544.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib545-lib544.Tpo" "$(DEPDIR)/lib545-lib544.Po"; else rm -f "$(DEPDIR)/lib545-lib544.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lib544.c' object='lib545-lib544.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib545_CFLAGS) $(CFLAGS) -c -o lib545-lib544.o `test -f 'lib544.c' || echo '$(srcdir)/'`lib544.c
+
+lib545-lib544.obj: lib544.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib545_CFLAGS) $(CFLAGS) -MT lib545-lib544.obj -MD -MP -MF "$(DEPDIR)/lib545-lib544.Tpo" -c -o lib545-lib544.obj `if test -f 'lib544.c'; then $(CYGPATH_W) 'lib544.c'; else $(CYGPATH_W) '$(srcdir)/lib544.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib545-lib544.Tpo" "$(DEPDIR)/lib545-lib544.Po"; else rm -f "$(DEPDIR)/lib545-lib544.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lib544.c' object='lib545-lib544.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib545_CFLAGS) $(CFLAGS) -c -o lib545-lib544.obj `if test -f 'lib544.c'; then $(CYGPATH_W) 'lib544.c'; else $(CYGPATH_W) '$(srcdir)/lib544.c'; fi`
+
+lib545-first.o: first.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib545_CFLAGS) $(CFLAGS) -MT lib545-first.o -MD -MP -MF "$(DEPDIR)/lib545-first.Tpo" -c -o lib545-first.o `test -f 'first.c' || echo '$(srcdir)/'`first.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib545-first.Tpo" "$(DEPDIR)/lib545-first.Po"; else rm -f "$(DEPDIR)/lib545-first.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='first.c' object='lib545-first.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib545_CFLAGS) $(CFLAGS) -c -o lib545-first.o `test -f 'first.c' || echo '$(srcdir)/'`first.c
+
+lib545-first.obj: first.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib545_CFLAGS) $(CFLAGS) -MT lib545-first.obj -MD -MP -MF "$(DEPDIR)/lib545-first.Tpo" -c -o lib545-first.obj `if test -f 'first.c'; then $(CYGPATH_W) 'first.c'; else $(CYGPATH_W) '$(srcdir)/first.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib545-first.Tpo" "$(DEPDIR)/lib545-first.Po"; else rm -f "$(DEPDIR)/lib545-first.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='first.c' object='lib545-first.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib545_CFLAGS) $(CFLAGS) -c -o lib545-first.obj `if test -f 'first.c'; then $(CYGPATH_W) 'first.c'; else $(CYGPATH_W) '$(srcdir)/first.c'; fi`
+
+lib548-lib547.o: lib547.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib548_CFLAGS) $(CFLAGS) -MT lib548-lib547.o -MD -MP -MF "$(DEPDIR)/lib548-lib547.Tpo" -c -o lib548-lib547.o `test -f 'lib547.c' || echo '$(srcdir)/'`lib547.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib548-lib547.Tpo" "$(DEPDIR)/lib548-lib547.Po"; else rm -f "$(DEPDIR)/lib548-lib547.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lib547.c' object='lib548-lib547.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib548_CFLAGS) $(CFLAGS) -c -o lib548-lib547.o `test -f 'lib547.c' || echo '$(srcdir)/'`lib547.c
+
+lib548-lib547.obj: lib547.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib548_CFLAGS) $(CFLAGS) -MT lib548-lib547.obj -MD -MP -MF "$(DEPDIR)/lib548-lib547.Tpo" -c -o lib548-lib547.obj `if test -f 'lib547.c'; then $(CYGPATH_W) 'lib547.c'; else $(CYGPATH_W) '$(srcdir)/lib547.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib548-lib547.Tpo" "$(DEPDIR)/lib548-lib547.Po"; else rm -f "$(DEPDIR)/lib548-lib547.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lib547.c' object='lib548-lib547.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib548_CFLAGS) $(CFLAGS) -c -o lib548-lib547.obj `if test -f 'lib547.c'; then $(CYGPATH_W) 'lib547.c'; else $(CYGPATH_W) '$(srcdir)/lib547.c'; fi`
+
+lib548-first.o: first.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib548_CFLAGS) $(CFLAGS) -MT lib548-first.o -MD -MP -MF "$(DEPDIR)/lib548-first.Tpo" -c -o lib548-first.o `test -f 'first.c' || echo '$(srcdir)/'`first.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib548-first.Tpo" "$(DEPDIR)/lib548-first.Po"; else rm -f "$(DEPDIR)/lib548-first.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='first.c' object='lib548-first.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib548_CFLAGS) $(CFLAGS) -c -o lib548-first.o `test -f 'first.c' || echo '$(srcdir)/'`first.c
+
+lib548-first.obj: first.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib548_CFLAGS) $(CFLAGS) -MT lib548-first.obj -MD -MP -MF "$(DEPDIR)/lib548-first.Tpo" -c -o lib548-first.obj `if test -f 'first.c'; then $(CYGPATH_W) 'first.c'; else $(CYGPATH_W) '$(srcdir)/first.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib548-first.Tpo" "$(DEPDIR)/lib548-first.Po"; else rm -f "$(DEPDIR)/lib548-first.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='first.c' object='lib548-first.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib548_CFLAGS) $(CFLAGS) -c -o lib548-first.obj `if test -f 'first.c'; then $(CYGPATH_W) 'first.c'; else $(CYGPATH_W) '$(srcdir)/first.c'; fi`
+
+lib558-lib558.o: lib558.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib558_CFLAGS) $(CFLAGS) -MT lib558-lib558.o -MD -MP -MF "$(DEPDIR)/lib558-lib558.Tpo" -c -o lib558-lib558.o `test -f 'lib558.c' || echo '$(srcdir)/'`lib558.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib558-lib558.Tpo" "$(DEPDIR)/lib558-lib558.Po"; else rm -f "$(DEPDIR)/lib558-lib558.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lib558.c' object='lib558-lib558.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib558_CFLAGS) $(CFLAGS) -c -o lib558-lib558.o `test -f 'lib558.c' || echo '$(srcdir)/'`lib558.c
+
+lib558-lib558.obj: lib558.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib558_CFLAGS) $(CFLAGS) -MT lib558-lib558.obj -MD -MP -MF "$(DEPDIR)/lib558-lib558.Tpo" -c -o lib558-lib558.obj `if test -f 'lib558.c'; then $(CYGPATH_W) 'lib558.c'; else $(CYGPATH_W) '$(srcdir)/lib558.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib558-lib558.Tpo" "$(DEPDIR)/lib558-lib558.Po"; else rm -f "$(DEPDIR)/lib558-lib558.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lib558.c' object='lib558-lib558.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib558_CFLAGS) $(CFLAGS) -c -o lib558-lib558.obj `if test -f 'lib558.c'; then $(CYGPATH_W) 'lib558.c'; else $(CYGPATH_W) '$(srcdir)/lib558.c'; fi`
+
+lib558-first.o: first.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib558_CFLAGS) $(CFLAGS) -MT lib558-first.o -MD -MP -MF "$(DEPDIR)/lib558-first.Tpo" -c -o lib558-first.o `test -f 'first.c' || echo '$(srcdir)/'`first.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib558-first.Tpo" "$(DEPDIR)/lib558-first.Po"; else rm -f "$(DEPDIR)/lib558-first.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='first.c' object='lib558-first.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib558_CFLAGS) $(CFLAGS) -c -o lib558-first.o `test -f 'first.c' || echo '$(srcdir)/'`first.c
+
+lib558-first.obj: first.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib558_CFLAGS) $(CFLAGS) -MT lib558-first.obj -MD -MP -MF "$(DEPDIR)/lib558-first.Tpo" -c -o lib558-first.obj `if test -f 'first.c'; then $(CYGPATH_W) 'first.c'; else $(CYGPATH_W) '$(srcdir)/first.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib558-first.Tpo" "$(DEPDIR)/lib558-first.Po"; else rm -f "$(DEPDIR)/lib558-first.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='first.c' object='lib558-first.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib558_CFLAGS) $(CFLAGS) -c -o lib558-first.obj `if test -f 'first.c'; then $(CYGPATH_W) 'first.c'; else $(CYGPATH_W) '$(srcdir)/first.c'; fi`
+
+lib559-lib558.o: lib558.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib559_CFLAGS) $(CFLAGS) -MT lib559-lib558.o -MD -MP -MF "$(DEPDIR)/lib559-lib558.Tpo" -c -o lib559-lib558.o `test -f 'lib558.c' || echo '$(srcdir)/'`lib558.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib559-lib558.Tpo" "$(DEPDIR)/lib559-lib558.Po"; else rm -f "$(DEPDIR)/lib559-lib558.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lib558.c' object='lib559-lib558.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib559_CFLAGS) $(CFLAGS) -c -o lib559-lib558.o `test -f 'lib558.c' || echo '$(srcdir)/'`lib558.c
+
+lib559-lib558.obj: lib558.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib559_CFLAGS) $(CFLAGS) -MT lib559-lib558.obj -MD -MP -MF "$(DEPDIR)/lib559-lib558.Tpo" -c -o lib559-lib558.obj `if test -f 'lib558.c'; then $(CYGPATH_W) 'lib558.c'; else $(CYGPATH_W) '$(srcdir)/lib558.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib559-lib558.Tpo" "$(DEPDIR)/lib559-lib558.Po"; else rm -f "$(DEPDIR)/lib559-lib558.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lib558.c' object='lib559-lib558.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib559_CFLAGS) $(CFLAGS) -c -o lib559-lib558.obj `if test -f 'lib558.c'; then $(CYGPATH_W) 'lib558.c'; else $(CYGPATH_W) '$(srcdir)/lib558.c'; fi`
+
+lib559-first.o: first.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib559_CFLAGS) $(CFLAGS) -MT lib559-first.o -MD -MP -MF "$(DEPDIR)/lib559-first.Tpo" -c -o lib559-first.o `test -f 'first.c' || echo '$(srcdir)/'`first.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib559-first.Tpo" "$(DEPDIR)/lib559-first.Po"; else rm -f "$(DEPDIR)/lib559-first.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='first.c' object='lib559-first.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib559_CFLAGS) $(CFLAGS) -c -o lib559-first.o `test -f 'first.c' || echo '$(srcdir)/'`first.c
+
+lib559-first.obj: first.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib559_CFLAGS) $(CFLAGS) -MT lib559-first.obj -MD -MP -MF "$(DEPDIR)/lib559-first.Tpo" -c -o lib559-first.obj `if test -f 'first.c'; then $(CYGPATH_W) 'first.c'; else $(CYGPATH_W) '$(srcdir)/first.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib559-first.Tpo" "$(DEPDIR)/lib559-first.Po"; else rm -f "$(DEPDIR)/lib559-first.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='first.c' object='lib559-first.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib559_CFLAGS) $(CFLAGS) -c -o lib559-first.obj `if test -f 'first.c'; then $(CYGPATH_W) 'first.c'; else $(CYGPATH_W) '$(srcdir)/first.c'; fi`
+
+lib565-lib510.o: lib510.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib565_CFLAGS) $(CFLAGS) -MT lib565-lib510.o -MD -MP -MF "$(DEPDIR)/lib565-lib510.Tpo" -c -o lib565-lib510.o `test -f 'lib510.c' || echo '$(srcdir)/'`lib510.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib565-lib510.Tpo" "$(DEPDIR)/lib565-lib510.Po"; else rm -f "$(DEPDIR)/lib565-lib510.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lib510.c' object='lib565-lib510.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib565_CFLAGS) $(CFLAGS) -c -o lib565-lib510.o `test -f 'lib510.c' || echo '$(srcdir)/'`lib510.c
+
+lib565-lib510.obj: lib510.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib565_CFLAGS) $(CFLAGS) -MT lib565-lib510.obj -MD -MP -MF "$(DEPDIR)/lib565-lib510.Tpo" -c -o lib565-lib510.obj `if test -f 'lib510.c'; then $(CYGPATH_W) 'lib510.c'; else $(CYGPATH_W) '$(srcdir)/lib510.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib565-lib510.Tpo" "$(DEPDIR)/lib565-lib510.Po"; else rm -f "$(DEPDIR)/lib565-lib510.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lib510.c' object='lib565-lib510.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib565_CFLAGS) $(CFLAGS) -c -o lib565-lib510.obj `if test -f 'lib510.c'; then $(CYGPATH_W) 'lib510.c'; else $(CYGPATH_W) '$(srcdir)/lib510.c'; fi`
+
+lib565-first.o: first.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib565_CFLAGS) $(CFLAGS) -MT lib565-first.o -MD -MP -MF "$(DEPDIR)/lib565-first.Tpo" -c -o lib565-first.o `test -f 'first.c' || echo '$(srcdir)/'`first.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib565-first.Tpo" "$(DEPDIR)/lib565-first.Po"; else rm -f "$(DEPDIR)/lib565-first.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='first.c' object='lib565-first.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib565_CFLAGS) $(CFLAGS) -c -o lib565-first.o `test -f 'first.c' || echo '$(srcdir)/'`first.c
+
+lib565-first.obj: first.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib565_CFLAGS) $(CFLAGS) -MT lib565-first.obj -MD -MP -MF "$(DEPDIR)/lib565-first.Tpo" -c -o lib565-first.obj `if test -f 'first.c'; then $(CYGPATH_W) 'first.c'; else $(CYGPATH_W) '$(srcdir)/first.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib565-first.Tpo" "$(DEPDIR)/lib565-first.Po"; else rm -f "$(DEPDIR)/lib565-first.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='first.c' object='lib565-first.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib565_CFLAGS) $(CFLAGS) -c -o lib565-first.obj `if test -f 'first.c'; then $(CYGPATH_W) 'first.c'; else $(CYGPATH_W) '$(srcdir)/first.c'; fi`
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+ clean-noinstPROGRAMS mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstLTLIBRARIES clean-noinstPROGRAMS \
+ ctags distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-exec install-exec-am install-info \
+ install-info-am install-man install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/tests/libtest/Makefile.inc b/tests/libtest/Makefile.inc
new file mode 100644
index 000000000..a0f1c0ecb
--- /dev/null
+++ b/tests/libtest/Makefile.inc
@@ -0,0 +1,166 @@
+# files used only in some libcurl test programs
+TESTUTIL = testutil.c testutil.h
+
+# these files are used in every single test program below
+SUPPORTFILES = first.c test.h
+
+# These are all libcurl test programs
+noinst_PROGRAMS = lib500 lib501 lib502 lib503 lib504 lib505 lib506 \
+ lib507 lib508 lib510 lib511 lib512 lib513 lib514 lib515 lib516 \
+ lib517 lib518 lib519 lib520 lib521 lib523 lib524 lib525 lib526 lib527 \
+ lib574 lib575 lib576 lib577 lib578 lib579 \
+ lib529 lib530 lib532 lib533 lib536 lib537 lib540 lib541 lib542 lib543 \
+ lib544 lib545 lib547 lib548 lib549 lib552 lib553 lib554 lib555 lib556 \
+ lib539 lib557 lib558 lib559 lib560 lib562 lib564 lib565 lib566 lib567 \
+ lib568 lib569 lib570 lib571 lib572 lib573 chkhostname
+
+chkhostname_SOURCES = chkhostname.c $(top_srcdir)/lib/curl_gethostname.c
+chkhostname_LDADD = @CURL_NETWORK_LIBS@
+chkhostname_DEPENDENCIES =
+chkhostname_CFLAGS = $(AM_CFLAGS)
+
+lib500_SOURCES = lib500.c $(SUPPORTFILES)
+
+lib501_SOURCES = lib501.c $(SUPPORTFILES)
+
+lib502_SOURCES = lib502.c $(SUPPORTFILES) $(TESTUTIL)
+
+lib503_SOURCES = lib503.c $(SUPPORTFILES) $(TESTUTIL)
+
+lib504_SOURCES = lib504.c $(SUPPORTFILES) $(TESTUTIL)
+
+lib505_SOURCES = lib505.c $(SUPPORTFILES)
+
+lib506_SOURCES = lib506.c $(SUPPORTFILES)
+
+lib507_SOURCES = lib507.c $(SUPPORTFILES) $(TESTUTIL)
+
+lib508_SOURCES = lib508.c $(SUPPORTFILES)
+
+lib510_SOURCES = lib510.c $(SUPPORTFILES)
+
+lib511_SOURCES = lib511.c $(SUPPORTFILES)
+
+lib512_SOURCES = lib512.c $(SUPPORTFILES)
+
+lib513_SOURCES = lib513.c $(SUPPORTFILES)
+
+lib514_SOURCES = lib514.c $(SUPPORTFILES)
+
+lib515_SOURCES = lib515.c $(SUPPORTFILES)
+
+lib516_SOURCES = lib516.c $(SUPPORTFILES)
+
+lib517_SOURCES = lib517.c $(SUPPORTFILES)
+
+lib518_SOURCES = lib518.c $(SUPPORTFILES)
+
+lib519_SOURCES = lib519.c $(SUPPORTFILES)
+
+lib520_SOURCES = lib520.c $(SUPPORTFILES)
+
+lib521_SOURCES = lib521.c $(SUPPORTFILES)
+
+lib523_SOURCES = lib523.c $(SUPPORTFILES)
+
+lib524_SOURCES = lib524.c $(SUPPORTFILES)
+
+lib525_SOURCES = lib525.c $(SUPPORTFILES) $(TESTUTIL)
+
+lib526_SOURCES = lib526.c $(SUPPORTFILES) $(TESTUTIL)
+lib526_CFLAGS = -DLIB526
+
+lib527_SOURCES = lib526.c $(SUPPORTFILES) $(TESTUTIL)
+lib527_CFLAGS = -DLIB527
+
+lib529_SOURCES = lib525.c $(SUPPORTFILES) $(TESTUTIL)
+lib529_CFLAGS = -DLIB529
+
+lib530_SOURCES = lib530.c $(SUPPORTFILES) $(TESTUTIL)
+lib530_CFLAGS = -DLIB530
+
+lib532_SOURCES = lib526.c $(SUPPORTFILES) $(TESTUTIL)
+lib532_CFLAGS = -DLIB532
+
+lib533_SOURCES = lib533.c $(SUPPORTFILES) $(TESTUTIL)
+
+lib536_SOURCES = lib536.c $(SUPPORTFILES) $(TESTUTIL)
+
+lib537_SOURCES = lib537.c $(SUPPORTFILES)
+
+lib539_SOURCES = lib539.c $(SUPPORTFILES)
+
+lib540_SOURCES = lib540.c $(SUPPORTFILES)
+
+lib541_SOURCES = lib541.c $(SUPPORTFILES)
+
+lib542_SOURCES = lib542.c $(SUPPORTFILES)
+
+lib543_SOURCES = lib543.c $(SUPPORTFILES)
+
+lib544_SOURCES = lib544.c $(SUPPORTFILES)
+
+lib545_SOURCES = lib544.c $(SUPPORTFILES)
+lib545_CFLAGS = -DLIB545
+
+lib547_SOURCES = lib547.c $(SUPPORTFILES)
+
+lib548_SOURCES = lib547.c $(SUPPORTFILES)
+lib548_CFLAGS = -DLIB548
+
+lib549_SOURCES = lib549.c $(SUPPORTFILES)
+
+lib555_SOURCES = lib555.c $(SUPPORTFILES) $(TESTUTIL)
+
+lib552_SOURCES = lib552.c $(SUPPORTFILES)
+
+lib553_SOURCES = lib553.c $(SUPPORTFILES)
+
+lib554_SOURCES = lib554.c $(SUPPORTFILES)
+
+lib556_SOURCES = lib556.c $(SUPPORTFILES)
+
+lib557_SOURCES = lib557.c $(SUPPORTFILES)
+
+lib558_SOURCES = lib558.c $(SUPPORTFILES)
+lib558_CFLAGS = -DLIB558
+
+lib559_SOURCES = lib558.c $(SUPPORTFILES)
+lib559_CFLAGS = -DLIB559
+
+lib560_SOURCES = lib560.c $(SUPPORTFILES)
+
+lib574_SOURCES = lib574.c $(SUPPORTFILES)
+
+lib575_SOURCES = lib575.c $(SUPPORTFILES)
+
+lib576_SOURCES = lib576.c $(SUPPORTFILES)
+
+lib577_SOURCES = lib577.c $(SUPPORTFILES)
+
+lib562_SOURCES = lib562.c $(SUPPORTFILES)
+
+lib564_SOURCES = lib564.c $(SUPPORTFILES) $(TESTUTIL)
+
+lib565_SOURCES = lib510.c $(SUPPORTFILES)
+lib565_CFLAGS = -DLIB565
+
+lib566_SOURCES = lib566.c $(SUPPORTFILES)
+
+lib567_SOURCES = lib567.c $(SUPPORTFILES)
+
+lib568_SOURCES = lib568.c $(SUPPORTFILES)
+
+lib569_SOURCES = lib569.c $(SUPPORTFILES)
+
+lib570_SOURCES = lib570.c $(SUPPORTFILES)
+
+lib571_SOURCES = lib571.c $(SUPPORTFILES)
+
+lib572_SOURCES = lib572.c $(SUPPORTFILES)
+
+lib573_SOURCES = lib573.c $(SUPPORTFILES) $(TESTUTIL)
+
+lib578_SOURCES = lib578.c $(SUPPORTFILES)
+
+lib579_SOURCES = lib579.c $(SUPPORTFILES)
diff --git a/tests/libtest/chkhostname.c b/tests/libtest/chkhostname.c
new file mode 100644
index 000000000..72c8b6a1f
--- /dev/null
+++ b/tests/libtest/chkhostname.c
@@ -0,0 +1,26 @@
+#include "setup.h"
+
+#include "curl_gethostname.h"
+
+#define HOSTNAME_MAX 1024
+
+int main(int argc, char *argv[])
+{
+ char buff[HOSTNAME_MAX];
+ if (argc != 2) {
+ printf("Usage: %s EXPECTED_HOSTNAME\n", argv[0]);
+ return 1;
+ }
+
+ if (Curl_gethostname(buff, HOSTNAME_MAX)) {
+ printf("Curl_gethostname() failed\n");
+ return 1;
+ }
+
+ /* compare the name returned by Curl_gethostname() with the expected one */
+ if(strncmp(buff, argv[1], HOSTNAME_MAX)) {
+ printf("got unexpected host name back, LD_PRELOAD failed\n");
+ return 1;
+ }
+ return 0;
+}
diff --git a/tests/libtest/first.c b/tests/libtest/first.c
new file mode 100644
index 000000000..a0e713f48
--- /dev/null
+++ b/tests/libtest/first.c
@@ -0,0 +1,98 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#ifdef HAVE_LOCALE_H
+#include <locale.h> /* for setlocale() */
+#endif
+
+#ifdef CURLDEBUG
+# define MEMDEBUG_NODEFINES
+# include "memdebug.h"
+#endif
+
+int select_test (int num_fds, fd_set *rd, fd_set *wr, fd_set *exc,
+ struct timeval *tv)
+{
+#ifdef USE_WINSOCK
+ /* Winsock doesn't like no socket set in 'rd', 'wr' or 'exc'. This is
+ * case when 'num_fds <= 0. So sleep.
+ */
+ if (num_fds <= 0) {
+ Sleep(1000*tv->tv_sec + tv->tv_usec/1000);
+ return 0;
+ }
+#endif
+ return select(num_fds, rd, wr, exc, tv);
+}
+
+char *libtest_arg2=NULL;
+char *libtest_arg3=NULL;
+int test_argc;
+char **test_argv;
+
+
+int main(int argc, char **argv)
+{
+ char *URL;
+
+#ifdef CURLDEBUG
+ /* this sends all memory debug messages to a logfile named memdump */
+ char *env = curl_getenv("CURL_MEMDEBUG");
+ if(env) {
+ /* use the value as file name */
+ char *s = strdup(env);
+ curl_free(env);
+ curl_memdebug(s);
+ free(s);
+ /* this weird strdup() and stuff here is to make the curl_free() get
+ called before the memdebug() as otherwise the memdebug tracing will
+ with tracing a free() without an alloc! */
+ }
+ /* this enables the fail-on-alloc-number-N functionality */
+ env = curl_getenv("CURL_MEMLIMIT");
+ if(env) {
+ char *endptr;
+ long num = strtol(env, &endptr, 10);
+ if((endptr != env) && (endptr == env + strlen(env)) && (num > 0))
+ curl_memlimit(num);
+ curl_free(env);
+ }
+#endif
+
+ /*
+ * Setup proper locale from environment. This is needed to enable locale-
+ * specific behaviour by the C library in order to test for undesired side
+ * effects that could cause in libcurl.
+ */
+#ifdef HAVE_SETLOCALE
+ setlocale(LC_ALL, "");
+#endif
+
+ if(argc< 2 ) {
+ fprintf(stderr, "Pass URL as argument please\n");
+ return 1;
+ }
+
+ test_argc = argc;
+ test_argv = argv;
+
+ if(argc>2)
+ libtest_arg2=argv[2];
+
+ if(argc>3)
+ libtest_arg3=argv[3];
+
+ URL = argv[1]; /* provide this to the rest */
+
+ fprintf(stderr, "URL: %s\n", URL);
+
+ return test(URL);
+}
diff --git a/tests/libtest/lib500.c b/tests/libtest/lib500.c
new file mode 100644
index 000000000..dc6967cbe
--- /dev/null
+++ b/tests/libtest/lib500.c
@@ -0,0 +1,53 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#include "memdebug.h"
+
+int test(char *URL)
+{
+ CURLcode res;
+ CURL *curl;
+ char *ipstr=NULL;
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ test_setopt(curl, CURLOPT_URL, URL);
+ test_setopt(curl, CURLOPT_HEADER, 1L);
+
+ res = curl_easy_perform(curl);
+
+ if(!res) {
+ FILE *moo;
+ res = curl_easy_getinfo(curl, CURLINFO_PRIMARY_IP, &ipstr);
+ moo = fopen(libtest_arg2, "wb");
+ if(moo) {
+ fprintf(moo, "IP: %s\n", ipstr);
+ fclose(moo);
+ }
+ }
+
+test_cleanup:
+
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return (int)res;
+}
+
diff --git a/tests/libtest/lib501.c b/tests/libtest/lib501.c
new file mode 100644
index 000000000..770cf8f74
--- /dev/null
+++ b/tests/libtest/lib501.c
@@ -0,0 +1,43 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#include "memdebug.h"
+
+int test(char *URL)
+{
+ CURLcode res;
+ CURL *curl;
+
+ (void)URL; /* we don't use this */
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ test_setopt(curl, CURLOPT_HEADER, 1L);
+
+ res = curl_easy_perform(curl);
+
+test_cleanup:
+
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return (int)res;
+}
+
diff --git a/tests/libtest/lib502.c b/tests/libtest/lib502.c
new file mode 100644
index 000000000..f6be5aaf7
--- /dev/null
+++ b/tests/libtest/lib502.c
@@ -0,0 +1,94 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#include "testutil.h"
+#include "memdebug.h"
+
+#define MAIN_LOOP_HANG_TIMEOUT 90 * 1000
+#define MULTI_PERFORM_HANG_TIMEOUT 60 * 1000
+
+/*
+ * Get a single URL without select().
+ */
+
+int test(char *URL)
+{
+ CURL *c;
+ CURLM *m = NULL;
+ int res = 0;
+ int running=1;
+ struct timeval mp_start;
+ char mp_timedout = FALSE;
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((c = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ test_setopt(c, CURLOPT_URL, URL);
+
+ if ((m = curl_multi_init()) == NULL) {
+ fprintf(stderr, "curl_multi_init() failed\n");
+ curl_easy_cleanup(c);
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((res = (int)curl_multi_add_handle(m, c)) != CURLM_OK) {
+ fprintf(stderr, "curl_multi_add_handle() failed, "
+ "with code %d\n", res);
+ curl_multi_cleanup(m);
+ curl_easy_cleanup(c);
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ mp_timedout = FALSE;
+ mp_start = tutil_tvnow();
+
+ while (running) {
+ res = (int)curl_multi_perform(m, &running);
+ if (tutil_tvdiff(tutil_tvnow(), mp_start) >
+ MULTI_PERFORM_HANG_TIMEOUT) {
+ mp_timedout = TRUE;
+ break;
+ }
+ if (running <= 0) {
+ fprintf(stderr, "nothing left running.\n");
+ break;
+ }
+ }
+
+ if (mp_timedout) {
+ if (mp_timedout) fprintf(stderr, "mp_timedout\n");
+ fprintf(stderr, "ABORTING TEST, since it seems "
+ "that it would have run forever.\n");
+ res = TEST_ERR_RUNS_FOREVER;
+ }
+
+test_cleanup:
+
+ if(m) {
+ curl_multi_remove_handle(m, c);
+ curl_multi_cleanup(m);
+ }
+ curl_easy_cleanup(c);
+ curl_global_cleanup();
+
+ return res;
+}
+
diff --git a/tests/libtest/lib503.c b/tests/libtest/lib503.c
new file mode 100644
index 000000000..2301186af
--- /dev/null
+++ b/tests/libtest/lib503.c
@@ -0,0 +1,152 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#include <sys/types.h>
+
+#include "testutil.h"
+#include "memdebug.h"
+
+#define MAIN_LOOP_HANG_TIMEOUT 90 * 1000
+#define MULTI_PERFORM_HANG_TIMEOUT 60 * 1000
+
+/*
+ * Source code in here hugely as reported in bug report 651460 by
+ * Christopher R. Palmer.
+ *
+ * Use multi interface to get HTTPS document over proxy, and provide
+ * auth info.
+ */
+
+int test(char *URL)
+{
+ CURL *c;
+ CURLM *m = NULL;
+ int res = 0;
+ int running;
+ char done = FALSE;
+ struct timeval ml_start;
+ struct timeval mp_start;
+ char ml_timedout = FALSE;
+ char mp_timedout = FALSE;
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((c = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ test_setopt(c, CURLOPT_PROXY, libtest_arg2); /* set in first.c */
+ test_setopt(c, CURLOPT_URL, URL);
+ test_setopt(c, CURLOPT_USERPWD, "test:ing");
+ test_setopt(c, CURLOPT_PROXYUSERPWD, "test:ing");
+ test_setopt(c, CURLOPT_HTTPPROXYTUNNEL, 1L);
+ test_setopt(c, CURLOPT_HEADER, 1L);
+
+ if ((m = curl_multi_init()) == NULL) {
+ fprintf(stderr, "curl_multi_init() failed\n");
+ curl_easy_cleanup(c);
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((res = (int)curl_multi_add_handle(m, c)) != CURLM_OK) {
+ fprintf(stderr, "curl_multi_add_handle() failed, "
+ "with code %d\n", res);
+ curl_multi_cleanup(m);
+ curl_easy_cleanup(c);
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ ml_timedout = FALSE;
+ ml_start = tutil_tvnow();
+
+ while(!done) {
+ fd_set rd, wr, exc;
+ int max_fd;
+ struct timeval interval;
+
+ interval.tv_sec = 1;
+ interval.tv_usec = 0;
+
+ if (tutil_tvdiff(tutil_tvnow(), ml_start) >
+ MAIN_LOOP_HANG_TIMEOUT) {
+ ml_timedout = TRUE;
+ break;
+ }
+ mp_timedout = FALSE;
+ mp_start = tutil_tvnow();
+
+ while (res == CURLM_CALL_MULTI_PERFORM) {
+ res = (int)curl_multi_perform(m, &running);
+ if (tutil_tvdiff(tutil_tvnow(), mp_start) >
+ MULTI_PERFORM_HANG_TIMEOUT) {
+ mp_timedout = TRUE;
+ break;
+ }
+ if (running <= 0) {
+ done = TRUE;
+ break;
+ }
+ }
+ if (mp_timedout || done)
+ break;
+
+ if (res != CURLM_OK) {
+ fprintf(stderr, "not okay???\n");
+ break;
+ }
+
+ FD_ZERO(&rd);
+ FD_ZERO(&wr);
+ FD_ZERO(&exc);
+ max_fd = 0;
+
+ if (curl_multi_fdset(m, &rd, &wr, &exc, &max_fd) != CURLM_OK) {
+ fprintf(stderr, "unexpected failured of fdset.\n");
+ res = 89;
+ break;
+ }
+
+ if (select_test(max_fd+1, &rd, &wr, &exc, &interval) == -1) {
+ fprintf(stderr, "bad select??\n");
+ res = 95;
+ break;
+ }
+
+ res = CURLM_CALL_MULTI_PERFORM;
+ }
+
+ if (ml_timedout || mp_timedout) {
+ if (ml_timedout) fprintf(stderr, "ml_timedout\n");
+ if (mp_timedout) fprintf(stderr, "mp_timedout\n");
+ fprintf(stderr, "ABORTING TEST, since it seems "
+ "that it would have run forever.\n");
+ res = TEST_ERR_RUNS_FOREVER;
+ }
+
+test_cleanup:
+
+ if(m) {
+ curl_multi_remove_handle(m, c);
+ curl_multi_cleanup(m);
+ }
+ curl_easy_cleanup(c);
+ curl_global_cleanup();
+
+ return res;
+}
+
diff --git a/tests/libtest/lib504.c b/tests/libtest/lib504.c
new file mode 100644
index 000000000..b8091f66a
--- /dev/null
+++ b/tests/libtest/lib504.c
@@ -0,0 +1,161 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#include <sys/types.h>
+
+#include "testutil.h"
+#include "memdebug.h"
+
+#define MAIN_LOOP_HANG_TIMEOUT 90 * 1000
+#define MULTI_PERFORM_HANG_TIMEOUT 60 * 1000
+
+/*
+ * Source code in here hugely as reported in bug report 651464 by
+ * Christopher R. Palmer.
+ *
+ * Use multi interface to get document over proxy with bad port number.
+ * This caused the interface to "hang" in libcurl 7.10.2.
+ */
+int test(char *URL)
+{
+ CURL *c;
+ int res = 0;
+ CURLM *m = NULL;
+ fd_set rd, wr, exc;
+ CURLMcode ret;
+ char done = FALSE;
+ int running;
+ int max_fd;
+ int rc;
+ struct timeval ml_start;
+ struct timeval mp_start;
+ char ml_timedout = FALSE;
+ char mp_timedout = FALSE;
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((c = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ /* The point here is that there must not be anything running on the given
+ proxy port */
+ if (libtest_arg2)
+ test_setopt(c, CURLOPT_PROXY, libtest_arg2);
+ test_setopt(c, CURLOPT_URL, URL);
+ test_setopt(c, CURLOPT_VERBOSE, 1L);
+
+ if ((m = curl_multi_init()) == NULL) {
+ fprintf(stderr, "curl_multi_init() failed\n");
+ curl_easy_cleanup(c);
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((ret = curl_multi_add_handle(m, c)) != CURLM_OK) {
+ fprintf(stderr, "curl_multi_add_handle() failed, "
+ "with code %d\n", ret);
+ curl_multi_cleanup(m);
+ curl_easy_cleanup(c);
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ ml_timedout = FALSE;
+ ml_start = tutil_tvnow();
+
+ while (!done) {
+ struct timeval interval;
+
+ interval.tv_sec = 1;
+ interval.tv_usec = 0;
+
+ if (tutil_tvdiff(tutil_tvnow(), ml_start) >
+ MAIN_LOOP_HANG_TIMEOUT) {
+ ml_timedout = TRUE;
+ break;
+ }
+ mp_timedout = FALSE;
+ mp_start = tutil_tvnow();
+
+ fprintf(stderr, "curl_multi_perform()\n");
+
+ ret = CURLM_CALL_MULTI_PERFORM;
+
+ while (ret == CURLM_CALL_MULTI_PERFORM) {
+ ret = curl_multi_perform(m, &running);
+ if (tutil_tvdiff(tutil_tvnow(), mp_start) >
+ MULTI_PERFORM_HANG_TIMEOUT) {
+ mp_timedout = TRUE;
+ break;
+ }
+ }
+ if (mp_timedout)
+ break;
+
+ if(!running) {
+ /* This is where this code is expected to reach */
+ int numleft;
+ CURLMsg *msg = curl_multi_info_read(m, &numleft);
+ fprintf(stderr, "Expected: not running\n");
+ if(msg && !numleft)
+ res = 100; /* this is where we should be */
+ else
+ res = 99; /* not correct */
+ break;
+ }
+ fprintf(stderr, "running == %d, ret == %d\n", running, ret);
+
+ if (ret != CURLM_OK) {
+ res = 2;
+ break;
+ }
+
+ FD_ZERO(&rd);
+ FD_ZERO(&wr);
+ FD_ZERO(&exc);
+ max_fd = 0;
+
+ fprintf(stderr, "curl_multi_fdset()\n");
+ if (curl_multi_fdset(m, &rd, &wr, &exc, &max_fd) != CURLM_OK) {
+ fprintf(stderr, "unexpected failured of fdset.\n");
+ res = 3;
+ break;
+ }
+ rc = select_test(max_fd+1, &rd, &wr, &exc, &interval);
+ fprintf(stderr, "select returned %d\n", rc);
+ }
+
+ if (ml_timedout || mp_timedout) {
+ if (ml_timedout) fprintf(stderr, "ml_timedout\n");
+ if (mp_timedout) fprintf(stderr, "mp_timedout\n");
+ fprintf(stderr, "ABORTING TEST, since it seems "
+ "that it would have run forever.\n");
+ res = TEST_ERR_RUNS_FOREVER;
+ }
+
+test_cleanup:
+
+ if(m) {
+ curl_multi_remove_handle(m, c);
+ curl_multi_cleanup(m);
+ }
+ curl_easy_cleanup(c);
+ curl_global_cleanup();
+
+ return res;
+}
+
diff --git a/tests/libtest/lib505.c b/tests/libtest/lib505.c
new file mode 100644
index 000000000..5af7ac0bb
--- /dev/null
+++ b/tests/libtest/lib505.c
@@ -0,0 +1,151 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#include "memdebug.h"
+
+/*
+ * This example shows an FTP upload, with a rename of the file just after
+ * a successful upload.
+ *
+ * Example based on source code provided by Erick Nuwendam. Thanks!
+ */
+
+int test(char *URL)
+{
+ CURL *curl;
+ CURLcode res = CURLE_OK;
+ FILE *hd_src ;
+ int hd ;
+ struct_stat file_info;
+ struct curl_slist *hl;
+ int error;
+
+ struct curl_slist *headerlist=NULL;
+ const char *buf_1 = "RNFR 505";
+ const char *buf_2 = "RNTO 505-forreal";
+
+ if (!libtest_arg2) {
+ fprintf(stderr, "Usage: <url> <file-to-upload>\n");
+ return -1;
+ }
+
+ hd_src = fopen(libtest_arg2, "rb");
+ if(NULL == hd_src) {
+ error = ERRNO;
+ fprintf(stderr, "fopen() failed with error: %d %s\n",
+ error, strerror(error));
+ fprintf(stderr, "Error opening file: %s\n", libtest_arg2);
+ return -2; /* if this happens things are major weird */
+ }
+
+ /* get the file size of the local file */
+ hd = fstat(fileno(hd_src), &file_info);
+ if(hd == -1) {
+ /* can't open file, bail out */
+ error = ERRNO;
+ fprintf(stderr, "fstat() failed with error: %d %s\n",
+ error, strerror(error));
+ fprintf(stderr, "ERROR: cannot open file %s\n", libtest_arg2);
+ fclose(hd_src);
+ return -1;
+ }
+
+ if(! file_info.st_size) {
+ fprintf(stderr, "ERROR: file %s has zero size!\n", libtest_arg2);
+ fclose(hd_src);
+ return -4;
+ }
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ fclose(hd_src);
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ /* get a curl handle */
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ fclose(hd_src);
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ /* build a list of commands to pass to libcurl */
+
+ if ((hl = curl_slist_append(headerlist, buf_1)) == NULL) {
+ fprintf(stderr, "curl_slist_append() failed\n");
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+ fclose(hd_src);
+ return TEST_ERR_MAJOR_BAD;
+ }
+ if ((headerlist = curl_slist_append(hl, buf_2)) == NULL) {
+ fprintf(stderr, "curl_slist_append() failed\n");
+ curl_slist_free_all(hl);
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+ fclose(hd_src);
+ return TEST_ERR_MAJOR_BAD;
+ }
+ headerlist = hl;
+
+ /* enable uploading */
+ test_setopt(curl, CURLOPT_UPLOAD, 1L);
+
+ /* enable verbose */
+ test_setopt(curl, CURLOPT_VERBOSE, 1L);
+
+ /* specify target */
+ test_setopt(curl,CURLOPT_URL, URL);
+
+ /* pass in that last of FTP commands to run after the transfer */
+ test_setopt(curl, CURLOPT_POSTQUOTE, headerlist);
+
+ /* now specify which file to upload */
+ test_setopt(curl, CURLOPT_INFILE, hd_src);
+
+ /* and give the size of the upload (optional) */
+ test_setopt(curl, CURLOPT_INFILESIZE_LARGE,
+ (curl_off_t)file_info.st_size);
+
+ /* Now run off and do what you've been told! */
+ res = curl_easy_perform(curl);
+
+test_cleanup:
+
+ /* clean up the FTP commands list */
+ curl_slist_free_all(headerlist);
+
+ /* close the local file */
+ fclose(hd_src);
+
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return res;
+}
diff --git a/tests/libtest/lib506.c b/tests/libtest/lib506.c
new file mode 100644
index 000000000..9209056dd
--- /dev/null
+++ b/tests/libtest/lib506.c
@@ -0,0 +1,268 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+#include <stdlib.h>
+#include <ctype.h>
+#include <errno.h>
+
+#include <curl/mprintf.h>
+
+#include "memdebug.h"
+
+static const char *HOSTHEADER = "Host: www.host.foo.com";
+static const char *JAR = "log/jar506";
+#define THREADS 2
+
+/* struct containing data of a thread */
+struct Tdata {
+ CURLSH *share;
+ char *url;
+};
+
+struct userdata {
+ char *text;
+ int counter;
+};
+
+/* lock callback */
+static void my_lock(CURL *handle, curl_lock_data data, curl_lock_access laccess,
+ void *useptr )
+{
+ const char *what;
+ struct userdata *user = (struct userdata *)useptr;
+
+ (void)handle;
+ (void)laccess;
+
+ switch ( data ) {
+ case CURL_LOCK_DATA_SHARE:
+ what = "share";
+ break;
+ case CURL_LOCK_DATA_DNS:
+ what = "dns";
+ break;
+ case CURL_LOCK_DATA_COOKIE:
+ what = "cookie";
+ break;
+ default:
+ fprintf(stderr, "lock: no such data: %d\n", (int)data);
+ return;
+ }
+ printf("lock: %-6s [%s]: %d\n", what, user->text, user->counter);
+ user->counter++;
+}
+
+/* unlock callback */
+static void my_unlock(CURL *handle, curl_lock_data data, void *useptr )
+{
+ const char *what;
+ struct userdata *user = (struct userdata *)useptr;
+ (void)handle;
+ switch ( data ) {
+ case CURL_LOCK_DATA_SHARE:
+ what = "share";
+ break;
+ case CURL_LOCK_DATA_DNS:
+ what = "dns";
+ break;
+ case CURL_LOCK_DATA_COOKIE:
+ what = "cookie";
+ break;
+ default:
+ fprintf(stderr, "unlock: no such data: %d\n", (int)data);
+ return;
+ }
+ printf("unlock: %-6s [%s]: %d\n", what, user->text, user->counter);
+ user->counter++;
+}
+
+
+/* build host entry */
+static struct curl_slist *sethost(struct curl_slist *headers)
+{
+ (void)headers;
+ return curl_slist_append(NULL, HOSTHEADER );
+}
+
+
+/* the dummy thread function */
+static void *fire(void *ptr)
+{
+ CURLcode code;
+ struct curl_slist *headers;
+ struct Tdata *tdata = (struct Tdata*)ptr;
+ CURL *curl;
+ int i=0;
+
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ return NULL;
+ }
+
+ headers = sethost(NULL);
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
+ curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
+ curl_easy_setopt(curl, CURLOPT_URL, tdata->url);
+ printf( "CURLOPT_SHARE\n" );
+ curl_easy_setopt(curl, CURLOPT_SHARE, tdata->share);
+
+ printf( "PERFORM\n" );
+ code = curl_easy_perform(curl);
+ if( code != CURLE_OK ) {
+ fprintf(stderr, "perform url '%s' repeat %d failed, curlcode %d\n",
+ tdata->url, i, (int)code);
+ }
+
+ printf( "CLEANUP\n" );
+ curl_easy_cleanup(curl);
+ curl_slist_free_all(headers);
+
+ return NULL;
+}
+
+
+/* build request url */
+static char *suburl(const char *base, int i)
+{
+ return curl_maprintf("%s%.4d", base, i);
+}
+
+
+/* test function */
+int test(char *URL)
+{
+ int res;
+ CURLSHcode scode = CURLSHE_OK;
+ char *url;
+ struct Tdata tdata;
+ CURL *curl;
+ CURLSH *share;
+ struct curl_slist *headers;
+ int i;
+ struct userdata user;
+
+ user.text = (char *)"Pigs in space";
+ user.counter = 0;
+
+ printf( "GLOBAL_INIT\n" );
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ /* prepare share */
+ printf( "SHARE_INIT\n" );
+ if ((share = curl_share_init()) == NULL) {
+ fprintf(stderr, "curl_share_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ( CURLSHE_OK == scode ) {
+ printf( "CURLSHOPT_LOCKFUNC\n" );
+ scode = curl_share_setopt( share, CURLSHOPT_LOCKFUNC, my_lock);
+ }
+ if ( CURLSHE_OK == scode ) {
+ printf( "CURLSHOPT_UNLOCKFUNC\n" );
+ scode = curl_share_setopt( share, CURLSHOPT_UNLOCKFUNC, my_unlock);
+ }
+ if ( CURLSHE_OK == scode ) {
+ printf( "CURLSHOPT_USERDATA\n" );
+ scode = curl_share_setopt( share, CURLSHOPT_USERDATA, &user);
+ }
+ if ( CURLSHE_OK == scode ) {
+ printf( "CURL_LOCK_DATA_COOKIE\n" );
+ scode = curl_share_setopt( share, CURLSHOPT_SHARE, CURL_LOCK_DATA_COOKIE);
+ }
+ if ( CURLSHE_OK == scode ) {
+ printf( "CURL_LOCK_DATA_DNS\n" );
+ scode = curl_share_setopt( share, CURLSHOPT_SHARE, CURL_LOCK_DATA_DNS);
+ }
+
+ if ( CURLSHE_OK != scode ) {
+ fprintf(stderr, "curl_share_setopt() failed\n");
+ curl_share_cleanup(share);
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+
+ res = 0;
+
+ /* start treads */
+ for (i=1; i<=THREADS; i++ ) {
+
+ /* set thread data */
+ tdata.url = suburl( URL, i ); /* must be curl_free()d */
+ tdata.share = share;
+
+ /* simulate thread, direct call of "thread" function */
+ printf( "*** run %d\n",i );
+ fire( &tdata );
+
+ curl_free( tdata.url );
+
+ }
+
+
+ /* fetch a another one and save cookies */
+ printf( "*** run %d\n", i );
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_share_cleanup(share);
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ url = suburl( URL, i );
+ headers = sethost( NULL );
+ test_setopt( curl, CURLOPT_HTTPHEADER, headers );
+ test_setopt( curl, CURLOPT_URL, url );
+ printf( "CURLOPT_SHARE\n" );
+ test_setopt( curl, CURLOPT_SHARE, share );
+ printf( "CURLOPT_COOKIEJAR\n" );
+ test_setopt( curl, CURLOPT_COOKIEJAR, JAR );
+
+ printf( "PERFORM\n" );
+ curl_easy_perform( curl );
+
+ /* try to free share, expect to fail because share is in use*/
+ printf( "try SHARE_CLEANUP...\n" );
+ scode = curl_share_cleanup( share );
+ if ( scode==CURLSHE_OK )
+ {
+ fprintf(stderr, "curl_share_cleanup succeed but error expected\n");
+ share = NULL;
+ } else {
+ printf( "SHARE_CLEANUP failed, correct\n" );
+ }
+
+test_cleanup:
+
+ /* clean up last handle */
+ printf( "CLEANUP\n" );
+ curl_easy_cleanup( curl );
+ curl_slist_free_all( headers );
+
+ curl_free(url);
+
+ /* free share */
+ printf( "SHARE_CLEANUP\n" );
+ scode = curl_share_cleanup( share );
+ if ( scode!=CURLSHE_OK )
+ fprintf(stderr, "curl_share_cleanup failed, code errno %d\n",
+ (int)scode);
+
+ printf( "GLOBAL_CLEANUP\n" );
+ curl_global_cleanup();
+
+ return res;
+}
+
diff --git a/tests/libtest/lib507.c b/tests/libtest/lib507.c
new file mode 100644
index 000000000..9707c9b07
--- /dev/null
+++ b/tests/libtest/lib507.c
@@ -0,0 +1,141 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#include "testutil.h"
+#include "memdebug.h"
+
+#define MAIN_LOOP_HANG_TIMEOUT 90 * 1000
+#define MULTI_PERFORM_HANG_TIMEOUT 60 * 1000
+
+int test(char *URL)
+{
+ CURL* curls;
+ CURLM* multi;
+ int still_running;
+ int i = -1;
+ int res = 0;
+ CURLMsg *msg;
+ CURLMcode ret;
+ struct timeval ml_start;
+ struct timeval mp_start;
+ char ml_timedout = FALSE;
+ char mp_timedout = FALSE;
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((multi = curl_multi_init()) == NULL) {
+ fprintf(stderr, "curl_multi_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((curls = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_multi_cleanup(multi);
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ test_setopt(curls, CURLOPT_URL, URL);
+
+ if ((ret = curl_multi_add_handle(multi, curls)) != CURLM_OK) {
+ fprintf(stderr, "curl_multi_add_handle() failed, "
+ "with code %d\n", ret);
+ curl_easy_cleanup(curls);
+ curl_multi_cleanup(multi);
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ mp_timedout = FALSE;
+ mp_start = tutil_tvnow();
+
+ do {
+ ret = curl_multi_perform(multi, &still_running);
+ if (tutil_tvdiff(tutil_tvnow(), mp_start) >
+ MULTI_PERFORM_HANG_TIMEOUT) {
+ mp_timedout = TRUE;
+ break;
+ }
+ } while (ret == CURLM_CALL_MULTI_PERFORM);
+
+ ml_timedout = FALSE;
+ ml_start = tutil_tvnow();
+
+ while ((!ml_timedout) && (!mp_timedout) && (still_running)) {
+ struct timeval timeout;
+ int rc;
+ fd_set fdread;
+ fd_set fdwrite;
+ fd_set fdexcep;
+ int maxfd;
+
+ FD_ZERO(&fdread);
+ FD_ZERO(&fdwrite);
+ FD_ZERO(&fdexcep);
+ timeout.tv_sec = 1;
+ timeout.tv_usec = 0;
+
+ if (tutil_tvdiff(tutil_tvnow(), ml_start) >
+ MAIN_LOOP_HANG_TIMEOUT) {
+ ml_timedout = TRUE;
+ break;
+ }
+
+ curl_multi_fdset(multi, &fdread, &fdwrite, &fdexcep, &maxfd);
+ rc = select_test(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
+ switch(rc) {
+ case -1:
+ break;
+ case 0:
+ default:
+ mp_timedout = FALSE;
+ mp_start = tutil_tvnow();
+ do {
+ ret = curl_multi_perform(multi, &still_running);
+ if (tutil_tvdiff(tutil_tvnow(), mp_start) >
+ MULTI_PERFORM_HANG_TIMEOUT) {
+ mp_timedout = TRUE;
+ break;
+ }
+ } while (ret == CURLM_CALL_MULTI_PERFORM);
+ break;
+ }
+ }
+ if (ml_timedout || mp_timedout) {
+ if (ml_timedout) fprintf(stderr, "ml_timedout\n");
+ if (mp_timedout) fprintf(stderr, "mp_timedout\n");
+ fprintf(stderr, "ABORTING TEST, since it seems "
+ "that it would have run forever.\n");
+ i = TEST_ERR_RUNS_FOREVER;
+ }
+ else {
+ msg = curl_multi_info_read(multi, &still_running);
+ if(msg)
+ /* this should now contain a result code from the easy handle,
+ get it */
+ i = msg->data.result;
+ }
+
+test_cleanup:
+
+ curl_multi_cleanup(multi);
+ curl_easy_cleanup(curls);
+ curl_global_cleanup();
+
+ if(res)
+ i = res;
+
+ return i; /* return the final return code */
+}
diff --git a/tests/libtest/lib508.c b/tests/libtest/lib508.c
new file mode 100644
index 000000000..0fa5eb9d2
--- /dev/null
+++ b/tests/libtest/lib508.c
@@ -0,0 +1,95 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#include "memdebug.h"
+
+static char data[]="this is what we post to the silly web server\n";
+
+struct WriteThis {
+ char *readptr;
+ size_t sizeleft;
+};
+
+static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *userp)
+{
+ struct WriteThis *pooh = (struct WriteThis *)userp;
+
+ if(size*nmemb < 1)
+ return 0;
+
+ if(pooh->sizeleft) {
+ *(char *)ptr = pooh->readptr[0]; /* copy one single byte */
+ pooh->readptr++; /* advance pointer */
+ pooh->sizeleft--; /* less data left */
+ return 1; /* we return 1 byte at a time! */
+ }
+
+ return 0; /* no more data left to deliver */
+}
+
+int test(char *URL)
+{
+ CURL *curl;
+ CURLcode res=CURLE_OK;
+
+ struct WriteThis pooh;
+
+ pooh.readptr = data;
+ pooh.sizeleft = strlen(data);
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ /* First set the URL that is about to receive our POST. */
+ test_setopt(curl, CURLOPT_URL, URL);
+
+ /* Now specify we want to POST data */
+ test_setopt(curl, CURLOPT_POST, 1L);
+
+#ifdef CURL_DOES_CONVERSIONS
+ /* Convert the POST data to ASCII */
+ test_setopt(curl, CURLOPT_TRANSFERTEXT, 1L);
+#endif
+
+ /* Set the expected POST size */
+ test_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)pooh.sizeleft);
+
+ /* we want to use our own read function */
+ test_setopt(curl, CURLOPT_READFUNCTION, read_callback);
+
+ /* pointer to pass to our read function */
+ test_setopt(curl, CURLOPT_INFILE, &pooh);
+
+ /* get verbose debug output please */
+ test_setopt(curl, CURLOPT_VERBOSE, 1L);
+
+ /* include headers in the output */
+ test_setopt(curl, CURLOPT_HEADER, 1L);
+
+ /* Perform the request, res will get the return code */
+ res = curl_easy_perform(curl);
+
+test_cleanup:
+
+ /* always cleanup */
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return res;
+}
diff --git a/tests/libtest/lib510.c b/tests/libtest/lib510.c
new file mode 100644
index 000000000..f3f8cdbc0
--- /dev/null
+++ b/tests/libtest/lib510.c
@@ -0,0 +1,118 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#include "memdebug.h"
+
+static const char *post[]={
+ "one",
+ "two",
+ "three",
+ "and a final longer crap: four",
+ NULL
+};
+
+
+struct WriteThis {
+ int counter;
+};
+
+static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *userp)
+{
+ struct WriteThis *pooh = (struct WriteThis *)userp;
+ const char *data;
+
+ if(size*nmemb < 1)
+ return 0;
+
+ data = post[pooh->counter];
+
+ if(data) {
+ size_t len = strlen(data);
+ memcpy(ptr, data, len);
+ pooh->counter++; /* advance pointer */
+ return len;
+ }
+ return 0; /* no more data left to deliver */
+}
+
+int test(char *URL)
+{
+ CURL *curl;
+ CURLcode res=CURLE_OK;
+ struct curl_slist *slist = NULL;
+ struct WriteThis pooh;
+ pooh.counter = 0;
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ slist = curl_slist_append(slist, "Transfer-Encoding: chunked");
+ if (slist == NULL) {
+ fprintf(stderr, "curl_slist_append() failed\n");
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ /* First set the URL that is about to receive our POST. */
+ test_setopt(curl, CURLOPT_URL, URL);
+
+ /* Now specify we want to POST data */
+ test_setopt(curl, CURLOPT_POST, 1L);
+
+#ifdef CURL_DOES_CONVERSIONS
+ /* Convert the POST data to ASCII */
+ test_setopt(curl, CURLOPT_TRANSFERTEXT, 1L);
+#endif
+
+ /* we want to use our own read function */
+ test_setopt(curl, CURLOPT_READFUNCTION, read_callback);
+
+ /* pointer to pass to our read function */
+ test_setopt(curl, CURLOPT_INFILE, &pooh);
+
+ /* get verbose debug output please */
+ test_setopt(curl, CURLOPT_VERBOSE, 1L);
+
+ /* include headers in the output */
+ test_setopt(curl, CURLOPT_HEADER, 1L);
+
+ /* enforce chunked transfer by setting the header */
+ test_setopt(curl, CURLOPT_HTTPHEADER, slist);
+
+#ifdef LIB565
+ test_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
+ test_setopt(curl, CURLOPT_USERPWD, "foo:bar");
+#endif
+
+ /* Perform the request, res will get the return code */
+ res = curl_easy_perform(curl);
+
+test_cleanup:
+
+ /* clean up the headers list */
+ if(slist)
+ curl_slist_free_all(slist);
+
+ /* always cleanup */
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return res;
+}
diff --git a/tests/libtest/lib511.c b/tests/libtest/lib511.c
new file mode 100644
index 000000000..dea97c5e2
--- /dev/null
+++ b/tests/libtest/lib511.c
@@ -0,0 +1,43 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#include "memdebug.h"
+
+int test(char *URL)
+{
+ CURLcode res;
+ CURL *curl;
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ test_setopt(curl, CURLOPT_URL, URL);
+ test_setopt(curl, CURLOPT_FILETIME, 1L);
+ test_setopt(curl, CURLOPT_NOBODY, 1L);
+ test_setopt(curl, CURLOPT_VERBOSE, 1L);
+
+ res = curl_easy_perform(curl);
+
+test_cleanup:
+
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return (int)res;
+}
diff --git a/tests/libtest/lib512.c b/tests/libtest/lib512.c
new file mode 100644
index 000000000..9f59f7baf
--- /dev/null
+++ b/tests/libtest/lib512.c
@@ -0,0 +1,65 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#include "memdebug.h"
+
+/* Test case code based on source in a bug report filed by James Bursa on
+ 28 Apr 2004 */
+
+int test(char *URL)
+{
+ CURLcode code;
+ CURL *curl;
+ CURL *curl2;
+ int rc = 99;
+
+ code = curl_global_init(CURL_GLOBAL_ALL);
+ if(code == CURLE_OK) {
+
+ curl = curl_easy_init();
+ if(curl) {
+
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
+ curl_easy_setopt(curl, CURLOPT_HEADER, 1L);
+
+ curl2 = curl_easy_duphandle(curl);
+ if(curl2) {
+
+ code = curl_easy_setopt(curl2, CURLOPT_URL, URL);
+ if(code == CURLE_OK) {
+
+ code = curl_easy_perform(curl2);
+ if(code == CURLE_OK)
+ rc = 0;
+ else
+ rc = 1;
+ }
+ else
+ rc = 2;
+
+ curl_easy_cleanup(curl2);
+ }
+ else
+ rc = 3;
+
+ curl_easy_cleanup(curl);
+ }
+ else
+ rc = 4;
+
+ curl_global_cleanup();
+ }
+ else
+ rc = 5;
+
+ return rc;
+}
+
diff --git a/tests/libtest/lib513.c b/tests/libtest/lib513.c
new file mode 100644
index 000000000..c85006e1d
--- /dev/null
+++ b/tests/libtest/lib513.c
@@ -0,0 +1,70 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#include "memdebug.h"
+
+static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *userp)
+{
+ (void)ptr;
+ (void)size;
+ (void)nmemb;
+ (void)userp;
+ return CURL_READFUNC_ABORT;
+}
+
+int test(char *URL)
+{
+ CURL *curl;
+ CURLcode res=CURLE_OK;
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ /* First set the URL that is about to receive our POST. */
+ test_setopt(curl, CURLOPT_URL, URL);
+
+ /* Now specify we want to POST data */
+ test_setopt(curl, CURLOPT_POST, 1L);
+
+ /* Set the expected POST size */
+ test_setopt(curl, CURLOPT_POSTFIELDSIZE, 1L);
+
+ /* we want to use our own read function */
+ test_setopt(curl, CURLOPT_READFUNCTION, read_callback);
+
+ /* pointer to pass to our read function */
+ test_setopt(curl, CURLOPT_INFILE, NULL);
+
+ /* get verbose debug output please */
+ test_setopt(curl, CURLOPT_VERBOSE, 1L);
+
+ /* include headers in the output */
+ test_setopt(curl, CURLOPT_HEADER, 1L);
+
+ /* Perform the request, res will get the return code */
+ res = curl_easy_perform(curl);
+
+test_cleanup:
+
+ /* always cleanup */
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return (int)res;
+}
diff --git a/tests/libtest/lib514.c b/tests/libtest/lib514.c
new file mode 100644
index 000000000..283f89e4b
--- /dev/null
+++ b/tests/libtest/lib514.c
@@ -0,0 +1,66 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#include "memdebug.h"
+
+int test(char *URL)
+{
+ CURL *curl;
+ CURLcode res=CURLE_OK;
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ /* First set the URL that is about to receive our POST. */
+ test_setopt(curl, CURLOPT_URL, URL);
+
+ /* Based on a bug report by Niels van Tongeren on June 29, 2004:
+
+ A weird situation occurs when request 1 is a POST request and the request
+ 2 is a HEAD request. For the POST request we set the CURLOPT_POSTFIELDS,
+ CURLOPT_POSTFIELDSIZE and CURLOPT_POST options. For the HEAD request we
+ set the CURLOPT_NOBODY option to '1'.
+
+ */
+
+ test_setopt(curl, CURLOPT_POSTFIELDS, "moo");
+ test_setopt(curl, CURLOPT_POSTFIELDSIZE, 3L);
+ test_setopt(curl, CURLOPT_POST, 1L);
+
+ /* this is where transfer 1 would take place, but skip that and change
+ options right away instead */
+
+ test_setopt(curl, CURLOPT_NOBODY, 1L);
+
+ test_setopt(curl, CURLOPT_VERBOSE, 1L); /* show verbose for debug */
+ test_setopt(curl, CURLOPT_HEADER, 1L); /* include header */
+
+ /* Now, we should be making a fine HEAD request */
+
+ /* Perform the request 2, res will get the return code */
+ res = curl_easy_perform(curl);
+
+test_cleanup:
+
+ /* always cleanup */
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return (int)res;
+}
diff --git a/tests/libtest/lib515.c b/tests/libtest/lib515.c
new file mode 100644
index 000000000..2660ae369
--- /dev/null
+++ b/tests/libtest/lib515.c
@@ -0,0 +1,47 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#include "memdebug.h"
+
+int test(char *URL)
+{
+ CURL *curl;
+ CURLcode res=CURLE_OK;
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ /* First set the URL that is about to receive our POST. */
+ test_setopt(curl, CURLOPT_URL, URL);
+ test_setopt(curl, CURLOPT_POSTFIELDS, NULL);
+ test_setopt(curl, CURLOPT_POSTFIELDSIZE, 0L);
+ test_setopt(curl, CURLOPT_VERBOSE, 1L); /* show verbose for debug */
+ test_setopt(curl, CURLOPT_HEADER, 1L); /* include header */
+
+ /* Now, we should be making a zero byte POST request */
+ res = curl_easy_perform(curl);
+
+test_cleanup:
+
+ /* always cleanup */
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return (int)res;
+}
diff --git a/tests/libtest/lib516.c b/tests/libtest/lib516.c
new file mode 100644
index 000000000..b796dbbb7
--- /dev/null
+++ b/tests/libtest/lib516.c
@@ -0,0 +1,46 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#include "memdebug.h"
+
+int test(char *URL)
+{
+ CURL *curl;
+ CURLcode res=CURLE_OK;
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ /* First set the URL that is about to receive our POST. */
+ test_setopt(curl, CURLOPT_URL, URL);
+ test_setopt(curl, CURLOPT_HTTPPOST, NULL);
+ test_setopt(curl, CURLOPT_VERBOSE, 1L); /* show verbose for debug */
+ test_setopt(curl, CURLOPT_HEADER, 1L); /* include header */
+
+ /* Now, we should be making a zero byte POST request */
+ res = curl_easy_perform(curl);
+
+test_cleanup:
+
+ /* always cleanup */
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return (int)res;
+}
diff --git a/tests/libtest/lib517.c b/tests/libtest/lib517.c
new file mode 100644
index 000000000..38a65d30b
--- /dev/null
+++ b/tests/libtest/lib517.c
@@ -0,0 +1,116 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#include "memdebug.h"
+
+static const char *dates[]={
+ "Sun, 06 Nov 1994 08:49:37 GMT",
+ "Sunday, 06-Nov-94 08:49:37 GMT",
+ "Sun Nov 6 08:49:37 1994",
+ "06 Nov 1994 08:49:37 GMT",
+ "06-Nov-94 08:49:37 GMT",
+ "Nov 6 08:49:37 1994",
+ "06 Nov 1994 08:49:37",
+ "06-Nov-94 08:49:37",
+ "1994 Nov 6 08:49:37",
+ "GMT 08:49:37 06-Nov-94 Sunday",
+ "94 6 Nov 08:49:37",
+ "1994 Nov 6",
+ "06-Nov-94",
+ "Sun Nov 6 94",
+ "1994.Nov.6",
+ "Sun/Nov/6/94/GMT",
+ "Sun, 06 Nov 1994 08:49:37 CET",
+ "06 Nov 1994 08:49:37 EST",
+ "Sun, 12 Sep 2004 15:05:58 -0700",
+ "Sat, 11 Sep 2004 21:32:11 +0200",
+ "20040912 15:05:58 -0700",
+ "20040911 +0200",
+ "Thu, 01-Jan-1970 00:59:59 GMT",
+ "Thu, 01-Jan-1970 01:00:00 GMT",
+/* "2094 Nov 6", See ../data/test517 for details */
+ "Sat, 15-Apr-17 21:01:22 GMT",
+ "Thu, 19-Apr-2007 16:00:00 GMT",
+ "Wed, 25 Apr 2007 21:02:13 GMT",
+ "Thu, 19/Apr\\2007 16:00:00 GMT",
+ "Fri, 1 Jan 2010 01:01:50 GMT",
+ "Wednesday, 1-Jan-2003 00:00:00 GMT",
+ ", 1-Jan-2003 00:00:00 GMT",
+ " 1-Jan-2003 00:00:00 GMT",
+ "1-Jan-2003 00:00:00 GMT",
+ "Wed,18-Apr-07 22:50:12 GMT",
+ "WillyWonka , 18-Apr-07 22:50:12 GMT",
+ "WillyWonka , 18-Apr-07 22:50:12",
+ "WillyWonka , 18-apr-07 22:50:12",
+ "Mon, 18-Apr-1977 22:50:13 GMT",
+ "Mon, 18-Apr-77 22:50:13 GMT",
+ "\"Sat, 15-Apr-17\\\"21:01:22\\\"GMT\"",
+ "Partyday, 18- April-07 22:50:12",
+ "Partyday, 18 - Apri-07 22:50:12",
+ "Wednes, 1-Januar-2003 00:00:00 GMT",
+ "Sat, 15-Apr-17 21:01:22",
+ "Sat, 15-Apr-17 21:01:22 GMT-2",
+ "Sat, 15-Apr-17 21:01:22 GMT BLAH",
+ "Sat, 15-Apr-17 21:01:22 GMT-0400",
+ "Sat, 15-Apr-17 21:01:22 GMT-0400 (EDT)",
+ "Sat, 15-Apr-17 21:01:22 DST",
+ "Sat, 15-Apr-17 21:01:22 -0400",
+ "Sat, 15-Apr-17 21:01:22 (hello there)",
+ "Sat, 15-Apr-17 21:01:22 11:22:33",
+ "Sat, 15-Apr-17 ::00 21:01:22",
+ "Sat, 15-Apr-17 boink:z 21:01:22",
+ "Sat, 15-Apr-17 91:22:33 21:01:22",
+ "Thu Apr 18 22:50:12 2007 GMT",
+ "22:50:12 Thu Apr 18 2007 GMT",
+ "Thu 22:50:12 Apr 18 2007 GMT",
+ "Thu Apr 22:50:12 18 2007 GMT",
+ "Thu Apr 18 22:50:12 2007 GMT",
+ "Thu Apr 18 2007 22:50:12 GMT",
+ "Thu Apr 18 2007 GMT 22:50:12",
+ "Sat, 15-Apr-17 21:01:22 GMT",
+ "15-Sat, Apr-17 21:01:22 GMT",
+ "15-Sat, Apr 21:01:22 GMT 17",
+ "15-Sat, Apr 21:01:22 GMT 2017",
+ "15 Apr 21:01:22 2017",
+ "15 17 Apr 21:01:22",
+ "Apr 15 17 21:01:22",
+ "Apr 15 21:01:22 17",
+ "2017 April 15 21:01:22",
+ "15 April 2017 21:01:22",
+ "98 April 17 21:01:22",
+ "Thu, 012-Aug-2008 20:49:07 GMT",
+#if 0
+ /* leaving out these strings since they differ between 32 and 64 bit
+ archs and the test suite has no good way to support two different outputs
+ like that */
+ "Thu, 12-Aug-31841 20:49:07 GMT",
+ "Thu, 12-Aug-9999999999 20:49:07 GMT",
+#endif
+ "Thu, 999999999999-Aug-2007 20:49:07 GMT",
+ "Thu, 12-Aug-2007 20:61:99999999999 GMT",
+ "IAintNoDateFool",
+ "Thu Apr 18 22:50 2007 GMT", /* without seconds */
+
+ NULL
+};
+
+int test(char *URL)
+{
+ int i;
+
+ (void)URL; /* not used */
+
+ for(i=0; dates[i]; i++) {
+ printf("%d: %s => %ld\n", i, dates[i], (long)curl_getdate(dates[i], NULL));
+ }
+
+ return 0;
+}
diff --git a/tests/libtest/lib518.c b/tests/libtest/lib518.c
new file mode 100644
index 000000000..9e683d956
--- /dev/null
+++ b/tests/libtest/lib518.c
@@ -0,0 +1,509 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_RESOURCE_H
+#include <sys/resource.h>
+#endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include "memdebug.h"
+
+#ifndef FD_SETSIZE
+#error "this test requires FD_SETSIZE"
+#endif
+
+#define SAFETY_MARGIN (16)
+#define NUM_OPEN (FD_SETSIZE + 10)
+#define NUM_NEEDED (NUM_OPEN + SAFETY_MARGIN)
+
+#if defined(WIN32) || defined(_WIN32) || defined(MSDOS)
+#define DEV_NULL "NUL"
+#else
+#define DEV_NULL "/dev/null"
+#endif
+
+#if defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT)
+
+static int *fd = NULL;
+static struct rlimit num_open;
+static char msgbuff[256];
+
+static void store_errmsg(const char *msg, int err)
+{
+ if (!err)
+ sprintf(msgbuff, "%s", msg);
+ else
+ sprintf(msgbuff, "%s, errno %d, %s", msg, err, strerror(err));
+}
+
+static void close_file_descriptors(void)
+{
+ for (num_open.rlim_cur = 0;
+ num_open.rlim_cur < num_open.rlim_max;
+ num_open.rlim_cur++)
+ if (fd[num_open.rlim_cur] > 0)
+ close(fd[num_open.rlim_cur]);
+ free(fd);
+ fd = NULL;
+}
+
+static int fopen_works(void)
+{
+ FILE *fpa[3];
+ int i;
+ int ret = 1;
+
+ for (i = 0; i < 3; i++) {
+ fpa[i] = NULL;
+ }
+ for (i = 0; i < 3; i++) {
+ fpa[i] = fopen(DEV_NULL, "r");
+ if (fpa[i] == NULL) {
+ store_errmsg("fopen() failed", ERRNO);
+ fprintf(stderr, "%s\n", msgbuff);
+ ret = 0;
+ break;
+ }
+ }
+ for (i = 0; i < 3; i++) {
+ if (fpa[i] != NULL)
+ fclose(fpa[i]);
+ }
+ return ret;
+}
+
+static int rlimit(int keep_open)
+{
+ int nitems, i;
+ int *memchunk = NULL;
+ char *fmt;
+ struct rlimit rl;
+ char strbuff[256];
+ char strbuff1[81];
+ char strbuff2[81];
+ char fmt_u[] = "%u";
+ char fmt_lu[] = "%lu";
+#ifdef HAVE_LONGLONG
+ char fmt_llu[] = "%llu";
+
+ if (sizeof(rl.rlim_max) > sizeof(long))
+ fmt = fmt_llu;
+ else
+#endif
+ fmt = (sizeof(rl.rlim_max) < sizeof(long))?fmt_u:fmt_lu;
+
+ /* get initial open file limits */
+
+ if (getrlimit(RLIMIT_NOFILE, &rl) != 0) {
+ store_errmsg("getrlimit() failed", ERRNO);
+ fprintf(stderr, "%s\n", msgbuff);
+ return -1;
+ }
+
+ /* show initial open file limits */
+
+#ifdef RLIM_INFINITY
+ if (rl.rlim_cur == RLIM_INFINITY)
+ strcpy(strbuff, "INFINITY");
+ else
+#endif
+ sprintf(strbuff, fmt, rl.rlim_cur);
+ fprintf(stderr, "initial soft limit: %s\n", strbuff);
+
+#ifdef RLIM_INFINITY
+ if (rl.rlim_max == RLIM_INFINITY)
+ strcpy(strbuff, "INFINITY");
+ else
+#endif
+ sprintf(strbuff, fmt, rl.rlim_max);
+ fprintf(stderr, "initial hard limit: %s\n", strbuff);
+
+ /* show our constants */
+
+ fprintf(stderr, "test518 FD_SETSIZE: %d\n", FD_SETSIZE);
+ fprintf(stderr, "test518 NUM_OPEN : %d\n", NUM_OPEN);
+ fprintf(stderr, "test518 NUM_NEEDED: %d\n", NUM_NEEDED);
+
+ /*
+ * if soft limit and hard limit are different we ask the
+ * system to raise soft limit all the way up to the hard
+ * limit. Due to some other system limit the soft limit
+ * might not be raised up to the hard limit. So from this
+ * point the resulting soft limit is our limit. Trying to
+ * open more than soft limit file descriptors will fail.
+ */
+
+ if (rl.rlim_cur != rl.rlim_max) {
+
+#ifdef OPEN_MAX
+ if ((rl.rlim_cur > 0) &&
+ (rl.rlim_cur < OPEN_MAX)) {
+ fprintf(stderr, "raising soft limit up to OPEN_MAX\n");
+ rl.rlim_cur = OPEN_MAX;
+ if (setrlimit(RLIMIT_NOFILE, &rl) != 0) {
+ /* on failure don't abort just issue a warning */
+ store_errmsg("setrlimit() failed", ERRNO);
+ fprintf(stderr, "%s\n", msgbuff);
+ msgbuff[0] = '\0';
+ }
+ }
+#endif
+
+ fprintf(stderr, "raising soft limit up to hard limit\n");
+ rl.rlim_cur = rl.rlim_max;
+ if (setrlimit(RLIMIT_NOFILE, &rl) != 0) {
+ /* on failure don't abort just issue a warning */
+ store_errmsg("setrlimit() failed", ERRNO);
+ fprintf(stderr, "%s\n", msgbuff);
+ msgbuff[0] = '\0';
+ }
+
+ /* get current open file limits */
+
+ if (getrlimit(RLIMIT_NOFILE, &rl) != 0) {
+ store_errmsg("getrlimit() failed", ERRNO);
+ fprintf(stderr, "%s\n", msgbuff);
+ return -3;
+ }
+
+ /* show current open file limits */
+
+#ifdef RLIM_INFINITY
+ if (rl.rlim_cur == RLIM_INFINITY)
+ strcpy(strbuff, "INFINITY");
+ else
+#endif
+ sprintf(strbuff, fmt, rl.rlim_cur);
+ fprintf(stderr, "current soft limit: %s\n", strbuff);
+
+#ifdef RLIM_INFINITY
+ if (rl.rlim_max == RLIM_INFINITY)
+ strcpy(strbuff, "INFINITY");
+ else
+#endif
+ sprintf(strbuff, fmt, rl.rlim_max);
+ fprintf(stderr, "current hard limit: %s\n", strbuff);
+
+ } /* (rl.rlim_cur != rl.rlim_max) */
+
+ /*
+ * test 518 is all about testing libcurl functionality
+ * when more than FD_SETSIZE file descriptors are open.
+ * This means that if for any reason we are not able to
+ * open more than FD_SETSIZE file descriptors then test
+ * 518 should not be run.
+ */
+
+ /*
+ * verify that soft limit is higher than NUM_NEEDED,
+ * which is the number of file descriptors we would
+ * try to open plus SAFETY_MARGIN to not exhaust the
+ * file descriptor pool
+ */
+
+ num_open.rlim_cur = NUM_NEEDED;
+
+ if ((rl.rlim_cur > 0) &&
+#ifdef RLIM_INFINITY
+ (rl.rlim_cur != RLIM_INFINITY) &&
+#endif
+ (rl.rlim_cur <= num_open.rlim_cur)) {
+ sprintf(strbuff2, fmt, rl.rlim_cur);
+ sprintf(strbuff1, fmt, num_open.rlim_cur);
+ sprintf(strbuff, "fds needed %s > system limit %s",
+ strbuff1, strbuff2);
+ store_errmsg(strbuff, 0);
+ fprintf(stderr, "%s\n", msgbuff);
+ return -4;
+ }
+
+ /*
+ * reserve a chunk of memory before opening file descriptors to
+ * avoid a low memory condition once the file descriptors are
+ * open. System conditions that could make the test fail should
+ * be addressed in the precheck phase. This chunk of memory shall
+ * be always free()ed before exiting the rlimit() function so
+ * that it becomes available to the test.
+ */
+
+ for (nitems = i = 1; nitems <= i; i *= 2)
+ nitems = i;
+ if (nitems > 0x7fff)
+ nitems = 0x40000;
+ do {
+ num_open.rlim_max = sizeof(*memchunk) * (size_t)nitems;
+ sprintf(strbuff, fmt, num_open.rlim_max);
+ fprintf(stderr, "allocating memchunk %s byte array\n", strbuff);
+ memchunk = malloc(sizeof(*memchunk) * (size_t)nitems);
+ if (!memchunk) {
+ fprintf(stderr, "memchunk, malloc() failed\n");
+ nitems /= 2;
+ }
+ } while (nitems && !memchunk);
+ if (!memchunk) {
+ store_errmsg("memchunk, malloc() failed", ERRNO);
+ fprintf(stderr, "%s\n", msgbuff);
+ return -5;
+ }
+
+ /* initialize it to fight lazy allocation */
+
+ fprintf(stderr, "initializing memchunk array\n");
+
+ for (i = 0; i < nitems; i++)
+ memchunk[i] = -1;
+
+ /* set the number of file descriptors we will try to open */
+
+ num_open.rlim_max = NUM_OPEN;
+
+ /* verify that we won't overflow size_t in malloc() */
+
+ if ((size_t)(num_open.rlim_max) > ((size_t)-1) / sizeof(*fd)) {
+ sprintf(strbuff1, fmt, num_open.rlim_max);
+ sprintf(strbuff, "unable to allocate an array for %s "
+ "file descriptors, would overflow size_t", strbuff1);
+ store_errmsg(strbuff, 0);
+ fprintf(stderr, "%s\n", msgbuff);
+ free(memchunk);
+ return -6;
+ }
+
+ /* allocate array for file descriptors */
+
+ sprintf(strbuff, fmt, num_open.rlim_max);
+ fprintf(stderr, "allocating array for %s file descriptors\n", strbuff);
+
+ fd = malloc(sizeof(*fd) * (size_t)(num_open.rlim_max));
+ if (!fd) {
+ store_errmsg("fd, malloc() failed", ERRNO);
+ fprintf(stderr, "%s\n", msgbuff);
+ free(memchunk);
+ return -7;
+ }
+
+ /* initialize it to fight lazy allocation */
+
+ fprintf(stderr, "initializing fd array\n");
+
+ for (num_open.rlim_cur = 0;
+ num_open.rlim_cur < num_open.rlim_max;
+ num_open.rlim_cur++)
+ fd[num_open.rlim_cur] = -1;
+
+ sprintf(strbuff, fmt, num_open.rlim_max);
+ fprintf(stderr, "trying to open %s file descriptors\n", strbuff);
+
+ /* open a dummy descriptor */
+
+ fd[0] = open(DEV_NULL, O_RDONLY);
+ if (fd[0] < 0) {
+ sprintf(strbuff, "opening of %s failed", DEV_NULL);
+ store_errmsg(strbuff, ERRNO);
+ fprintf(stderr, "%s\n", msgbuff);
+ free(fd);
+ fd = NULL;
+ free(memchunk);
+ return -8;
+ }
+
+ /* create a bunch of file descriptors */
+
+ for (num_open.rlim_cur = 1;
+ num_open.rlim_cur < num_open.rlim_max;
+ num_open.rlim_cur++) {
+
+ fd[num_open.rlim_cur] = dup(fd[0]);
+
+ if (fd[num_open.rlim_cur] < 0) {
+
+ fd[num_open.rlim_cur] = -1;
+
+ sprintf(strbuff1, fmt, num_open.rlim_cur);
+ sprintf(strbuff, "dup() attempt %s failed", strbuff1);
+ fprintf(stderr, "%s\n", strbuff);
+
+ sprintf(strbuff1, fmt, num_open.rlim_cur);
+ sprintf(strbuff, "fds system limit seems close to %s", strbuff1);
+ fprintf(stderr, "%s\n", strbuff);
+
+ num_open.rlim_max = NUM_NEEDED;
+
+ sprintf(strbuff2, fmt, num_open.rlim_max);
+ sprintf(strbuff1, fmt, num_open.rlim_cur);
+ sprintf(strbuff, "fds needed %s > system limit %s",
+ strbuff2, strbuff1);
+ store_errmsg(strbuff, 0);
+ fprintf(stderr, "%s\n", msgbuff);
+
+ for (num_open.rlim_cur = 0;
+ fd[num_open.rlim_cur] >= 0;
+ num_open.rlim_cur++)
+ close(fd[num_open.rlim_cur]);
+ free(fd);
+ fd = NULL;
+ free(memchunk);
+ return -9;
+
+ }
+
+ }
+
+ sprintf(strbuff, fmt, num_open.rlim_max);
+ fprintf(stderr, "%s file descriptors open\n", strbuff);
+
+#if !defined(HAVE_POLL_FINE) && \
+ !defined(USE_WINSOCK) && \
+ !defined(TPF)
+
+ /*
+ * when using select() instead of poll() we cannot test
+ * libcurl functionality with a socket number equal or
+ * greater than FD_SETSIZE. In any case, macro VERIFY_SOCK
+ * in lib/select.c enforces this check and protects libcurl
+ * from a possible crash. The effect of this protection
+ * is that test 518 will always fail, since the actual
+ * call to select() never takes place. We skip test 518
+ * with an indication that select limit would be exceeded.
+ */
+
+ num_open.rlim_cur = FD_SETSIZE - SAFETY_MARGIN;
+ if (num_open.rlim_max > num_open.rlim_cur) {
+ sprintf(strbuff, "select limit is FD_SETSIZE %d", FD_SETSIZE);
+ store_errmsg(strbuff, 0);
+ fprintf(stderr, "%s\n", msgbuff);
+ close_file_descriptors();
+ free(memchunk);
+ return -10;
+ }
+
+ num_open.rlim_cur = FD_SETSIZE - SAFETY_MARGIN;
+ for (rl.rlim_cur = 0;
+ rl.rlim_cur < num_open.rlim_max;
+ rl.rlim_cur++) {
+ if ((fd[rl.rlim_cur] > 0) &&
+ ((unsigned int)fd[rl.rlim_cur] > num_open.rlim_cur)) {
+ sprintf(strbuff, "select limit is FD_SETSIZE %d", FD_SETSIZE);
+ store_errmsg(strbuff, 0);
+ fprintf(stderr, "%s\n", msgbuff);
+ close_file_descriptors();
+ free(memchunk);
+ return -11;
+ }
+ }
+
+#endif /* using a FD_SETSIZE bound select() */
+
+ /*
+ * Old or 'backwards compatible' implementations of stdio do not allow
+ * handling of streams with an underlying file descriptor number greater
+ * than 255, even when allowing high numbered file descriptors for sockets.
+ * At this point we have a big number of file descriptors which have been
+ * opened using dup(), so lets test the stdio implementation and discover
+ * if it is capable of fopen()ing some additional files.
+ */
+
+ if (!fopen_works()) {
+ sprintf(strbuff1, fmt, num_open.rlim_max);
+ sprintf(strbuff, "stdio fopen() fails with %s fds open()",
+ strbuff1);
+ fprintf(stderr, "%s\n", msgbuff);
+ sprintf(strbuff, "stdio fopen() fails with lots of fds open()");
+ store_errmsg(strbuff, 0);
+ close_file_descriptors();
+ free(memchunk);
+ return -12;
+ }
+
+ /* free the chunk of memory we were reserving so that it
+ becomes becomes available to the test */
+
+ free(memchunk);
+
+ /* close file descriptors unless instructed to keep them */
+
+ if (!keep_open) {
+ close_file_descriptors();
+ }
+
+ return 0;
+}
+
+int test(char *URL)
+{
+ CURLcode res;
+ CURL *curl;
+
+ if(!strcmp(URL, "check")) {
+ /* used by the test script to ask if we can run this test or not */
+ if(rlimit(FALSE)) {
+ fprintf(stdout, "rlimit problem: %s\n", msgbuff);
+ return 1;
+ }
+ return 0; /* sure, run this! */
+ }
+
+ if (rlimit(TRUE)) {
+ /* failure */
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ /* run the test with the bunch of open file descriptors
+ and close them all once the test is over */
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ close_file_descriptors();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ close_file_descriptors();
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ test_setopt(curl, CURLOPT_URL, URL);
+ test_setopt(curl, CURLOPT_HEADER, 1L);
+
+ res = curl_easy_perform(curl);
+
+test_cleanup:
+
+ close_file_descriptors();
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return (int)res;
+}
+
+#else /* defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT) */
+
+int test(char *URL)
+{
+ (void)URL;
+ printf("system lacks necessary system function(s)");
+ return 1; /* skip test */
+}
+
+#endif /* defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT) */
diff --git a/tests/libtest/lib519.c b/tests/libtest/lib519.c
new file mode 100644
index 000000000..f885c5de6
--- /dev/null
+++ b/tests/libtest/lib519.c
@@ -0,0 +1,50 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#include "memdebug.h"
+
+int test(char *URL)
+{
+ CURLcode res;
+ CURL *curl;
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ test_setopt(curl, CURLOPT_URL, URL);
+ test_setopt(curl, CURLOPT_USERPWD, "monster:underbed");
+ test_setopt(curl, CURLOPT_HEADER, 1L);
+ test_setopt(curl, CURLOPT_VERBOSE, 1L);
+
+ /* get first page */
+ res = curl_easy_perform(curl);
+
+ test_setopt(curl, CURLOPT_USERPWD, "anothermonster:inwardrobe");
+
+ /* get second page */
+ res = curl_easy_perform(curl);
+
+test_cleanup:
+
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return (int)res;
+}
+
diff --git a/tests/libtest/lib520.c b/tests/libtest/lib520.c
new file mode 100644
index 000000000..a0e124489
--- /dev/null
+++ b/tests/libtest/lib520.c
@@ -0,0 +1,42 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#include "memdebug.h"
+
+int test(char *URL)
+{
+ CURLcode res;
+ CURL *curl;
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ test_setopt(curl, CURLOPT_URL, URL);
+ test_setopt(curl, CURLOPT_FILETIME, 1L);
+ test_setopt(curl, CURLOPT_VERBOSE, 1L);
+
+ res = curl_easy_perform(curl);
+
+test_cleanup:
+
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return (int)res;
+}
diff --git a/tests/libtest/lib521.c b/tests/libtest/lib521.c
new file mode 100644
index 000000000..9e79cb41e
--- /dev/null
+++ b/tests/libtest/lib521.c
@@ -0,0 +1,44 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#include "memdebug.h"
+
+int test(char *URL)
+{
+ CURLcode res;
+ CURL *curl;
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ test_setopt(curl, CURLOPT_URL, URL);
+ test_setopt(curl, CURLOPT_PORT, strtol(libtest_arg2, NULL, 10));
+ test_setopt(curl, CURLOPT_USERPWD, "xxx:yyy");
+ test_setopt(curl, CURLOPT_VERBOSE, 1L);
+
+ res = curl_easy_perform(curl);
+
+test_cleanup:
+
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return (int)res;
+}
+
diff --git a/tests/libtest/lib523.c b/tests/libtest/lib523.c
new file mode 100644
index 000000000..a1ac4a4e9
--- /dev/null
+++ b/tests/libtest/lib523.c
@@ -0,0 +1,45 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#include "memdebug.h"
+
+int test(char *URL)
+{
+ CURLcode res;
+ CURL *curl;
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ test_setopt(curl, CURLOPT_PROXY, libtest_arg2);
+ test_setopt(curl, CURLOPT_URL, URL);
+ test_setopt(curl, CURLOPT_PORT, 19999L);
+ test_setopt(curl, CURLOPT_USERPWD, "xxx:yyy");
+ test_setopt(curl, CURLOPT_VERBOSE, 1L);
+
+ res = curl_easy_perform(curl);
+
+test_cleanup:
+
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return (int)res;
+}
+
diff --git a/tests/libtest/lib524.c b/tests/libtest/lib524.c
new file mode 100644
index 000000000..ee520628b
--- /dev/null
+++ b/tests/libtest/lib524.c
@@ -0,0 +1,43 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#include "memdebug.h"
+
+int test(char *URL)
+{
+ CURLcode res;
+ CURL *curl;
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ test_setopt(curl, CURLOPT_URL, URL);
+ test_setopt(curl, CURLOPT_UPLOAD, 1L);
+ test_setopt(curl, CURLOPT_VERBOSE, 1L);
+
+ res = curl_easy_perform(curl);
+
+test_cleanup:
+
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return (int)res;
+}
+
diff --git a/tests/libtest/lib525.c b/tests/libtest/lib525.c
new file mode 100644
index 000000000..ade637012
--- /dev/null
+++ b/tests/libtest/lib525.c
@@ -0,0 +1,211 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include "testutil.h"
+#include "memdebug.h"
+
+#define MAIN_LOOP_HANG_TIMEOUT 90 * 1000
+#define MULTI_PERFORM_HANG_TIMEOUT 60 * 1000
+
+int test(char *URL)
+{
+ int res = 0;
+ CURL *curl;
+ FILE *hd_src ;
+ int hd ;
+ int error;
+ struct_stat file_info;
+ int running;
+ char done=FALSE;
+ CURLM *m = NULL;
+ struct timeval ml_start;
+ struct timeval mp_start;
+ char ml_timedout = FALSE;
+ char mp_timedout = FALSE;
+
+ if (!libtest_arg2) {
+ fprintf(stderr, "Usage: lib525 [url] [uploadfile]\n");
+ return -1;
+ }
+
+ hd_src = fopen(libtest_arg2, "rb");
+ if(NULL == hd_src) {
+ error = ERRNO;
+ fprintf(stderr, "fopen() failed with error: %d %s\n",
+ error, strerror(error));
+ fprintf(stderr, "Error opening file: %s\n", libtest_arg2);
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ /* get the file size of the local file */
+ hd = fstat(fileno(hd_src), &file_info);
+ if(hd == -1) {
+ /* can't open file, bail out */
+ error = ERRNO;
+ fprintf(stderr, "fstat() failed with error: %d %s\n",
+ error, strerror(error));
+ fprintf(stderr, "ERROR: cannot open file %s\n", libtest_arg2);
+ fclose(hd_src);
+ return -1;
+ }
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ fclose(hd_src);
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ fclose(hd_src);
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ /* enable uploading */
+ test_setopt(curl, CURLOPT_UPLOAD, 1L);
+
+ /* specify target */
+ test_setopt(curl,CURLOPT_URL, URL);
+
+ /* go verbose */
+ test_setopt(curl, CURLOPT_VERBOSE, 1L);
+
+ /* use active FTP */
+ test_setopt(curl, CURLOPT_FTPPORT, "-");
+
+ /* now specify which file to upload */
+ test_setopt(curl, CURLOPT_READDATA, hd_src);
+
+ /* NOTE: if you want this code to work on Windows with libcurl as a DLL, you
+ MUST also provide a read callback with CURLOPT_READFUNCTION. Failing to
+ do so will give you a crash since a DLL may not use the variable's memory
+ when passed in to it from an app like this. */
+
+ /* Set the size of the file to upload (optional). If you give a *_LARGE
+ option you MUST make sure that the type of the passed-in argument is a
+ curl_off_t. If you use CURLOPT_INFILESIZE (without _LARGE) you must
+ make sure that to pass in a type 'long' argument. */
+ test_setopt(curl, CURLOPT_INFILESIZE_LARGE,
+ (curl_off_t)file_info.st_size);
+
+ if ((m = curl_multi_init()) == NULL) {
+ fprintf(stderr, "curl_multi_init() failed\n");
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+ fclose(hd_src);
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((res = (int)curl_multi_add_handle(m, curl)) != CURLM_OK) {
+ fprintf(stderr, "curl_multi_add_handle() failed, "
+ "with code %d\n", res);
+ curl_multi_cleanup(m);
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+ fclose(hd_src);
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ ml_timedout = FALSE;
+ ml_start = tutil_tvnow();
+
+ while (!done) {
+ fd_set rd, wr, exc;
+ int max_fd;
+ struct timeval interval;
+
+ interval.tv_sec = 1;
+ interval.tv_usec = 0;
+
+ if (tutil_tvdiff(tutil_tvnow(), ml_start) >
+ MAIN_LOOP_HANG_TIMEOUT) {
+ ml_timedout = TRUE;
+ break;
+ }
+ mp_timedout = FALSE;
+ mp_start = tutil_tvnow();
+
+ while (res == CURLM_CALL_MULTI_PERFORM) {
+ res = (int)curl_multi_perform(m, &running);
+ if (tutil_tvdiff(tutil_tvnow(), mp_start) >
+ MULTI_PERFORM_HANG_TIMEOUT) {
+ mp_timedout = TRUE;
+ break;
+ }
+ if (running <= 0) {
+ done = TRUE;
+ break;
+ }
+ }
+ if (mp_timedout || done)
+ break;
+
+ if (res != CURLM_OK) {
+ fprintf(stderr, "not okay???\n");
+ break;
+ }
+
+ FD_ZERO(&rd);
+ FD_ZERO(&wr);
+ FD_ZERO(&exc);
+ max_fd = 0;
+
+ if (curl_multi_fdset(m, &rd, &wr, &exc, &max_fd) != CURLM_OK) {
+ fprintf(stderr, "unexpected failured of fdset.\n");
+ res = 189;
+ break;
+ }
+
+ if (select_test(max_fd+1, &rd, &wr, &exc, &interval) == -1) {
+ fprintf(stderr, "bad select??\n");
+ res = 195;
+ break;
+ }
+
+ res = CURLM_CALL_MULTI_PERFORM;
+ }
+
+ if (ml_timedout || mp_timedout) {
+ if (ml_timedout) fprintf(stderr, "ml_timedout\n");
+ if (mp_timedout) fprintf(stderr, "mp_timedout\n");
+ fprintf(stderr, "ABORTING TEST, since it seems "
+ "that it would have run forever.\n");
+ res = TEST_ERR_RUNS_FOREVER;
+ }
+
+test_cleanup:
+
+#ifdef LIB529
+ /* test 529 */
+ if(m) {
+ curl_multi_remove_handle(m, curl);
+ curl_multi_cleanup(m);
+ }
+ curl_easy_cleanup(curl);
+#else
+ /* test 525 */
+ if(m)
+ curl_multi_remove_handle(m, curl);
+ curl_easy_cleanup(curl);
+ if(m)
+ curl_multi_cleanup(m);
+#endif
+
+ fclose(hd_src); /* close the local file */
+
+ curl_global_cleanup();
+ return res;
+}
diff --git a/tests/libtest/lib526.c b/tests/libtest/lib526.c
new file mode 100644
index 000000000..0418b6ba2
--- /dev/null
+++ b/tests/libtest/lib526.c
@@ -0,0 +1,236 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+/*
+ * This code sets up multiple easy handles that transfer a single file from
+ * the same URL, in a serial manner after each other. Due to the connection
+ * sharing within the multi handle all transfers are performed on the same
+ * persistent connection.
+ *
+ * This source code is used for lib526, lib527 and lib532 with only #ifdefs
+ * controlling the small differences.
+ *
+ * - lib526 closes all easy handles after
+ * they all have transfered the file over the single connection
+ * - lib527 closes each easy handle after each single transfer.
+ * - lib532 uses only a single easy handle that is removed, reset and then
+ * re-added for each transfer
+ *
+ * Test case 526, 527 and 532 use FTP, while test 528 uses the lib526 tool but
+ * with HTTP.
+ */
+
+#include "test.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include "testutil.h"
+#include "memdebug.h"
+
+#define MAIN_LOOP_HANG_TIMEOUT 90 * 1000
+#define MULTI_PERFORM_HANG_TIMEOUT 60 * 1000
+
+#define NUM_HANDLES 4
+
+int test(char *URL)
+{
+ int res = 0;
+ CURL *curl[NUM_HANDLES];
+ int running;
+ char done=FALSE;
+ CURLM *m = NULL;
+ int current=0;
+ int i, j;
+ struct timeval ml_start;
+ struct timeval mp_start;
+ char ml_timedout = FALSE;
+ char mp_timedout = FALSE;
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ /* get NUM_HANDLES easy handles */
+ for(i=0; i < NUM_HANDLES; i++) {
+ curl[i] = curl_easy_init();
+ if(!curl[i]) {
+ fprintf(stderr, "curl_easy_init() failed "
+ "on handle #%d\n", i);
+ for (j=i-1; j >= 0; j--) {
+ curl_easy_cleanup(curl[j]);
+ }
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD + i;
+ }
+ res = curl_easy_setopt(curl[i], CURLOPT_URL, URL);
+ if(res) {
+ fprintf(stderr, "curl_easy_setopt() failed "
+ "on handle #%d\n", i);
+ for (j=i; j >= 0; j--) {
+ curl_easy_cleanup(curl[j]);
+ }
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD + i;
+ }
+
+ /* go verbose */
+ res = curl_easy_setopt(curl[i], CURLOPT_VERBOSE, 1L);
+ if(res) {
+ fprintf(stderr, "curl_easy_setopt() failed "
+ "on handle #%d\n", i);
+ for (j=i; j >= 0; j--) {
+ curl_easy_cleanup(curl[j]);
+ }
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD + i;
+ }
+ }
+
+ if ((m = curl_multi_init()) == NULL) {
+ fprintf(stderr, "curl_multi_init() failed\n");
+ for(i=0; i < NUM_HANDLES; i++) {
+ curl_easy_cleanup(curl[i]);
+ }
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((res = (int)curl_multi_add_handle(m, curl[current])) != CURLM_OK) {
+ fprintf(stderr, "curl_multi_add_handle() failed, "
+ "with code %d\n", res);
+ curl_multi_cleanup(m);
+ for(i=0; i < NUM_HANDLES; i++) {
+ curl_easy_cleanup(curl[i]);
+ }
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ ml_timedout = FALSE;
+ ml_start = tutil_tvnow();
+
+ fprintf(stderr, "Start at URL 0\n");
+
+ while (!done) {
+ fd_set rd, wr, exc;
+ int max_fd;
+ struct timeval interval;
+
+ interval.tv_sec = 1;
+ interval.tv_usec = 0;
+
+ if (tutil_tvdiff(tutil_tvnow(), ml_start) >
+ MAIN_LOOP_HANG_TIMEOUT) {
+ ml_timedout = TRUE;
+ break;
+ }
+ mp_timedout = FALSE;
+ mp_start = tutil_tvnow();
+
+ while (res == CURLM_CALL_MULTI_PERFORM) {
+ res = (int)curl_multi_perform(m, &running);
+ if (tutil_tvdiff(tutil_tvnow(), mp_start) >
+ MULTI_PERFORM_HANG_TIMEOUT) {
+ mp_timedout = TRUE;
+ break;
+ }
+ if (running <= 0) {
+#ifdef LIB527
+ /* NOTE: this code does not remove the handle from the multi handle
+ here, which would be the nice, sane and documented way of working.
+ This however tests that the API survives this abuse gracefully. */
+ curl_easy_cleanup(curl[current]);
+#endif
+ if(++current < NUM_HANDLES) {
+ fprintf(stderr, "Advancing to URL %d\n", current);
+#ifdef LIB532
+ /* first remove the only handle we use */
+ curl_multi_remove_handle(m, curl[0]);
+
+ /* make us re-use the same handle all the time, and try resetting
+ the handle first too */
+ curl_easy_reset(curl[0]);
+ test_setopt(curl[0], CURLOPT_URL, URL);
+ test_setopt(curl[0], CURLOPT_VERBOSE, 1L);
+
+ /* re-add it */
+ res = (int)curl_multi_add_handle(m, curl[0]);
+#else
+ res = (int)curl_multi_add_handle(m, curl[current]);
+#endif
+ if(res) {
+ fprintf(stderr, "add handle failed: %d.\n", res);
+ res = 243;
+ break;
+ }
+ }
+ else
+ done = TRUE; /* bail out */
+ break;
+ }
+ }
+ if (mp_timedout || done)
+ break;
+
+ if (res != CURLM_OK) {
+ fprintf(stderr, "not okay???\n");
+ break;
+ }
+
+ FD_ZERO(&rd);
+ FD_ZERO(&wr);
+ FD_ZERO(&exc);
+ max_fd = 0;
+
+ if (curl_multi_fdset(m, &rd, &wr, &exc, &max_fd) != CURLM_OK) {
+ fprintf(stderr, "unexpected failured of fdset.\n");
+ res = 189;
+ break;
+ }
+
+ if (select_test(max_fd+1, &rd, &wr, &exc, &interval) == -1) {
+ fprintf(stderr, "bad select??\n");
+ res = 195;
+ break;
+ }
+
+ res = CURLM_CALL_MULTI_PERFORM;
+ }
+
+ if (ml_timedout || mp_timedout) {
+ if (ml_timedout) fprintf(stderr, "ml_timedout\n");
+ if (mp_timedout) fprintf(stderr, "mp_timedout\n");
+ fprintf(stderr, "ABORTING TEST, since it seems "
+ "that it would have run forever.\n");
+ res = TEST_ERR_RUNS_FOREVER;
+ }
+
+#ifdef LIB532
+test_cleanup:
+#endif
+
+#ifndef LIB527
+ /* get NUM_HANDLES easy handles */
+ for(i=0; i < NUM_HANDLES; i++) {
+#ifdef LIB526
+ if(m)
+ curl_multi_remove_handle(m, curl[i]);
+#endif
+ curl_easy_cleanup(curl[i]);
+ }
+#endif
+ if(m)
+ curl_multi_cleanup(m);
+
+ curl_global_cleanup();
+ return res;
+}
diff --git a/tests/libtest/lib530.c b/tests/libtest/lib530.c
new file mode 100644
index 000000000..abefc92d3
--- /dev/null
+++ b/tests/libtest/lib530.c
@@ -0,0 +1,211 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include "testutil.h"
+#include "memdebug.h"
+
+#define MAIN_LOOP_HANG_TIMEOUT 90 * 1000
+#define MULTI_PERFORM_HANG_TIMEOUT 60 * 1000
+
+#define NUM_HANDLES 4
+
+int test(char *URL)
+{
+ int res = 0;
+ CURL *curl[NUM_HANDLES];
+ int running;
+ char done=FALSE;
+ CURLM *m;
+ int i, j;
+ struct timeval ml_start;
+ struct timeval mp_start;
+ char ml_timedout = FALSE;
+ char mp_timedout = FALSE;
+ char target_url[256];
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((m = curl_multi_init()) == NULL) {
+ fprintf(stderr, "curl_multi_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ /* get NUM_HANDLES easy handles */
+ for(i=0; i < NUM_HANDLES; i++) {
+ curl[i] = curl_easy_init();
+ if(!curl[i]) {
+ fprintf(stderr, "curl_easy_init() failed "
+ "on handle #%d\n", i);
+ for (j=i-1; j >= 0; j--) {
+ curl_multi_remove_handle(m, curl[j]);
+ curl_easy_cleanup(curl[j]);
+ }
+ curl_multi_cleanup(m);
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD + i;
+ }
+ sprintf(target_url, "%s%04i", URL, i + 1);
+ target_url[sizeof(target_url) - 1] = '\0';
+
+ res = curl_easy_setopt(curl[i], CURLOPT_URL, target_url);
+ if(res) {
+ fprintf(stderr, "curl_easy_setopt() failed "
+ "on handle #%d\n", i);
+ for (j=i; j >= 0; j--) {
+ curl_multi_remove_handle(m, curl[j]);
+ curl_easy_cleanup(curl[j]);
+ }
+ curl_multi_cleanup(m);
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD + i;
+ }
+
+ /* go verbose */
+ res = curl_easy_setopt(curl[i], CURLOPT_VERBOSE, 1L);
+ if(res) {
+ fprintf(stderr, "curl_easy_setopt() failed "
+ "on handle #%d\n", i);
+ for (j=i; j >= 0; j--) {
+ curl_multi_remove_handle(m, curl[j]);
+ curl_easy_cleanup(curl[j]);
+ }
+ curl_multi_cleanup(m);
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD + i;
+ }
+
+ /* include headers */
+ res = curl_easy_setopt(curl[i], CURLOPT_HEADER, 1L);
+ if(res) {
+ fprintf(stderr, "curl_easy_setopt() failed "
+ "on handle #%d\n", i);
+ for (j=i; j >= 0; j--) {
+ curl_multi_remove_handle(m, curl[j]);
+ curl_easy_cleanup(curl[j]);
+ }
+ curl_multi_cleanup(m);
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD + i;
+ }
+
+ /* add handle to multi */
+ if ((res = (int)curl_multi_add_handle(m, curl[i])) != CURLM_OK) {
+ fprintf(stderr, "curl_multi_add_handle() failed, "
+ "on handle #%d with code %d\n", i, res);
+ curl_easy_cleanup(curl[i]);
+ for (j=i-1; j >= 0; j--) {
+ curl_multi_remove_handle(m, curl[j]);
+ curl_easy_cleanup(curl[j]);
+ }
+ curl_multi_cleanup(m);
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD + i;
+ }
+ }
+
+ curl_multi_setopt(m, CURLMOPT_PIPELINING, 1L);
+
+ ml_timedout = FALSE;
+ ml_start = tutil_tvnow();
+
+ fprintf(stderr, "Start at URL 0\n");
+
+ while (!done) {
+ fd_set rd, wr, exc;
+ int max_fd;
+ struct timeval interval;
+
+ interval.tv_sec = 1;
+ interval.tv_usec = 0;
+
+ if (tutil_tvdiff(tutil_tvnow(), ml_start) >
+ MAIN_LOOP_HANG_TIMEOUT) {
+ ml_timedout = TRUE;
+ break;
+ }
+ mp_timedout = FALSE;
+ mp_start = tutil_tvnow();
+
+ while (res == CURLM_CALL_MULTI_PERFORM) {
+ res = (int)curl_multi_perform(m, &running);
+ if (tutil_tvdiff(tutil_tvnow(), mp_start) >
+ MULTI_PERFORM_HANG_TIMEOUT) {
+ mp_timedout = TRUE;
+ break;
+ }
+ if (running <= 0) {
+ done = TRUE; /* bail out */
+ break;
+ }
+ }
+ if (mp_timedout || done)
+ break;
+
+ if (res != CURLM_OK) {
+ fprintf(stderr, "not okay???\n");
+ break;
+ }
+
+ FD_ZERO(&rd);
+ FD_ZERO(&wr);
+ FD_ZERO(&exc);
+ max_fd = 0;
+
+ if (curl_multi_fdset(m, &rd, &wr, &exc, &max_fd) != CURLM_OK) {
+ fprintf(stderr, "unexpected failured of fdset.\n");
+ res = 189;
+ break;
+ }
+
+ if (select_test(max_fd+1, &rd, &wr, &exc, &interval) == -1) {
+ fprintf(stderr, "bad select??\n");
+ res = 195;
+ break;
+ }
+
+ res = CURLM_CALL_MULTI_PERFORM;
+ }
+
+ if (ml_timedout || mp_timedout) {
+ if (ml_timedout) fprintf(stderr, "ml_timedout\n");
+ if (mp_timedout) fprintf(stderr, "mp_timedout\n");
+ fprintf(stderr, "ABORTING TEST, since it seems "
+ "that it would have run forever.\n");
+ res = TEST_ERR_RUNS_FOREVER;
+ }
+
+/* test_cleanup: */
+
+ /* cleanup NUM_HANDLES easy handles */
+ for(i=0; i < NUM_HANDLES; i++) {
+ curl_multi_remove_handle(m, curl[i]);
+ curl_easy_cleanup(curl[i]);
+ }
+
+ curl_multi_cleanup(m);
+ curl_global_cleanup();
+
+ return res;
+}
diff --git a/tests/libtest/lib533.c b/tests/libtest/lib533.c
new file mode 100644
index 000000000..89ac7bf89
--- /dev/null
+++ b/tests/libtest/lib533.c
@@ -0,0 +1,166 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+/* used for test case 533, 534 and 535 */
+
+#include "test.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include "testutil.h"
+#include "memdebug.h"
+
+#define MAIN_LOOP_HANG_TIMEOUT 90 * 1000
+#define MULTI_PERFORM_HANG_TIMEOUT 60 * 1000
+
+int test(char *URL)
+{
+ int res = 0;
+ CURL *curl;
+ int running;
+ char done=FALSE;
+ CURLM *m = NULL;
+ int current=0;
+ struct timeval ml_start;
+ struct timeval mp_start;
+ char ml_timedout = FALSE;
+ char mp_timedout = FALSE;
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ test_setopt(curl, CURLOPT_URL, URL);
+ test_setopt(curl, CURLOPT_VERBOSE, 1);
+ test_setopt(curl, CURLOPT_FAILONERROR, 1);
+
+ if ((m = curl_multi_init()) == NULL) {
+ fprintf(stderr, "curl_multi_init() failed\n");
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((res = (int)curl_multi_add_handle(m, curl)) != CURLM_OK) {
+ fprintf(stderr, "curl_multi_add_handle() failed, "
+ "with code %d\n", res);
+ curl_multi_cleanup(m);
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ ml_timedout = FALSE;
+ ml_start = tutil_tvnow();
+
+ fprintf(stderr, "Start at URL 0\n");
+
+ while (!done) {
+ fd_set rd, wr, exc;
+ int max_fd;
+ struct timeval interval;
+
+ interval.tv_sec = 1;
+ interval.tv_usec = 0;
+
+ if (tutil_tvdiff(tutil_tvnow(), ml_start) >
+ MAIN_LOOP_HANG_TIMEOUT) {
+ ml_timedout = TRUE;
+ break;
+ }
+ mp_timedout = FALSE;
+ mp_start = tutil_tvnow();
+
+ while (res == CURLM_CALL_MULTI_PERFORM) {
+ res = (int)curl_multi_perform(m, &running);
+ if (tutil_tvdiff(tutil_tvnow(), mp_start) >
+ MULTI_PERFORM_HANG_TIMEOUT) {
+ mp_timedout = TRUE;
+ break;
+ }
+ if (running <= 0) {
+ if(!current++) {
+ fprintf(stderr, "Advancing to URL 1\n");
+ /* remove the handle we use */
+ curl_multi_remove_handle(m, curl);
+
+ /* make us re-use the same handle all the time, and try resetting
+ the handle first too */
+ curl_easy_reset(curl);
+ test_setopt(curl, CURLOPT_URL, libtest_arg2);
+ test_setopt(curl, CURLOPT_VERBOSE, 1);
+ test_setopt(curl, CURLOPT_FAILONERROR, 1);
+
+ /* re-add it */
+ res = (int)curl_multi_add_handle(m, curl);
+ if(res) {
+ fprintf(stderr, "add handle failed: %d.\n", res);
+ res = 243;
+ break;
+ }
+ }
+ else
+ done = TRUE; /* bail out */
+ break;
+ }
+ }
+ if (mp_timedout || done)
+ break;
+
+ if (res != CURLM_OK) {
+ fprintf(stderr, "not okay???\n");
+ break;
+ }
+
+ FD_ZERO(&rd);
+ FD_ZERO(&wr);
+ FD_ZERO(&exc);
+ max_fd = 0;
+
+ if (curl_multi_fdset(m, &rd, &wr, &exc, &max_fd) != CURLM_OK) {
+ fprintf(stderr, "unexpected failured of fdset.\n");
+ res = 189;
+ break;
+ }
+
+ if (select_test(max_fd+1, &rd, &wr, &exc, &interval) == -1) {
+ fprintf(stderr, "bad select??\n");
+ res = 195;
+ break;
+ }
+
+ res = CURLM_CALL_MULTI_PERFORM;
+ }
+
+ if (ml_timedout || mp_timedout) {
+ if (ml_timedout) fprintf(stderr, "ml_timedout\n");
+ if (mp_timedout) fprintf(stderr, "mp_timedout\n");
+ fprintf(stderr, "ABORTING TEST, since it seems "
+ "that it would have run forever.\n");
+ res = TEST_ERR_RUNS_FOREVER;
+ }
+
+test_cleanup:
+
+ curl_easy_cleanup(curl);
+ if(m)
+ curl_multi_cleanup(m);
+ curl_global_cleanup();
+
+ return res;
+}
diff --git a/tests/libtest/lib536.c b/tests/libtest/lib536.c
new file mode 100644
index 000000000..e0c19f661
--- /dev/null
+++ b/tests/libtest/lib536.c
@@ -0,0 +1,140 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include "testutil.h"
+#include "memdebug.h"
+
+#define MAIN_LOOP_HANG_TIMEOUT 90 * 1000
+#define MULTI_PERFORM_HANG_TIMEOUT 60 * 1000
+
+static CURLMcode perform(CURLM * multi)
+{
+ int handles;
+ CURLMcode code;
+ fd_set fdread, fdwrite, fdexcep;
+ struct timeval mp_start;
+ char mp_timedout = FALSE;
+
+ mp_timedout = FALSE;
+ mp_start = tutil_tvnow();
+
+ for (;;) {
+ static struct timeval timeout = /* 100 ms */ { 0, 100000L };
+ int maxfd = -1;
+
+ code = curl_multi_perform(multi, &handles);
+ if (tutil_tvdiff(tutil_tvnow(), mp_start) >
+ MULTI_PERFORM_HANG_TIMEOUT) {
+ mp_timedout = TRUE;
+ break;
+ }
+ if (handles <= 0)
+ return CURLM_OK;
+
+ switch (code) {
+ case CURLM_OK:
+ break;
+ case CURLM_CALL_MULTI_PERFORM:
+ continue;
+ default:
+ return code;
+ }
+
+ FD_ZERO(&fdread);
+ FD_ZERO(&fdwrite);
+ FD_ZERO(&fdexcep);
+ curl_multi_fdset(multi, &fdread, &fdwrite, &fdexcep, &maxfd);
+
+ /* In a real-world program you OF COURSE check the return code of the
+ function calls. On success, the value of maxfd is guaranteed to be
+ greater or equal than -1. We call select(maxfd + 1, ...), specially in
+ case of (maxfd == -1), we call select(0, ...), which is basically equal
+ to sleep. */
+
+ if (select(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout) == -1)
+ return (CURLMcode) ~CURLM_OK;
+ }
+
+ /* We only reach this point if (mp_timedout) */
+ if (mp_timedout) fprintf(stderr, "mp_timedout\n");
+ fprintf(stderr, "ABORTING TEST, since it seems "
+ "that it would have run forever.\n");
+ return (CURLMcode) ~CURLM_OK;
+}
+
+int test(char *URL)
+{
+ CURLM *multi;
+ CURL *easy;
+ int res = 0;
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((multi = curl_multi_init()) == NULL) {
+ fprintf(stderr, "curl_multi_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((easy = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_multi_cleanup(multi);
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ curl_multi_setopt(multi, CURLMOPT_PIPELINING, 1L);
+
+ test_setopt(easy, CURLOPT_WRITEFUNCTION, fwrite);
+ test_setopt(easy, CURLOPT_FAILONERROR, 1L);
+ test_setopt(easy, CURLOPT_URL, URL);
+
+ if (curl_multi_add_handle(multi, easy) != CURLM_OK) {
+ printf("curl_multi_add_handle() failed\n");
+ res = TEST_ERR_MAJOR_BAD;
+ } else {
+ if (perform(multi) != CURLM_OK)
+ printf("retrieve 1 failed\n");
+
+ curl_multi_remove_handle(multi, easy);
+ }
+ curl_easy_reset(easy);
+
+ test_setopt(easy, CURLOPT_FAILONERROR, 1L);
+ test_setopt(easy, CURLOPT_URL, libtest_arg2);
+
+ if (curl_multi_add_handle(multi, easy) != CURLM_OK) {
+ printf("curl_multi_add_handle() 2 failed\n");
+ res = TEST_ERR_MAJOR_BAD;
+ } else {
+ if (perform(multi) != CURLM_OK)
+ printf("retrieve 2 failed\n");
+
+ curl_multi_remove_handle(multi, easy);
+ }
+
+test_cleanup:
+
+ curl_easy_cleanup(easy);
+ curl_multi_cleanup(multi);
+ curl_global_cleanup();
+
+ printf("Finished!\n");
+
+ return res;
+}
diff --git a/tests/libtest/lib537.c b/tests/libtest/lib537.c
new file mode 100644
index 000000000..842dbab77
--- /dev/null
+++ b/tests/libtest/lib537.c
@@ -0,0 +1,512 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_RESOURCE_H
+#include <sys/resource.h>
+#endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include "memdebug.h"
+
+#if !defined(HAVE_POLL_FINE) && \
+ !defined(USE_WINSOCK) && \
+ !defined(TPF) && \
+ !defined(FD_SETSIZE)
+#error "this test requires FD_SETSIZE"
+#endif
+
+#define SAFETY_MARGIN (10)
+
+#if defined(WIN32) || defined(_WIN32) || defined(MSDOS)
+#define DEV_NULL "NUL"
+#else
+#define DEV_NULL "/dev/null"
+#endif
+
+#if defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT)
+
+static int *fd = NULL;
+static struct rlimit num_open;
+static char msgbuff[256];
+
+static void store_errmsg(const char *msg, int err)
+{
+ if (!err)
+ sprintf(msgbuff, "%s", msg);
+ else
+ sprintf(msgbuff, "%s, errno %d, %s", msg, err, strerror(err));
+}
+
+static void close_file_descriptors(void)
+{
+ for (num_open.rlim_cur = 0;
+ num_open.rlim_cur < num_open.rlim_max;
+ num_open.rlim_cur++)
+ if (fd[num_open.rlim_cur] > 0)
+ close(fd[num_open.rlim_cur]);
+ free(fd);
+ fd = NULL;
+}
+
+static int fopen_works(void)
+{
+ FILE *fpa[3];
+ int i;
+ int ret = 1;
+
+ for (i = 0; i < 3; i++) {
+ fpa[i] = NULL;
+ }
+ for (i = 0; i < 3; i++) {
+ fpa[i] = fopen(DEV_NULL, "r");
+ if (fpa[i] == NULL) {
+ store_errmsg("fopen() failed", ERRNO);
+ fprintf(stderr, "%s\n", msgbuff);
+ ret = 0;
+ break;
+ }
+ }
+ for (i = 0; i < 3; i++) {
+ if (fpa[i] != NULL)
+ fclose(fpa[i]);
+ }
+ return ret;
+}
+
+static int rlimit(int keep_open)
+{
+ int *tmpfd;
+ int nitems, i;
+ int *memchunk = NULL;
+ char *fmt;
+ struct rlimit rl;
+ char strbuff[256];
+ char strbuff1[81];
+ char fmt_u[] = "%u";
+ char fmt_lu[] = "%lu";
+#ifdef HAVE_LONGLONG
+ char fmt_llu[] = "%llu";
+
+ if (sizeof(rl.rlim_max) > sizeof(long))
+ fmt = fmt_llu;
+ else
+#endif
+ fmt = (sizeof(rl.rlim_max) < sizeof(long))?fmt_u:fmt_lu;
+
+ /* get initial open file limits */
+
+ if (getrlimit(RLIMIT_NOFILE, &rl) != 0) {
+ store_errmsg("getrlimit() failed", ERRNO);
+ fprintf(stderr, "%s\n", msgbuff);
+ return -1;
+ }
+
+ /* show initial open file limits */
+
+#ifdef RLIM_INFINITY
+ if (rl.rlim_cur == RLIM_INFINITY)
+ strcpy(strbuff, "INFINITY");
+ else
+#endif
+ sprintf(strbuff, fmt, rl.rlim_cur);
+ fprintf(stderr, "initial soft limit: %s\n", strbuff);
+
+#ifdef RLIM_INFINITY
+ if (rl.rlim_max == RLIM_INFINITY)
+ strcpy(strbuff, "INFINITY");
+ else
+#endif
+ sprintf(strbuff, fmt, rl.rlim_max);
+ fprintf(stderr, "initial hard limit: %s\n", strbuff);
+
+ /*
+ * if soft limit and hard limit are different we ask the
+ * system to raise soft limit all the way up to the hard
+ * limit. Due to some other system limit the soft limit
+ * might not be raised up to the hard limit. So from this
+ * point the resulting soft limit is our limit. Trying to
+ * open more than soft limit file descriptors will fail.
+ */
+
+ if (rl.rlim_cur != rl.rlim_max) {
+
+#ifdef OPEN_MAX
+ if ((rl.rlim_cur > 0) &&
+ (rl.rlim_cur < OPEN_MAX)) {
+ fprintf(stderr, "raising soft limit up to OPEN_MAX\n");
+ rl.rlim_cur = OPEN_MAX;
+ if (setrlimit(RLIMIT_NOFILE, &rl) != 0) {
+ /* on failure don't abort just issue a warning */
+ store_errmsg("setrlimit() failed", ERRNO);
+ fprintf(stderr, "%s\n", msgbuff);
+ msgbuff[0] = '\0';
+ }
+ }
+#endif
+
+ fprintf(stderr, "raising soft limit up to hard limit\n");
+ rl.rlim_cur = rl.rlim_max;
+ if (setrlimit(RLIMIT_NOFILE, &rl) != 0) {
+ /* on failure don't abort just issue a warning */
+ store_errmsg("setrlimit() failed", ERRNO);
+ fprintf(stderr, "%s\n", msgbuff);
+ msgbuff[0] = '\0';
+ }
+
+ /* get current open file limits */
+
+ if (getrlimit(RLIMIT_NOFILE, &rl) != 0) {
+ store_errmsg("getrlimit() failed", ERRNO);
+ fprintf(stderr, "%s\n", msgbuff);
+ return -3;
+ }
+
+ /* show current open file limits */
+
+#ifdef RLIM_INFINITY
+ if (rl.rlim_cur == RLIM_INFINITY)
+ strcpy(strbuff, "INFINITY");
+ else
+#endif
+ sprintf(strbuff, fmt, rl.rlim_cur);
+ fprintf(stderr, "current soft limit: %s\n", strbuff);
+
+#ifdef RLIM_INFINITY
+ if (rl.rlim_max == RLIM_INFINITY)
+ strcpy(strbuff, "INFINITY");
+ else
+#endif
+ sprintf(strbuff, fmt, rl.rlim_max);
+ fprintf(stderr, "current hard limit: %s\n", strbuff);
+
+ } /* (rl.rlim_cur != rl.rlim_max) */
+
+ /*
+ * test 537 is all about testing libcurl functionality
+ * when the system has nearly exhausted the number of
+ * available file descriptors. Test 537 will try to run
+ * with a very small number of file descriptors available.
+ * This implies that any file descriptor which is open
+ * when the test runs will have a number in the high range
+ * of whatever the system supports.
+ */
+
+ /*
+ * reserve a chunk of memory before opening file descriptors to
+ * avoid a low memory condition once the file descriptors are
+ * open. System conditions that could make the test fail should
+ * be addressed in the precheck phase. This chunk of memory shall
+ * be always free()ed before exiting the rlimit() function so
+ * that it becomes available to the test.
+ */
+
+ for (nitems = i = 1; nitems <= i; i *= 2)
+ nitems = i;
+ if (nitems > 0x7fff)
+ nitems = 0x40000;
+ do {
+ num_open.rlim_max = sizeof(*memchunk) * (size_t)nitems;
+ sprintf(strbuff, fmt, num_open.rlim_max);
+ fprintf(stderr, "allocating memchunk %s byte array\n", strbuff);
+ memchunk = malloc(sizeof(*memchunk) * (size_t)nitems);
+ if (!memchunk) {
+ fprintf(stderr, "memchunk, malloc() failed\n");
+ nitems /= 2;
+ }
+ } while (nitems && !memchunk);
+ if (!memchunk) {
+ store_errmsg("memchunk, malloc() failed", ERRNO);
+ fprintf(stderr, "%s\n", msgbuff);
+ return -4;
+ }
+
+ /* initialize it to fight lazy allocation */
+
+ fprintf(stderr, "initializing memchunk array\n");
+
+ for (i = 0; i < nitems; i++)
+ memchunk[i] = -1;
+
+ /* set the number of file descriptors we will try to open */
+
+#ifdef RLIM_INFINITY
+ if ((rl.rlim_cur > 0) && (rl.rlim_cur != RLIM_INFINITY)) {
+#else
+ if (rl.rlim_cur > 0) {
+#endif
+ /* soft limit minus SAFETY_MARGIN */
+ num_open.rlim_max = rl.rlim_cur - SAFETY_MARGIN;
+ }
+ else {
+ /* a huge number of file descriptors */
+ for (nitems = i = 1; nitems <= i; i *= 2)
+ nitems = i;
+ if (nitems > 0x7fff)
+ nitems = 0x40000;
+ num_open.rlim_max = nitems;
+ }
+
+ /* verify that we won't overflow size_t in malloc() */
+
+ if ((size_t)(num_open.rlim_max) > ((size_t)-1) / sizeof(*fd)) {
+ sprintf(strbuff1, fmt, num_open.rlim_max);
+ sprintf(strbuff, "unable to allocate an array for %s "
+ "file descriptors, would overflow size_t", strbuff1);
+ store_errmsg(strbuff, 0);
+ fprintf(stderr, "%s\n", msgbuff);
+ free(memchunk);
+ return -5;
+ }
+
+ /* allocate array for file descriptors */
+
+ do {
+ sprintf(strbuff, fmt, num_open.rlim_max);
+ fprintf(stderr, "allocating array for %s file descriptors\n", strbuff);
+ fd = malloc(sizeof(*fd) * (size_t)(num_open.rlim_max));
+ if (!fd) {
+ fprintf(stderr, "fd, malloc() failed\n");
+ num_open.rlim_max /= 2;
+ }
+ } while (num_open.rlim_max && !fd);
+ if (!fd) {
+ store_errmsg("fd, malloc() failed", ERRNO);
+ fprintf(stderr, "%s\n", msgbuff);
+ free(memchunk);
+ return -6;
+ }
+
+ /* initialize it to fight lazy allocation */
+
+ fprintf(stderr, "initializing fd array\n");
+
+ for (num_open.rlim_cur = 0;
+ num_open.rlim_cur < num_open.rlim_max;
+ num_open.rlim_cur++)
+ fd[num_open.rlim_cur] = -1;
+
+ sprintf(strbuff, fmt, num_open.rlim_max);
+ fprintf(stderr, "trying to open %s file descriptors\n", strbuff);
+
+ /* open a dummy descriptor */
+
+ fd[0] = open(DEV_NULL, O_RDONLY);
+ if (fd[0] < 0) {
+ sprintf(strbuff, "opening of %s failed", DEV_NULL);
+ store_errmsg(strbuff, ERRNO);
+ fprintf(stderr, "%s\n", msgbuff);
+ free(fd);
+ fd = NULL;
+ free(memchunk);
+ return -7;
+ }
+
+ /* create a bunch of file descriptors */
+
+ for (num_open.rlim_cur = 1;
+ num_open.rlim_cur < num_open.rlim_max;
+ num_open.rlim_cur++) {
+
+ fd[num_open.rlim_cur] = dup(fd[0]);
+
+ if (fd[num_open.rlim_cur] < 0) {
+
+ fd[num_open.rlim_cur] = -1;
+
+ sprintf(strbuff1, fmt, num_open.rlim_cur);
+ sprintf(strbuff, "dup() attempt %s failed", strbuff1);
+ fprintf(stderr, "%s\n", strbuff);
+
+ sprintf(strbuff1, fmt, num_open.rlim_cur);
+ sprintf(strbuff, "fds system limit seems close to %s", strbuff1);
+ fprintf(stderr, "%s\n", strbuff);
+
+ num_open.rlim_max = num_open.rlim_cur - SAFETY_MARGIN;
+
+ num_open.rlim_cur -= num_open.rlim_max;
+ sprintf(strbuff1, fmt, num_open.rlim_cur);
+ sprintf(strbuff, "closing %s file descriptors", strbuff1);
+ fprintf(stderr, "%s\n", strbuff);
+
+ for (num_open.rlim_cur = num_open.rlim_max;
+ fd[num_open.rlim_cur] >= 0;
+ num_open.rlim_cur++) {
+ close(fd[num_open.rlim_cur]);
+ fd[num_open.rlim_cur] = -1;
+ }
+
+ sprintf(strbuff, fmt, num_open.rlim_max);
+ fprintf(stderr, "shrinking array for %s file descriptors\n", strbuff);
+
+ /* we don't care if we can't shrink it */
+
+ tmpfd = realloc(fd, sizeof(*fd) * (size_t)(num_open.rlim_max));
+ if (tmpfd) {
+ fd = tmpfd;
+ tmpfd = NULL;
+ }
+
+ break;
+
+ }
+
+ }
+
+ sprintf(strbuff, fmt, num_open.rlim_max);
+ fprintf(stderr, "%s file descriptors open\n", strbuff);
+
+#if !defined(HAVE_POLL_FINE) && \
+ !defined(USE_WINSOCK) && \
+ !defined(TPF)
+
+ /*
+ * when using select() instead of poll() we cannot test
+ * libcurl functionality with a socket number equal or
+ * greater than FD_SETSIZE. In any case, macro VERIFY_SOCK
+ * in lib/select.c enforces this check and protects libcurl
+ * from a possible crash. The effect of this protection
+ * is that test 537 will always fail, since the actual
+ * call to select() never takes place. We skip test 537
+ * with an indication that select limit would be exceeded.
+ */
+
+ num_open.rlim_cur = FD_SETSIZE - SAFETY_MARGIN;
+ if (num_open.rlim_max > num_open.rlim_cur) {
+ sprintf(strbuff, "select limit is FD_SETSIZE %d", FD_SETSIZE);
+ store_errmsg(strbuff, 0);
+ fprintf(stderr, "%s\n", msgbuff);
+ close_file_descriptors();
+ free(memchunk);
+ return -8;
+ }
+
+ num_open.rlim_cur = FD_SETSIZE - SAFETY_MARGIN;
+ for (rl.rlim_cur = 0;
+ rl.rlim_cur < num_open.rlim_max;
+ rl.rlim_cur++) {
+ if ((fd[rl.rlim_cur] > 0) &&
+ ((unsigned int)fd[rl.rlim_cur] > num_open.rlim_cur)) {
+ sprintf(strbuff, "select limit is FD_SETSIZE %d", FD_SETSIZE);
+ store_errmsg(strbuff, 0);
+ fprintf(stderr, "%s\n", msgbuff);
+ close_file_descriptors();
+ free(memchunk);
+ return -9;
+ }
+ }
+
+#endif /* using a FD_SETSIZE bound select() */
+
+ /*
+ * Old or 'backwards compatible' implementations of stdio do not allow
+ * handling of streams with an underlying file descriptor number greater
+ * than 255, even when allowing high numbered file descriptors for sockets.
+ * At this point we have a big number of file descriptors which have been
+ * opened using dup(), so lets test the stdio implementation and discover
+ * if it is capable of fopen()ing some additional files.
+ */
+
+ if (!fopen_works()) {
+ sprintf(strbuff1, fmt, num_open.rlim_max);
+ sprintf(strbuff, "stdio fopen() fails with %s fds open()",
+ strbuff1);
+ fprintf(stderr, "%s\n", msgbuff);
+ sprintf(strbuff, "stdio fopen() fails with lots of fds open()");
+ store_errmsg(strbuff, 0);
+ close_file_descriptors();
+ free(memchunk);
+ return -10;
+ }
+
+ /* free the chunk of memory we were reserving so that it
+ becomes becomes available to the test */
+
+ free(memchunk);
+
+ /* close file descriptors unless instructed to keep them */
+
+ if (!keep_open) {
+ close_file_descriptors();
+ }
+
+ return 0;
+}
+
+int test(char *URL)
+{
+ CURLcode res;
+ CURL *curl;
+
+ if(!strcmp(URL, "check")) {
+ /* used by the test script to ask if we can run this test or not */
+ if(rlimit(FALSE)) {
+ fprintf(stdout, "rlimit problem: %s\n", msgbuff);
+ return 1;
+ }
+ return 0; /* sure, run this! */
+ }
+
+ if (rlimit(TRUE)) {
+ /* failure */
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ /* run the test with the bunch of open file descriptors
+ and close them all once the test is over */
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ close_file_descriptors();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ close_file_descriptors();
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ test_setopt(curl, CURLOPT_URL, URL);
+ test_setopt(curl, CURLOPT_HEADER, 1L);
+
+ res = curl_easy_perform(curl);
+
+test_cleanup:
+
+ close_file_descriptors();
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return (int)res;
+}
+
+#else /* defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT) */
+
+int test(char *URL)
+{
+ (void)URL;
+ printf("system lacks necessary system function(s)");
+ return 1; /* skip test */
+}
+
+#endif /* defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT) */
diff --git a/tests/libtest/lib539.c b/tests/libtest/lib539.c
new file mode 100644
index 000000000..9909d01d1
--- /dev/null
+++ b/tests/libtest/lib539.c
@@ -0,0 +1,80 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#include "memdebug.h"
+
+int test(char *URL)
+{
+ CURLcode res;
+ CURL *curl;
+ char *newURL = NULL;
+ struct curl_slist *slist = NULL;
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ /*
+ * Begin with cURL set to use a single CWD to the URL's directory.
+ */
+ test_setopt(curl, CURLOPT_URL, URL);
+ test_setopt(curl, CURLOPT_VERBOSE, 1L);
+ test_setopt(curl, CURLOPT_FTP_FILEMETHOD, (long) CURLFTPMETHOD_SINGLECWD);
+
+ res = curl_easy_perform(curl);
+
+ /*
+ * Change the FTP_FILEMETHOD option to use full paths rather than a CWD
+ * command. Alter the URL's path a bit, appending a "./". Use an innocuous
+ * QUOTE command, after which cURL will CWD to ftp_conn->entrypath and then
+ * (on the next call to ftp_statemach_act) find a non-zero ftpconn->dirdepth
+ * even though no directories are stored in the ftpconn->dirs array (after a
+ * call to freedirs).
+ */
+ newURL = malloc(strlen(URL) + 3);
+ if (newURL == NULL) {
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+ newURL = strcat(strcpy(newURL, URL), "./");
+
+ slist = curl_slist_append (NULL, "SYST");
+ if (slist == NULL) {
+ free(newURL);
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ test_setopt(curl, CURLOPT_URL, newURL);
+ test_setopt(curl, CURLOPT_FTP_FILEMETHOD, (long) CURLFTPMETHOD_NOCWD);
+ test_setopt(curl, CURLOPT_QUOTE, slist);
+
+ res = curl_easy_perform(curl);
+
+test_cleanup:
+
+ curl_slist_free_all(slist);
+ if(newURL)
+ free(newURL);
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return (int)res;
+}
diff --git a/tests/libtest/lib540.c b/tests/libtest/lib540.c
new file mode 100644
index 000000000..bf4cd5225
--- /dev/null
+++ b/tests/libtest/lib540.c
@@ -0,0 +1,178 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ *
+ * This is the 'proxyauth.c' test app posted by Shmulik Regev on the libcurl
+ * mailing list on 10 Jul 2007, converted to a test case.
+ *
+ * argv1 = URL
+ * argv2 = proxy
+ * argv3 = proxyuser:password
+ * argv4 = host name to use for the custom Host: header
+ */
+
+#include "test.h"
+
+#include "memdebug.h"
+
+#define PROXY libtest_arg2
+#define PROXYUSERPWD libtest_arg3
+#define HOST test_argv[4]
+
+static int init(CURLM *cm, const char* url, const char* userpwd,
+ struct curl_slist *headers)
+{
+ CURL *eh;
+ int res;
+
+ if ((eh = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ return 1; /* failure */
+ }
+
+ res = curl_easy_setopt(eh, CURLOPT_URL, url);
+ if(res) return 1;
+ res = curl_easy_setopt(eh, CURLOPT_PROXY, PROXY);
+ if(res) return 1;
+ res = curl_easy_setopt(eh, CURLOPT_PROXYUSERPWD, userpwd);
+ if(res) return 1;
+ res = curl_easy_setopt(eh, CURLOPT_PROXYAUTH, (long)CURLAUTH_ANY);
+ if(res) return 1;
+ res = curl_easy_setopt(eh, CURLOPT_VERBOSE, 1L);
+ if(res) return 1;
+ res = curl_easy_setopt(eh, CURLOPT_HEADER, 1L);
+ if(res) return 1;
+ res = curl_easy_setopt(eh, CURLOPT_HTTPHEADER, headers); /* custom Host: */
+ if(res) return 1;
+
+ if ((res = (int)curl_multi_add_handle(cm, eh)) != CURLM_OK) {
+ fprintf(stderr, "curl_multi_add_handle() failed, "
+ "with code %d\n", res);
+ return 1; /* failure */
+ }
+
+ return 0; /* success */
+}
+
+static int loop(CURLM *cm, const char* url, const char* userpwd,
+ struct curl_slist *headers)
+{
+ CURLMsg *msg;
+ CURLMcode code;
+ long L;
+ int M, Q, U = -1;
+ fd_set R, W, E;
+ struct timeval T;
+
+ if(init(cm, url, userpwd, headers))
+ return 1; /* failure */
+
+ while (U) {
+
+ do {
+ code = curl_multi_perform(cm, &U);
+ } while (code == CURLM_CALL_MULTI_PERFORM);
+
+ if (U) {
+ FD_ZERO(&R);
+ FD_ZERO(&W);
+ FD_ZERO(&E);
+
+ if (curl_multi_fdset(cm, &R, &W, &E, &M)) {
+ fprintf(stderr, "E: curl_multi_fdset\n");
+ return 1; /* failure */
+ }
+
+ /* In a real-world program you OF COURSE check the return that maxfd is
+ bigger than -1 so that the call to select() below makes sense! */
+
+ if (curl_multi_timeout(cm, &L)) {
+ fprintf(stderr, "E: curl_multi_timeout\n");
+ return 1; /* failure */
+ }
+
+ if(L != -1) {
+ T.tv_sec = L/1000;
+ T.tv_usec = (L%1000)*1000;
+ }
+ else {
+ T.tv_sec = 5;
+ T.tv_usec = 0;
+ }
+
+ if (0 > select(M+1, &R, &W, &E, &T)) {
+ fprintf(stderr, "E: select\n");
+ return 1; /* failure */
+ }
+ }
+
+ while ((msg = curl_multi_info_read(cm, &Q))) {
+ if (msg->msg == CURLMSG_DONE) {
+ CURL *e = msg->easy_handle;
+ fprintf(stderr, "R: %d - %s\n", (int)msg->data.result,
+ curl_easy_strerror(msg->data.result));
+ curl_multi_remove_handle(cm, e);
+ curl_easy_cleanup(e);
+ }
+ else {
+ fprintf(stderr, "E: CURLMsg (%d)\n", (int)msg->msg);
+ }
+ }
+ }
+
+ return 0; /* success */
+}
+
+int test(char *URL)
+{
+ CURLM *cm = NULL;
+ struct curl_slist *headers = NULL;
+ char buffer[246]; /* naively fixed-size */
+ int res;
+
+ if(test_argc < 4)
+ return 99;
+
+ sprintf(buffer, "Host: %s", HOST);
+
+ /* now add a custom Host: header */
+ headers = curl_slist_append(headers, buffer);
+ if(!headers) {
+ fprintf(stderr, "curl_slist_append() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ curl_slist_free_all(headers);
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((cm = curl_multi_init()) == NULL) {
+ fprintf(stderr, "curl_multi_init() failed\n");
+ curl_slist_free_all(headers);
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ res = loop(cm, URL, PROXYUSERPWD, headers);
+ if(res)
+ goto test_cleanup;
+
+ fprintf(stderr, "lib540: now we do the request again\n");
+ res = loop(cm, URL, PROXYUSERPWD, headers);
+
+test_cleanup:
+
+ curl_multi_cleanup(cm);
+
+ curl_global_cleanup();
+
+ curl_slist_free_all(headers);
+
+ return res;
+}
diff --git a/tests/libtest/lib541.c b/tests/libtest/lib541.c
new file mode 100644
index 000000000..2fc85b97d
--- /dev/null
+++ b/tests/libtest/lib541.c
@@ -0,0 +1,118 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#include "memdebug.h"
+
+/*
+ * Two FTP uploads, the second with no content sent.
+ */
+
+int test(char *URL)
+{
+ CURL *curl;
+ CURLcode res = CURLE_OK;
+ FILE *hd_src ;
+ int hd ;
+ struct_stat file_info;
+ int error;
+
+ if (!libtest_arg2) {
+ fprintf(stderr, "Usage: <url> <file-to-upload>\n");
+ return -1;
+ }
+
+ hd_src = fopen(libtest_arg2, "rb");
+ if(NULL == hd_src) {
+ error = ERRNO;
+ fprintf(stderr, "fopen() failed with error: %d %s\n",
+ error, strerror(error));
+ fprintf(stderr, "Error opening file: %s\n", libtest_arg2);
+ return -2; /* if this happens things are major weird */
+ }
+
+ /* get the file size of the local file */
+ hd = fstat(fileno(hd_src), &file_info);
+ if(hd == -1) {
+ /* can't open file, bail out */
+ error = ERRNO;
+ fprintf(stderr, "fstat() failed with error: %d %s\n",
+ error, strerror(error));
+ fprintf(stderr, "ERROR: cannot open file %s\n", libtest_arg2);
+ fclose(hd_src);
+ return -1;
+ }
+
+ if(! file_info.st_size) {
+ fprintf(stderr, "ERROR: file %s has zero size!\n", libtest_arg2);
+ fclose(hd_src);
+ return -4;
+ }
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ fclose(hd_src);
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ /* get a curl handle */
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ fclose(hd_src);
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ /* enable uploading */
+ test_setopt(curl, CURLOPT_UPLOAD, 1L);
+
+ /* enable verbose */
+ test_setopt(curl, CURLOPT_VERBOSE, 1L);
+
+ /* specify target */
+ test_setopt(curl,CURLOPT_URL, URL);
+
+ /* now specify which file to upload */
+ test_setopt(curl, CURLOPT_INFILE, hd_src);
+
+ /* Now run off and do what you've been told! */
+ res = curl_easy_perform(curl);
+
+ /* and now upload the exact same again, but without rewinding so it already
+ is at end of file */
+ res = curl_easy_perform(curl);
+
+test_cleanup:
+
+ /* close the local file */
+ fclose(hd_src);
+
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return res;
+}
diff --git a/tests/libtest/lib542.c b/tests/libtest/lib542.c
new file mode 100644
index 000000000..ef7b483b4
--- /dev/null
+++ b/tests/libtest/lib542.c
@@ -0,0 +1,73 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#include "memdebug.h"
+
+/*
+ * FTP get with NOBODY but no HEADER
+ */
+
+int test(char *URL)
+{
+ CURL *curl;
+ CURLcode res = CURLE_OK;
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ /* get a curl handle */
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ /* enable verbose */
+ test_setopt(curl, CURLOPT_VERBOSE, 1L);
+
+ /* enable NOBODY */
+ test_setopt(curl, CURLOPT_NOBODY, 1L);
+
+ /* disable HEADER */
+ test_setopt(curl, CURLOPT_HEADER, 0L);
+
+ /* specify target */
+ test_setopt(curl,CURLOPT_URL, URL);
+
+ /* Now run off and do what you've been told! */
+ res = curl_easy_perform(curl);
+
+test_cleanup:
+
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return res;
+}
diff --git a/tests/libtest/lib543.c b/tests/libtest/lib543.c
new file mode 100644
index 000000000..8f14f8411
--- /dev/null
+++ b/tests/libtest/lib543.c
@@ -0,0 +1,42 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ *
+ * Based on Alex Fishman's bug report on September 30, 2007
+ */
+
+#include "test.h"
+
+#include "memdebug.h"
+
+int test(char *URL)
+{
+ unsigned char a[] = {0x9c, 0x26, 0x4b, 0x3d, 0x49, 0x4, 0xa1, 0x1,
+ 0xe0, 0xd8, 0x7c, 0x20, 0xb7, 0xef, 0x53, 0x29, 0xfa,
+ 0x1d, 0x57, 0xe1};
+
+ CURL *easy;
+ int asize;
+ char *s;
+ (void)URL;
+
+ if ((easy = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ asize = (int)sizeof(a);
+
+ s = curl_easy_escape(easy, (char*)a, asize);
+
+ printf("%s\n", s);
+
+ curl_free(s);
+ curl_easy_cleanup(easy);
+
+ return 0;
+}
diff --git a/tests/libtest/lib544.c b/tests/libtest/lib544.c
new file mode 100644
index 000000000..6bc899cc5
--- /dev/null
+++ b/tests/libtest/lib544.c
@@ -0,0 +1,66 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#include "memdebug.h"
+
+static char teststring[] =
+#ifdef CURL_DOES_CONVERSIONS
+ /* ASCII representation with escape sequences for non-ASCII platforms */
+ "\x54\x68\x69\x73\x00\x20\x69\x73\x20\x74\x65\x73\x74\x20\x62\x69\x6e\x61"
+ "\x72\x79\x20\x64\x61\x74\x61\x20\x77\x69\x74\x68\x20\x61\x6e\x20\x65\x6d"
+ "\x62\x65\x64\x64\x65\x64\x20\x4e\x55\x4c\x20\x62\x79\x74\x65\x0a";
+#else
+ "This\0 is test binary data with an embedded NUL byte\n";
+#endif
+
+
+int test(char *URL)
+{
+ CURL *curl;
+ CURLcode res=CURLE_OK;
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ /* First set the URL that is about to receive our POST. */
+ test_setopt(curl, CURLOPT_URL, URL);
+
+#ifdef LIB545
+ test_setopt(curl, CURLOPT_POSTFIELDSIZE, (long) sizeof teststring - 1);
+#endif
+
+ test_setopt(curl, CURLOPT_COPYPOSTFIELDS, teststring);
+
+ test_setopt(curl, CURLOPT_VERBOSE, 1L); /* show verbose for debug */
+ test_setopt(curl, CURLOPT_HEADER, 1L); /* include header */
+
+ /* Update the original data to detect non-copy. */
+ strcpy(teststring, "FAIL");
+
+ /* Now, this is a POST request with binary 0 embedded in POST data. */
+ res = curl_easy_perform(curl);
+
+test_cleanup:
+
+ /* always cleanup */
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return (int)res;
+}
diff --git a/tests/libtest/lib547.c b/tests/libtest/lib547.c
new file mode 100644
index 000000000..4ef303726
--- /dev/null
+++ b/tests/libtest/lib547.c
@@ -0,0 +1,116 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ *
+ * argv1 = URL
+ * argv2 = proxy
+ * argv3 = proxyuser:password
+ */
+
+#include "test.h"
+
+#include "memdebug.h"
+
+#ifdef CURL_DOES_CONVERSIONS
+ /* ASCII representation with escape sequences for non-ASCII platforms */
+# define UPLOADTHIS "\x74\x68\x69\x73\x20\x69\x73\x20\x74\x68\x65\x20\x62" \
+ "\x6c\x75\x72\x62\x20\x77\x65\x20\x77\x61\x6e\x74\x20" \
+ "\x74\x6f\x20\x75\x70\x6c\x6f\x61\x64\x0a"
+#else
+# define UPLOADTHIS "this is the blurb we want to upload\n"
+#endif
+
+#ifndef LIB548
+static size_t readcallback(void *ptr,
+ size_t size,
+ size_t nmemb,
+ void *clientp)
+{
+ int *counter = (int *)clientp;
+
+ if(*counter) {
+ /* only do this once and then require a clearing of this */
+ fprintf(stderr, "READ ALREADY DONE!\n");
+ return 0;
+ }
+ (*counter)++; /* bump */
+
+ if(size * nmemb > strlen(UPLOADTHIS)) {
+ fprintf(stderr, "READ!\n");
+ strcpy(ptr, UPLOADTHIS);
+ return strlen(UPLOADTHIS);
+ }
+ fprintf(stderr, "READ NOT FINE!\n");
+ return 0;
+}
+static curlioerr ioctlcallback(CURL *handle,
+ int cmd,
+ void *clientp)
+{
+ int *counter = (int *)clientp;
+ (void)handle; /* unused */
+ if(cmd == CURLIOCMD_RESTARTREAD) {
+ fprintf(stderr, "REWIND!\n");
+ *counter = 0; /* clear counter to make the read callback restart */
+ }
+ return CURLIOE_OK;
+}
+
+
+
+#endif
+
+int test(char *URL)
+{
+ CURLcode res;
+ CURL *curl;
+#ifndef LIB548
+ int counter=0;
+#endif
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ test_setopt(curl, CURLOPT_URL, URL);
+ test_setopt(curl, CURLOPT_VERBOSE, 1L);
+ test_setopt(curl, CURLOPT_HEADER, 1L);
+#ifdef LIB548
+ /* set the data to POST with a mere pointer to a zero-terminated string */
+ test_setopt(curl, CURLOPT_POSTFIELDS, UPLOADTHIS);
+#else
+ /* 547 style, which means reading the POST data from a callback */
+ test_setopt(curl, CURLOPT_IOCTLFUNCTION, ioctlcallback);
+ test_setopt(curl, CURLOPT_IOCTLDATA, &counter);
+ test_setopt(curl, CURLOPT_READFUNCTION, readcallback);
+ test_setopt(curl, CURLOPT_READDATA, &counter);
+ /* We CANNOT do the POST fine without setting the size (or choose chunked)! */
+ test_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)strlen(UPLOADTHIS));
+#endif
+ test_setopt(curl, CURLOPT_POST, 1L);
+ test_setopt(curl, CURLOPT_PROXY, libtest_arg2);
+ test_setopt(curl, CURLOPT_PROXYUSERPWD, libtest_arg3);
+ test_setopt(curl, CURLOPT_PROXYAUTH,
+ (long) (CURLAUTH_NTLM | CURLAUTH_DIGEST | CURLAUTH_BASIC) );
+
+ res = curl_easy_perform(curl);
+
+test_cleanup:
+
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return (int)res;
+}
+
diff --git a/tests/libtest/lib549.c b/tests/libtest/lib549.c
new file mode 100644
index 000000000..9fd18b225
--- /dev/null
+++ b/tests/libtest/lib549.c
@@ -0,0 +1,52 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ *
+ * argv1 = URL
+ * argv2 = proxy
+ * argv3 = non-zero means ASCII transfer
+ */
+
+#include "test.h"
+
+#include "memdebug.h"
+
+int test(char *URL)
+{
+ CURLcode res;
+ CURL *curl;
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ test_setopt(curl, CURLOPT_PROXY, libtest_arg2);
+ test_setopt(curl, CURLOPT_URL, URL);
+ test_setopt(curl, CURLOPT_PROXY_TRANSFER_MODE, 1L);
+ test_setopt(curl, CURLOPT_VERBOSE, 1L);
+ if(libtest_arg3) {
+ /* enable ascii/text mode */
+ test_setopt(curl, CURLOPT_TRANSFERTEXT, 1L);
+ }
+
+ res = curl_easy_perform(curl);
+
+test_cleanup:
+
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return (int)res;
+}
+
diff --git a/tests/libtest/lib552.c b/tests/libtest/lib552.c
new file mode 100644
index 000000000..eeecf6f91
--- /dev/null
+++ b/tests/libtest/lib552.c
@@ -0,0 +1,205 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ *
+ * argv1 = URL
+ * argv2 = proxy with embedded user+password
+ */
+
+#include "test.h"
+
+#include "memdebug.h"
+
+struct data {
+ char trace_ascii; /* 1 or 0 */
+};
+
+static
+void dump(const char *text,
+ FILE *stream, unsigned char *ptr, size_t size,
+ char nohex)
+{
+ size_t i;
+ size_t c;
+
+ unsigned int width=0x10;
+
+ if(nohex)
+ /* without the hex output, we can fit more on screen */
+ width = 0x40;
+
+ fprintf(stream, "%s, %d bytes (0x%x)\n", text, (int)size, (int)size);
+
+ for(i=0; i<size; i+= width) {
+
+ fprintf(stream, "%04x: ", (int)i);
+
+ if(!nohex) {
+ /* hex not disabled, show it */
+ for(c = 0; c < width; c++)
+ if(i+c < size)
+ fprintf(stream, "%02x ", ptr[i+c]);
+ else
+ fputs(" ", stream);
+ }
+
+ for(c = 0; (c < width) && (i+c < size); c++) {
+ /* check for 0D0A; if found, skip past and start a new line of output */
+ if (nohex && (i+c+1 < size) && ptr[i+c]==0x0D && ptr[i+c+1]==0x0A) {
+ i+=(c+2-width);
+ break;
+ }
+ fprintf(stream, "%c",
+ (ptr[i+c]>=0x20) && (ptr[i+c]<0x80)?ptr[i+c]:'.');
+ /* check again for 0D0A, to avoid an extra \n if it's at width */
+ if (nohex && (i+c+2 < size) && ptr[i+c+1]==0x0D && ptr[i+c+2]==0x0A) {
+ i+=(c+3-width);
+ break;
+ }
+ }
+ fputc('\n', stream); /* newline */
+ }
+ fflush(stream);
+}
+
+static
+int my_trace(CURL *handle, curl_infotype type,
+ char *data, size_t size,
+ void *userp)
+{
+ struct data *config = (struct data *)userp;
+ const char *text;
+ (void)handle; /* prevent compiler warning */
+
+ switch (type) {
+ case CURLINFO_TEXT:
+ fprintf(stderr, "== Info: %s", (char *)data);
+ default: /* in case a new one is introduced to shock us */
+ return 0;
+
+ case CURLINFO_HEADER_OUT:
+ text = "=> Send header";
+ break;
+ case CURLINFO_DATA_OUT:
+ text = "=> Send data";
+ break;
+ case CURLINFO_SSL_DATA_OUT:
+ text = "=> Send SSL data";
+ break;
+ case CURLINFO_HEADER_IN:
+ text = "<= Recv header";
+ break;
+ case CURLINFO_DATA_IN:
+ text = "<= Recv data";
+ break;
+ case CURLINFO_SSL_DATA_IN:
+ text = "<= Recv SSL data";
+ break;
+ }
+
+ dump(text, stderr, (unsigned char *)data, size, config->trace_ascii);
+ return 0;
+}
+
+
+static size_t current_offset = 0;
+static char databuf[70000]; /* MUST be more than 64k OR MAX_INITIAL_POST_SIZE */
+
+static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream)
+{
+ size_t amount = nmemb * size; /* Total bytes curl wants */
+ size_t available = sizeof(databuf) - current_offset; /* What we have to give */
+ size_t given = amount < available ? amount : available; /* What is given */
+ (void)stream;
+ memcpy(ptr, databuf + current_offset, given);
+ current_offset += given;
+ return given;
+}
+
+
+static size_t write_callback(void *ptr, size_t size, size_t nmemb, void *stream)
+{
+ printf("%.*s", (int)(size * nmemb), (char *)ptr);
+ (void)stream;
+ return size * nmemb;
+}
+
+
+static curlioerr ioctl_callback(CURL * handle, int cmd, void *clientp)
+{
+ (void)clientp;
+ if (cmd == CURLIOCMD_RESTARTREAD ) {
+ printf("APPLICATION: recieved a CURLIOCMD_RESTARTREAD request\n");
+ printf("APPLICATION: ** REWINDING! **\n");
+ current_offset = 0;
+ return CURLIOE_OK;
+ }
+ (void)handle;
+ return CURLIOE_UNKNOWNCMD;
+}
+
+
+
+int test(char *URL)
+{
+ CURL *curl;
+ CURLcode res = CURLE_OUT_OF_MEMORY;
+ struct data config;
+ size_t i;
+ static const char fill[] = "test data";
+
+ config.trace_ascii = 1; /* enable ascii tracing */
+
+ if((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ test_setopt(curl, CURLOPT_DEBUGFUNCTION, my_trace);
+ test_setopt(curl, CURLOPT_DEBUGDATA, &config);
+ /* the DEBUGFUNCTION has no effect until we enable VERBOSE */
+ test_setopt(curl, CURLOPT_VERBOSE, 1L);
+
+ /* setup repeated data string */
+ for (i=0; i < sizeof(databuf); ++i)
+ databuf[i] = fill[i % sizeof fill];
+
+ /* Post */
+ test_setopt(curl, CURLOPT_POST, 1L);
+
+#ifdef CURL_DOES_CONVERSIONS
+ /* Convert the POST data to ASCII */
+ test_setopt(curl, CURLOPT_TRANSFERTEXT, 1L);
+#endif
+
+ /* Setup read callback */
+ test_setopt(curl, CURLOPT_POSTFIELDSIZE, (long) sizeof(databuf));
+ test_setopt(curl, CURLOPT_READFUNCTION, read_callback);
+
+ /* Write callback */
+ test_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback);
+
+ /* Ioctl function */
+ test_setopt(curl, CURLOPT_IOCTLFUNCTION, ioctl_callback);
+
+ test_setopt(curl, CURLOPT_PROXY, libtest_arg2);
+
+ test_setopt(curl, CURLOPT_URL, URL);
+
+ /* Accept any auth. But for this bug configure proxy with DIGEST, basic might work too, not NTLM */
+ test_setopt(curl, CURLOPT_PROXYAUTH, (long)CURLAUTH_ANY);
+
+ res = curl_easy_perform(curl);
+ fprintf(stderr, "curl_easy_perform = %d\n", (int)res);
+
+test_cleanup:
+
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+ return (int)res;
+}
diff --git a/tests/libtest/lib553.c b/tests/libtest/lib553.c
new file mode 100644
index 000000000..8694daf67
--- /dev/null
+++ b/tests/libtest/lib553.c
@@ -0,0 +1,100 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ *
+ * This test case and code is based on the bug recipe Joe Malicki provided for
+ * bug report #1871269, fixed on Jan 14 2008 before the 7.18.0 release.
+ */
+
+#include "test.h"
+
+#include "memdebug.h"
+
+#define POSTLEN 40960
+
+static size_t myreadfunc(void *ptr, size_t size, size_t nmemb, void *stream)
+{
+ static size_t total=POSTLEN;
+ static char buf[1024];
+ (void)stream;
+
+ memset(buf, 'A', sizeof(buf));
+
+ size *= nmemb;
+ if (size > total)
+ size = total;
+
+ if(size > sizeof(buf))
+ size = sizeof(buf);
+
+ memcpy(ptr, buf, size);
+ total -= size;
+ return size;
+}
+
+#define NUM_HEADERS 8
+#define SIZE_HEADERS 5000
+
+static char buf[SIZE_HEADERS + 100];
+
+int test(char *URL)
+{
+ CURL *curl;
+ CURLcode res = CURLE_FAILED_INIT;
+ int i;
+ struct curl_slist *headerlist=NULL, *hl;
+
+ if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ for (i = 0; i < NUM_HEADERS; i++) {
+ int len = sprintf(buf, "Header%d: ", i);
+ memset(&buf[len], 'A', SIZE_HEADERS);
+ buf[len + SIZE_HEADERS]=0; /* zero terminate */
+ hl = curl_slist_append(headerlist, buf);
+ if (!hl)
+ goto test_cleanup;
+ headerlist = hl;
+ }
+
+ hl = curl_slist_append(headerlist, "Expect: ");
+ if (!hl)
+ goto test_cleanup;
+ headerlist = hl;
+
+ test_setopt(curl, CURLOPT_URL, URL);
+ test_setopt(curl, CURLOPT_HTTPHEADER, headerlist);
+ test_setopt(curl, CURLOPT_POST, 1L);
+#ifdef CURL_DOES_CONVERSIONS
+ /* Convert the POST data to ASCII */
+ test_setopt(curl, CURLOPT_TRANSFERTEXT, 1L);
+#endif
+ test_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)POSTLEN);
+ test_setopt(curl, CURLOPT_VERBOSE, 1L);
+ test_setopt(curl, CURLOPT_HEADER, 1L);
+ test_setopt(curl, CURLOPT_READFUNCTION, myreadfunc);
+
+ res = curl_easy_perform(curl);
+
+test_cleanup:
+
+ curl_easy_cleanup(curl);
+
+ curl_slist_free_all(headerlist);
+
+ curl_global_cleanup();
+
+ return (int)res;
+}
diff --git a/tests/libtest/lib554.c b/tests/libtest/lib554.c
new file mode 100644
index 000000000..d7c68241a
--- /dev/null
+++ b/tests/libtest/lib554.c
@@ -0,0 +1,150 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#include "memdebug.h"
+
+static char data[]=
+#ifdef CURL_DOES_CONVERSIONS
+ /* ASCII representation with escape sequences for non-ASCII platforms */
+ "\x74\x68\x69\x73\x20\x69\x73\x20\x77\x68\x61\x74\x20\x77\x65\x20\x70"
+ "\x6f\x73\x74\x20\x74\x6f\x20\x74\x68\x65\x20\x73\x69\x6c\x6c\x79\x20"
+ "\x77\x65\x62\x20\x73\x65\x72\x76\x65\x72\x0a";
+#else
+ "this is what we post to the silly web server\n";
+#endif
+
+struct WriteThis {
+ char *readptr;
+ size_t sizeleft;
+};
+
+static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *userp)
+{
+ struct WriteThis *pooh = (struct WriteThis *)userp;
+
+ if(size*nmemb < 1)
+ return 0;
+
+ if(pooh->sizeleft) {
+ *(char *)ptr = pooh->readptr[0]; /* copy one single byte */
+ pooh->readptr++; /* advance pointer */
+ pooh->sizeleft--; /* less data left */
+ return 1; /* we return 1 byte at a time! */
+ }
+
+ return 0; /* no more data left to deliver */
+}
+
+int test(char *URL)
+{
+ CURL *curl;
+ CURLcode res=CURLE_OK;
+ CURLFORMcode formrc;
+
+ struct curl_httppost *formpost=NULL;
+ struct curl_httppost *lastptr=NULL;
+ struct WriteThis pooh;
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ pooh.readptr = data;
+ pooh.sizeleft = strlen(data);
+
+ /* Fill in the file upload field */
+ formrc = curl_formadd(&formpost,
+ &lastptr,
+ CURLFORM_COPYNAME, "sendfile",
+ CURLFORM_STREAM, &pooh,
+ CURLFORM_CONTENTSLENGTH, pooh.sizeleft,
+ CURLFORM_FILENAME, "postit2.c",
+ CURLFORM_END);
+
+ if(formrc)
+ printf("curl_formadd(1) = %d\n", (int)formrc);
+
+ /* Fill in the filename field */
+ formrc = curl_formadd(&formpost,
+ &lastptr,
+ CURLFORM_COPYNAME, "filename",
+#ifdef CURL_DOES_CONVERSIONS
+ /* ASCII representation with escape
+ sequences for non-ASCII platforms */
+ CURLFORM_COPYCONTENTS,
+ "\x70\x6f\x73\x74\x69\x74\x32\x2e\x63",
+#else
+ CURLFORM_COPYCONTENTS, "postit2.c",
+#endif
+ CURLFORM_END);
+
+ if(formrc)
+ printf("curl_formadd(2) = %d\n", (int)formrc);
+
+ /* Fill in a submit field too */
+ formrc = curl_formadd(&formpost,
+ &lastptr,
+ CURLFORM_COPYNAME, "submit",
+#ifdef CURL_DOES_CONVERSIONS
+ /* ASCII representation with escape
+ sequences for non-ASCII platforms */
+ CURLFORM_COPYCONTENTS, "\x73\x65\x6e\x64",
+#else
+ CURLFORM_COPYCONTENTS, "send",
+#endif
+ CURLFORM_END);
+
+ if(formrc)
+ printf("curl_formadd(3) = %d\n", (int)formrc);
+
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_formfree(formpost);
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ /* First set the URL that is about to receive our POST. */
+ test_setopt(curl, CURLOPT_URL, URL);
+
+ /* Now specify we want to POST data */
+ test_setopt(curl, CURLOPT_POST, 1L);
+
+ /* Set the expected POST size */
+ test_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)pooh.sizeleft);
+
+ /* we want to use our own read function */
+ test_setopt(curl, CURLOPT_READFUNCTION, read_callback);
+
+ /* send a multi-part formpost */
+ test_setopt(curl, CURLOPT_HTTPPOST, formpost);
+
+ /* get verbose debug output please */
+ test_setopt(curl, CURLOPT_VERBOSE, 1L);
+
+ /* include headers in the output */
+ test_setopt(curl, CURLOPT_HEADER, 1L);
+
+ /* Perform the request, res will get the return code */
+ res = curl_easy_perform(curl);
+
+test_cleanup:
+
+ /* always cleanup */
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ /* now cleanup the formpost chain */
+ curl_formfree(formpost);
+
+ return res;
+}
diff --git a/tests/libtest/lib555.c b/tests/libtest/lib555.c
new file mode 100644
index 000000000..55b3f13ed
--- /dev/null
+++ b/tests/libtest/lib555.c
@@ -0,0 +1,157 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ *
+ * This test case is supposed to be identical to 547 except that this uses the
+ * multi interface and 547 is easy interface.
+ *
+ * argv1 = URL
+ * argv2 = proxy
+ * argv3 = proxyuser:password
+ */
+
+#include "test.h"
+#include "testutil.h"
+#include "memdebug.h"
+
+#define MULTI_PERFORM_HANG_TIMEOUT 60 * 1000
+
+#define UPLOADTHIS "this is the blurb we want to upload\n"
+
+static size_t readcallback(void *ptr,
+ size_t size,
+ size_t nmemb,
+ void *clientp)
+{
+ int *counter = (int *)clientp;
+
+ if(*counter) {
+ /* only do this once and then require a clearing of this */
+ fprintf(stderr, "READ ALREADY DONE!\n");
+ return 0;
+ }
+ (*counter)++; /* bump */
+
+ if(size * nmemb > strlen(UPLOADTHIS)) {
+ fprintf(stderr, "READ!\n");
+ strcpy(ptr, UPLOADTHIS);
+ return strlen(UPLOADTHIS);
+ }
+ fprintf(stderr, "READ NOT FINE!\n");
+ return 0;
+}
+static curlioerr ioctlcallback(CURL *handle,
+ int cmd,
+ void *clientp)
+{
+ int *counter = (int *)clientp;
+ (void)handle; /* unused */
+ if(cmd == CURLIOCMD_RESTARTREAD) {
+ fprintf(stderr, "REWIND!\n");
+ *counter = 0; /* clear counter to make the read callback restart */
+ }
+ return CURLIOE_OK;
+}
+
+
+int test(char *URL)
+{
+ int res;
+ CURL *curl;
+ int counter=0;
+ CURLM *m = NULL;
+ int running=1;
+ struct timeval mp_start;
+ char mp_timedout = FALSE;
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ test_setopt(curl, CURLOPT_URL, URL);
+ test_setopt(curl, CURLOPT_VERBOSE, 1L);
+ test_setopt(curl, CURLOPT_HEADER, 1L);
+
+ /* read the POST data from a callback */
+ test_setopt(curl, CURLOPT_IOCTLFUNCTION, ioctlcallback);
+ test_setopt(curl, CURLOPT_IOCTLDATA, &counter);
+ test_setopt(curl, CURLOPT_READFUNCTION, readcallback);
+ test_setopt(curl, CURLOPT_READDATA, &counter);
+ /* We CANNOT do the POST fine without setting the size (or choose chunked)! */
+ test_setopt(curl, CURLOPT_POSTFIELDSIZE, strlen(UPLOADTHIS));
+
+ test_setopt(curl, CURLOPT_POST, 1L);
+#ifdef CURL_DOES_CONVERSIONS
+ /* Convert the POST data to ASCII. */
+ test_setopt(curl, CURLOPT_TRANSFERTEXT, 1L);
+#endif
+ test_setopt(curl, CURLOPT_PROXY, libtest_arg2);
+ test_setopt(curl, CURLOPT_PROXYUSERPWD, libtest_arg3);
+ test_setopt(curl, CURLOPT_PROXYAUTH,
+ (long) (CURLAUTH_NTLM | CURLAUTH_DIGEST | CURLAUTH_BASIC) );
+
+ if ((m = curl_multi_init()) == NULL) {
+ fprintf(stderr, "curl_multi_init() failed\n");
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((res = (int)curl_multi_add_handle(m, curl)) != CURLM_OK) {
+ fprintf(stderr, "curl_multi_add_handle() failed, "
+ "with code %d\n", res);
+ curl_multi_cleanup(m);
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ mp_timedout = FALSE;
+ mp_start = tutil_tvnow();
+
+ while (running) {
+ res = (int)curl_multi_perform(m, &running);
+ if (tutil_tvdiff(tutil_tvnow(), mp_start) >
+ MULTI_PERFORM_HANG_TIMEOUT) {
+ mp_timedout = TRUE;
+ break;
+ }
+#ifdef TPF
+ sleep(1); /* avoid ctl-10 dump */
+#endif
+ if (running <= 0) {
+ fprintf(stderr, "nothing left running.\n");
+ break;
+ }
+ }
+
+ if (mp_timedout) {
+ if (mp_timedout) fprintf(stderr, "mp_timedout\n");
+ fprintf(stderr, "ABORTING TEST, since it seems "
+ "that it would have run forever.\n");
+ res = TEST_ERR_RUNS_FOREVER;
+ }
+
+test_cleanup:
+
+ if(m) {
+ curl_multi_remove_handle(m, curl);
+ curl_multi_cleanup(m);
+ }
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return res;
+}
+
diff --git a/tests/libtest/lib556.c b/tests/libtest/lib556.c
new file mode 100644
index 000000000..78d123baa
--- /dev/null
+++ b/tests/libtest/lib556.c
@@ -0,0 +1,91 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#include "memdebug.h"
+
+/* For Windows, mainly (may be moved in a config file?) */
+#ifndef STDIN_FILENO
+ #define STDIN_FILENO 0
+#endif
+#ifndef STDOUT_FILENO
+ #define STDOUT_FILENO 1
+#endif
+#ifndef STDERR_FILENO
+ #define STDERR_FILENO 2
+#endif
+
+int test(char *URL)
+{
+ CURLcode res;
+ CURL *curl;
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ test_setopt(curl, CURLOPT_URL, URL);
+ test_setopt(curl, CURLOPT_CONNECT_ONLY, 1L);
+
+ res = curl_easy_perform(curl);
+
+ if(!res) {
+ /* we are connected, now get a HTTP document the raw way */
+ const char *request =
+#ifdef CURL_DOES_CONVERSIONS
+ /* ASCII representation with escape sequences for non-ASCII platforms */
+ "\x47\x45\x54\x20\x2f\x35\x35\x36\x20\x48\x54\x54\x50\x2f\x31\x2e"
+ "\x32\x0d\x0a\x48\x6f\x73\x74\x3a\x20\x6e\x69\x6e\x6a\x61\x0d\x0a"
+ "\x0d\x0a";
+#else
+ "GET /556 HTTP/1.2\r\n"
+ "Host: ninja\r\n\r\n";
+#endif
+ size_t iolen;
+ char buf[1024];
+
+ res = curl_easy_send(curl, request, strlen(request), &iolen);
+
+ if(!res) {
+ /* we assume that sending always work */
+ size_t total=0;
+
+ do {
+ /* busy-read like crazy */
+ res = curl_easy_recv(curl, buf, 1024, &iolen);
+
+#ifdef TPF
+ sleep(1); /* avoid ctl-10 dump */
+#endif
+
+ if(iolen)
+ /* send received stuff to stdout */
+ write(STDOUT_FILENO, buf, iolen);
+ total += iolen;
+
+ } while(((res == CURLE_OK) || (res == CURLE_AGAIN)) && (total < 129));
+ }
+ }
+
+test_cleanup:
+
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return (int)res;
+}
+
diff --git a/tests/libtest/lib557.c b/tests/libtest/lib557.c
new file mode 100644
index 000000000..48ccaf38e
--- /dev/null
+++ b/tests/libtest/lib557.c
@@ -0,0 +1,1388 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+/*
+ * The purpose of this test is to minimally exercise libcurl's internal
+ * curl_m*printf formatting capabilities and handling of some data types.
+ */
+
+#include "test.h"
+
+#include <curl/mprintf.h>
+
+#include "memdebug.h"
+
+
+#if (CURL_SIZEOF_CURL_OFF_T > CURL_SIZEOF_LONG)
+# define MPRNT_SUFFIX_CURL_OFF_T LL
+#else
+# define MPRNT_SUFFIX_CURL_OFF_T L
+#endif
+
+
+#ifdef CURL_ISOCPP
+# define MPRNT_OFF_T_C_HELPER2(Val,Suffix) Val ## Suffix
+#else
+# define MPRNT_OFF_T_C_HELPER2(Val,Suffix) Val/**/Suffix
+#endif
+#define MPRNT_OFF_T_C_HELPER1(Val,Suffix) MPRNT_OFF_T_C_HELPER2(Val,Suffix)
+#define MPRNT_OFF_T_C(Val) MPRNT_OFF_T_C_HELPER1(Val,MPRNT_SUFFIX_CURL_OFF_T)
+
+
+#define BUFSZ 256
+#define USHORT_TESTS_ARRSZ 1 + 100
+#define SSHORT_TESTS_ARRSZ 1 + 100
+#define UINT_TESTS_ARRSZ 1 + 100
+#define SINT_TESTS_ARRSZ 1 + 100
+#define ULONG_TESTS_ARRSZ 1 + 100
+#define SLONG_TESTS_ARRSZ 1 + 100
+#define COFFT_TESTS_ARRSZ 1 + 100
+
+
+struct unsshort_st {
+ unsigned short num; /* unsigned short */
+ const char *expected; /* expected string */
+ char result[BUFSZ]; /* result string */
+};
+
+
+struct sigshort_st {
+ short num; /* signed short */
+ const char *expected; /* expected string */
+ char result[BUFSZ]; /* result string */
+};
+
+
+struct unsint_st {
+ unsigned int num; /* unsigned int */
+ const char *expected; /* expected string */
+ char result[BUFSZ]; /* result string */
+};
+
+
+struct sigint_st {
+ int num; /* signed int */
+ const char *expected; /* expected string */
+ char result[BUFSZ]; /* result string */
+};
+
+
+struct unslong_st {
+ unsigned long num; /* unsigned long */
+ const char *expected; /* expected string */
+ char result[BUFSZ]; /* result string */
+};
+
+
+struct siglong_st {
+ long num; /* signed long */
+ const char *expected; /* expected string */
+ char result[BUFSZ]; /* result string */
+};
+
+
+struct curloff_st {
+ curl_off_t num; /* curl_off_t */
+ const char *expected; /* expected string */
+ char result[BUFSZ]; /* result string */
+};
+
+
+static struct unsshort_st us_test[USHORT_TESTS_ARRSZ];
+static struct sigshort_st ss_test[SSHORT_TESTS_ARRSZ];
+static struct unsint_st ui_test[UINT_TESTS_ARRSZ];
+static struct sigint_st si_test[SINT_TESTS_ARRSZ];
+static struct unslong_st ul_test[ULONG_TESTS_ARRSZ];
+static struct siglong_st sl_test[SLONG_TESTS_ARRSZ];
+static struct curloff_st co_test[COFFT_TESTS_ARRSZ];
+
+
+static int test_unsigned_short_formatting(void)
+{
+ int i, j;
+ int num_ushort_tests;
+ int failed = 0;
+
+#if (SIZEOF_SHORT == 1)
+
+ i=1; us_test[i].num = 0xFFU; us_test[i].expected = "256";
+ i++; us_test[i].num = 0xF0U; us_test[i].expected = "240";
+ i++; us_test[i].num = 0x0FU; us_test[i].expected = "15";
+
+ i++; us_test[i].num = 0xE0U; us_test[i].expected = "224";
+ i++; us_test[i].num = 0x0EU; us_test[i].expected = "14";
+
+ i++; us_test[i].num = 0xC0U; us_test[i].expected = "192";
+ i++; us_test[i].num = 0x0CU; us_test[i].expected = "12";
+
+ i++; us_test[i].num = 0x01U; us_test[i].expected = "1";
+ i++; us_test[i].num = 0x00U; us_test[i].expected = "0";
+
+ num_ushort_tests = i;
+
+#elif (SIZEOF_SHORT == 2)
+
+ i=1; us_test[i].num = 0xFFFFU; us_test[i].expected = "65535";
+ i++; us_test[i].num = 0xFF00U; us_test[i].expected = "65280";
+ i++; us_test[i].num = 0x00FFU; us_test[i].expected = "255";
+
+ i++; us_test[i].num = 0xF000U; us_test[i].expected = "61440";
+ i++; us_test[i].num = 0x0F00U; us_test[i].expected = "3840";
+ i++; us_test[i].num = 0x00F0U; us_test[i].expected = "240";
+ i++; us_test[i].num = 0x000FU; us_test[i].expected = "15";
+
+ i++; us_test[i].num = 0xC000U; us_test[i].expected = "49152";
+ i++; us_test[i].num = 0x0C00U; us_test[i].expected = "3072";
+ i++; us_test[i].num = 0x00C0U; us_test[i].expected = "192";
+ i++; us_test[i].num = 0x000CU; us_test[i].expected = "12";
+
+ i++; us_test[i].num = 0x0001U; us_test[i].expected = "1";
+ i++; us_test[i].num = 0x0000U; us_test[i].expected = "0";
+
+ num_ushort_tests = i;
+
+#elif (SIZEOF_SHORT == 4)
+
+ i=1; us_test[i].num = 0xFFFFFFFFU; us_test[i].expected = "4294967295";
+ i++; us_test[i].num = 0xFFFF0000U; us_test[i].expected = "4294901760";
+ i++; us_test[i].num = 0x0000FFFFU; us_test[i].expected = "65535";
+
+ i++; us_test[i].num = 0xFF000000U; us_test[i].expected = "4278190080";
+ i++; us_test[i].num = 0x00FF0000U; us_test[i].expected = "16711680";
+ i++; us_test[i].num = 0x0000FF00U; us_test[i].expected = "65280";
+ i++; us_test[i].num = 0x000000FFU; us_test[i].expected = "255";
+
+ i++; us_test[i].num = 0xF0000000U; us_test[i].expected = "4026531840";
+ i++; us_test[i].num = 0x0F000000U; us_test[i].expected = "251658240";
+ i++; us_test[i].num = 0x00F00000U; us_test[i].expected = "15728640";
+ i++; us_test[i].num = 0x000F0000U; us_test[i].expected = "983040";
+ i++; us_test[i].num = 0x0000F000U; us_test[i].expected = "61440";
+ i++; us_test[i].num = 0x00000F00U; us_test[i].expected = "3840";
+ i++; us_test[i].num = 0x000000F0U; us_test[i].expected = "240";
+ i++; us_test[i].num = 0x0000000FU; us_test[i].expected = "15";
+
+ i++; us_test[i].num = 0xC0000000U; us_test[i].expected = "3221225472";
+ i++; us_test[i].num = 0x0C000000U; us_test[i].expected = "201326592";
+ i++; us_test[i].num = 0x00C00000U; us_test[i].expected = "12582912";
+ i++; us_test[i].num = 0x000C0000U; us_test[i].expected = "786432";
+ i++; us_test[i].num = 0x0000C000U; us_test[i].expected = "49152";
+ i++; us_test[i].num = 0x00000C00U; us_test[i].expected = "3072";
+ i++; us_test[i].num = 0x000000C0U; us_test[i].expected = "192";
+ i++; us_test[i].num = 0x0000000CU; us_test[i].expected = "12";
+
+ i++; us_test[i].num = 0x00000001U; us_test[i].expected = "1";
+ i++; us_test[i].num = 0x00000000U; us_test[i].expected = "0";
+
+ num_ushort_tests = i;
+
+#endif
+
+ for(i=1; i<=num_ushort_tests; i++) {
+
+ for(j=0; j<BUFSZ; j++)
+ us_test[i].result[j] = 'X';
+ us_test[i].result[BUFSZ-1] = '\0';
+
+ (void)curl_msprintf(us_test[i].result, "%hu", us_test[i].num);
+
+ if(memcmp(us_test[i].result,
+ us_test[i].expected,
+ strlen(us_test[i].expected))) {
+ printf("unsigned short test #%.2d: Failed (Expected: %s Got: %s)\n",
+ i, us_test[i].expected, us_test[i].result);
+ failed++;
+ }
+
+ }
+
+ if(!failed)
+ printf("All curl_mprintf() unsigned short tests OK!\n");
+ else
+ printf("Some curl_mprintf() unsigned short tests Failed!\n");
+
+ return failed;
+}
+
+
+static int test_signed_short_formatting(void)
+{
+ int i, j;
+ int num_sshort_tests;
+ int failed = 0;
+
+#if (SIZEOF_SHORT == 1)
+
+ i=1; ss_test[i].num = 0x7F; ss_test[i].expected = "127";
+
+ i++; ss_test[i].num = 0x70; ss_test[i].expected = "112";
+ i++; ss_test[i].num = 0x07; ss_test[i].expected = "7";
+
+ i++; ss_test[i].num = 0x50; ss_test[i].expected = "80";
+ i++; ss_test[i].num = 0x05; ss_test[i].expected = "5";
+
+ i++; ss_test[i].num = 0x01; ss_test[i].expected = "1";
+ i++; ss_test[i].num = 0x00; ss_test[i].expected = "0";
+
+ i++; ss_test[i].num = -0x7F -1; ss_test[i].expected = "-128";
+
+ i++; ss_test[i].num = -0x70 -1; ss_test[i].expected = "-113";
+ i++; ss_test[i].num = -0x07 -1; ss_test[i].expected = "-8";
+
+ i++; ss_test[i].num = -0x50 -1; ss_test[i].expected = "-81";
+ i++; ss_test[i].num = -0x05 -1; ss_test[i].expected = "-6";
+
+ i++; ss_test[i].num = 0x00 -1; ss_test[i].expected = "-1";
+
+ num_sshort_tests = i;
+
+#elif (SIZEOF_SHORT == 2)
+
+ i=1; ss_test[i].num = 0x7FFF; ss_test[i].expected = "32767";
+ i++; ss_test[i].num = 0x7FFE; ss_test[i].expected = "32766";
+ i++; ss_test[i].num = 0x7FFD; ss_test[i].expected = "32765";
+ i++; ss_test[i].num = 0x7F00; ss_test[i].expected = "32512";
+ i++; ss_test[i].num = 0x07F0; ss_test[i].expected = "2032";
+ i++; ss_test[i].num = 0x007F; ss_test[i].expected = "127";
+
+ i++; ss_test[i].num = 0x7000; ss_test[i].expected = "28672";
+ i++; ss_test[i].num = 0x0700; ss_test[i].expected = "1792";
+ i++; ss_test[i].num = 0x0070; ss_test[i].expected = "112";
+ i++; ss_test[i].num = 0x0007; ss_test[i].expected = "7";
+
+ i++; ss_test[i].num = 0x5000; ss_test[i].expected = "20480";
+ i++; ss_test[i].num = 0x0500; ss_test[i].expected = "1280";
+ i++; ss_test[i].num = 0x0050; ss_test[i].expected = "80";
+ i++; ss_test[i].num = 0x0005; ss_test[i].expected = "5";
+
+ i++; ss_test[i].num = 0x0001; ss_test[i].expected = "1";
+ i++; ss_test[i].num = 0x0000; ss_test[i].expected = "0";
+
+ i++; ss_test[i].num = -0x7FFF -1; ss_test[i].expected = "-32768";
+ i++; ss_test[i].num = -0x7FFE -1; ss_test[i].expected = "-32767";
+ i++; ss_test[i].num = -0x7FFD -1; ss_test[i].expected = "-32766";
+ i++; ss_test[i].num = -0x7F00 -1; ss_test[i].expected = "-32513";
+ i++; ss_test[i].num = -0x07F0 -1; ss_test[i].expected = "-2033";
+ i++; ss_test[i].num = -0x007F -1; ss_test[i].expected = "-128";
+
+ i++; ss_test[i].num = -0x7000 -1; ss_test[i].expected = "-28673";
+ i++; ss_test[i].num = -0x0700 -1; ss_test[i].expected = "-1793";
+ i++; ss_test[i].num = -0x0070 -1; ss_test[i].expected = "-113";
+ i++; ss_test[i].num = -0x0007 -1; ss_test[i].expected = "-8";
+
+ i++; ss_test[i].num = -0x5000 -1; ss_test[i].expected = "-20481";
+ i++; ss_test[i].num = -0x0500 -1; ss_test[i].expected = "-1281";
+ i++; ss_test[i].num = -0x0050 -1; ss_test[i].expected = "-81";
+ i++; ss_test[i].num = -0x0005 -1; ss_test[i].expected = "-6";
+
+ i++; ss_test[i].num = 0x0000 -1; ss_test[i].expected = "-1";
+
+ num_sshort_tests = i;
+
+#elif (SIZEOF_SHORT == 4)
+
+ i=1; ss_test[i].num = 0x7FFFFFFF; ss_test[i].expected = "2147483647";
+ i++; ss_test[i].num = 0x7FFFFFFE; ss_test[i].expected = "2147483646";
+ i++; ss_test[i].num = 0x7FFFFFFD; ss_test[i].expected = "2147483645";
+ i++; ss_test[i].num = 0x7FFF0000; ss_test[i].expected = "2147418112";
+ i++; ss_test[i].num = 0x00007FFF; ss_test[i].expected = "32767";
+
+ i++; ss_test[i].num = 0x7F000000; ss_test[i].expected = "2130706432";
+ i++; ss_test[i].num = 0x007F0000; ss_test[i].expected = "8323072";
+ i++; ss_test[i].num = 0x00007F00; ss_test[i].expected = "32512";
+ i++; ss_test[i].num = 0x0000007F; ss_test[i].expected = "127";
+
+ i++; ss_test[i].num = 0x70000000; ss_test[i].expected = "1879048192";
+ i++; ss_test[i].num = 0x07000000; ss_test[i].expected = "117440512";
+ i++; ss_test[i].num = 0x00700000; ss_test[i].expected = "7340032";
+ i++; ss_test[i].num = 0x00070000; ss_test[i].expected = "458752";
+ i++; ss_test[i].num = 0x00007000; ss_test[i].expected = "28672";
+ i++; ss_test[i].num = 0x00000700; ss_test[i].expected = "1792";
+ i++; ss_test[i].num = 0x00000070; ss_test[i].expected = "112";
+ i++; ss_test[i].num = 0x00000007; ss_test[i].expected = "7";
+
+ i++; ss_test[i].num = 0x50000000; ss_test[i].expected = "1342177280";
+ i++; ss_test[i].num = 0x05000000; ss_test[i].expected = "83886080";
+ i++; ss_test[i].num = 0x00500000; ss_test[i].expected = "5242880";
+ i++; ss_test[i].num = 0x00050000; ss_test[i].expected = "327680";
+ i++; ss_test[i].num = 0x00005000; ss_test[i].expected = "20480";
+ i++; ss_test[i].num = 0x00000500; ss_test[i].expected = "1280";
+ i++; ss_test[i].num = 0x00000050; ss_test[i].expected = "80";
+ i++; ss_test[i].num = 0x00000005; ss_test[i].expected = "5";
+
+ i++; ss_test[i].num = 0x00000001; ss_test[i].expected = "1";
+ i++; ss_test[i].num = 0x00000000; ss_test[i].expected = "0";
+
+ i++; ss_test[i].num = -0x7FFFFFFF -1; ss_test[i].expected = "-2147483648";
+ i++; ss_test[i].num = -0x7FFFFFFE -1; ss_test[i].expected = "-2147483647";
+ i++; ss_test[i].num = -0x7FFFFFFD -1; ss_test[i].expected = "-2147483646";
+ i++; ss_test[i].num = -0x7FFF0000 -1; ss_test[i].expected = "-2147418113";
+ i++; ss_test[i].num = -0x00007FFF -1; ss_test[i].expected = "-32768";
+
+ i++; ss_test[i].num = -0x7F000000 -1; ss_test[i].expected = "-2130706433";
+ i++; ss_test[i].num = -0x007F0000 -1; ss_test[i].expected = "-8323073";
+ i++; ss_test[i].num = -0x00007F00 -1; ss_test[i].expected = "-32513";
+ i++; ss_test[i].num = -0x0000007F -1; ss_test[i].expected = "-128";
+
+ i++; ss_test[i].num = -0x70000000 -1; ss_test[i].expected = "-1879048193";
+ i++; ss_test[i].num = -0x07000000 -1; ss_test[i].expected = "-117440513";
+ i++; ss_test[i].num = -0x00700000 -1; ss_test[i].expected = "-7340033";
+ i++; ss_test[i].num = -0x00070000 -1; ss_test[i].expected = "-458753";
+ i++; ss_test[i].num = -0x00007000 -1; ss_test[i].expected = "-28673";
+ i++; ss_test[i].num = -0x00000700 -1; ss_test[i].expected = "-1793";
+ i++; ss_test[i].num = -0x00000070 -1; ss_test[i].expected = "-113";
+ i++; ss_test[i].num = -0x00000007 -1; ss_test[i].expected = "-8";
+
+ i++; ss_test[i].num = -0x50000000 -1; ss_test[i].expected = "-1342177281";
+ i++; ss_test[i].num = -0x05000000 -1; ss_test[i].expected = "-83886081";
+ i++; ss_test[i].num = -0x00500000 -1; ss_test[i].expected = "-5242881";
+ i++; ss_test[i].num = -0x00050000 -1; ss_test[i].expected = "-327681";
+ i++; ss_test[i].num = -0x00005000 -1; ss_test[i].expected = "-20481";
+ i++; ss_test[i].num = -0x00000500 -1; ss_test[i].expected = "-1281";
+ i++; ss_test[i].num = -0x00000050 -1; ss_test[i].expected = "-81";
+ i++; ss_test[i].num = -0x00000005 -1; ss_test[i].expected = "-6";
+
+ i++; ss_test[i].num = 0x00000000 -1; ss_test[i].expected = "-1";
+
+ num_sshort_tests = i;
+
+#endif
+
+ for(i=1; i<=num_sshort_tests; i++) {
+
+ for(j=0; j<BUFSZ; j++)
+ ss_test[i].result[j] = 'X';
+ ss_test[i].result[BUFSZ-1] = '\0';
+
+ (void)curl_msprintf(ss_test[i].result, "%hd", ss_test[i].num);
+
+ if(memcmp(ss_test[i].result,
+ ss_test[i].expected,
+ strlen(ss_test[i].expected))) {
+ printf("signed short test #%.2d: Failed (Expected: %s Got: %s)\n",
+ i, ss_test[i].expected, ss_test[i].result);
+ failed++;
+ }
+
+ }
+
+ if(!failed)
+ printf("All curl_mprintf() signed short tests OK!\n");
+ else
+ printf("Some curl_mprintf() signed short tests Failed!\n");
+
+ return failed;
+}
+
+
+static int test_unsigned_int_formatting(void)
+{
+ int i, j;
+ int num_uint_tests;
+ int failed = 0;
+
+#if (SIZEOF_INT == 2)
+
+ i=1; ui_test[i].num = 0xFFFFU; ui_test[i].expected = "65535";
+ i++; ui_test[i].num = 0xFF00U; ui_test[i].expected = "65280";
+ i++; ui_test[i].num = 0x00FFU; ui_test[i].expected = "255";
+
+ i++; ui_test[i].num = 0xF000U; ui_test[i].expected = "61440";
+ i++; ui_test[i].num = 0x0F00U; ui_test[i].expected = "3840";
+ i++; ui_test[i].num = 0x00F0U; ui_test[i].expected = "240";
+ i++; ui_test[i].num = 0x000FU; ui_test[i].expected = "15";
+
+ i++; ui_test[i].num = 0xC000U; ui_test[i].expected = "49152";
+ i++; ui_test[i].num = 0x0C00U; ui_test[i].expected = "3072";
+ i++; ui_test[i].num = 0x00C0U; ui_test[i].expected = "192";
+ i++; ui_test[i].num = 0x000CU; ui_test[i].expected = "12";
+
+ i++; ui_test[i].num = 0x0001U; ui_test[i].expected = "1";
+ i++; ui_test[i].num = 0x0000U; ui_test[i].expected = "0";
+
+ num_uint_tests = i;
+
+#elif (SIZEOF_INT == 4)
+
+ i=1; ui_test[i].num = 0xFFFFFFFFU; ui_test[i].expected = "4294967295";
+ i++; ui_test[i].num = 0xFFFF0000U; ui_test[i].expected = "4294901760";
+ i++; ui_test[i].num = 0x0000FFFFU; ui_test[i].expected = "65535";
+
+ i++; ui_test[i].num = 0xFF000000U; ui_test[i].expected = "4278190080";
+ i++; ui_test[i].num = 0x00FF0000U; ui_test[i].expected = "16711680";
+ i++; ui_test[i].num = 0x0000FF00U; ui_test[i].expected = "65280";
+ i++; ui_test[i].num = 0x000000FFU; ui_test[i].expected = "255";
+
+ i++; ui_test[i].num = 0xF0000000U; ui_test[i].expected = "4026531840";
+ i++; ui_test[i].num = 0x0F000000U; ui_test[i].expected = "251658240";
+ i++; ui_test[i].num = 0x00F00000U; ui_test[i].expected = "15728640";
+ i++; ui_test[i].num = 0x000F0000U; ui_test[i].expected = "983040";
+ i++; ui_test[i].num = 0x0000F000U; ui_test[i].expected = "61440";
+ i++; ui_test[i].num = 0x00000F00U; ui_test[i].expected = "3840";
+ i++; ui_test[i].num = 0x000000F0U; ui_test[i].expected = "240";
+ i++; ui_test[i].num = 0x0000000FU; ui_test[i].expected = "15";
+
+ i++; ui_test[i].num = 0xC0000000U; ui_test[i].expected = "3221225472";
+ i++; ui_test[i].num = 0x0C000000U; ui_test[i].expected = "201326592";
+ i++; ui_test[i].num = 0x00C00000U; ui_test[i].expected = "12582912";
+ i++; ui_test[i].num = 0x000C0000U; ui_test[i].expected = "786432";
+ i++; ui_test[i].num = 0x0000C000U; ui_test[i].expected = "49152";
+ i++; ui_test[i].num = 0x00000C00U; ui_test[i].expected = "3072";
+ i++; ui_test[i].num = 0x000000C0U; ui_test[i].expected = "192";
+ i++; ui_test[i].num = 0x0000000CU; ui_test[i].expected = "12";
+
+ i++; ui_test[i].num = 0x00000001U; ui_test[i].expected = "1";
+ i++; ui_test[i].num = 0x00000000U; ui_test[i].expected = "0";
+
+ num_uint_tests = i;
+
+#elif (SIZEOF_INT == 8)
+
+ i=1; ui_test[i].num = 0xFFFFFFFFFFFFFFFFU; ui_test[i].expected = "18446744073709551615";
+ i++; ui_test[i].num = 0xFFFFFFFF00000000U; ui_test[i].expected = "18446744069414584320";
+ i++; ui_test[i].num = 0x00000000FFFFFFFFU; ui_test[i].expected = "4294967295";
+
+ i++; ui_test[i].num = 0xFFFF000000000000U; ui_test[i].expected = "18446462598732840960";
+ i++; ui_test[i].num = 0x0000FFFF00000000U; ui_test[i].expected = "281470681743360";
+ i++; ui_test[i].num = 0x00000000FFFF0000U; ui_test[i].expected = "4294901760";
+ i++; ui_test[i].num = 0x000000000000FFFFU; ui_test[i].expected = "65535";
+
+ i++; ui_test[i].num = 0xFF00000000000000U; ui_test[i].expected = "18374686479671623680";
+ i++; ui_test[i].num = 0x00FF000000000000U; ui_test[i].expected = "71776119061217280";
+ i++; ui_test[i].num = 0x0000FF0000000000U; ui_test[i].expected = "280375465082880";
+ i++; ui_test[i].num = 0x000000FF00000000U; ui_test[i].expected = "1095216660480";
+ i++; ui_test[i].num = 0x00000000FF000000U; ui_test[i].expected = "4278190080";
+ i++; ui_test[i].num = 0x0000000000FF0000U; ui_test[i].expected = "16711680";
+ i++; ui_test[i].num = 0x000000000000FF00U; ui_test[i].expected = "65280";
+ i++; ui_test[i].num = 0x00000000000000FFU; ui_test[i].expected = "255";
+
+ i++; ui_test[i].num = 0xF000000000000000U; ui_test[i].expected = "17293822569102704640";
+ i++; ui_test[i].num = 0x0F00000000000000U; ui_test[i].expected = "1080863910568919040";
+ i++; ui_test[i].num = 0x00F0000000000000U; ui_test[i].expected = "67553994410557440";
+ i++; ui_test[i].num = 0x000F000000000000U; ui_test[i].expected = "4222124650659840";
+ i++; ui_test[i].num = 0x0000F00000000000U; ui_test[i].expected = "263882790666240";
+ i++; ui_test[i].num = 0x00000F0000000000U; ui_test[i].expected = "16492674416640";
+ i++; ui_test[i].num = 0x000000F000000000U; ui_test[i].expected = "1030792151040";
+ i++; ui_test[i].num = 0x0000000F00000000U; ui_test[i].expected = "64424509440";
+ i++; ui_test[i].num = 0x00000000F0000000U; ui_test[i].expected = "4026531840";
+ i++; ui_test[i].num = 0x000000000F000000U; ui_test[i].expected = "251658240";
+ i++; ui_test[i].num = 0x0000000000F00000U; ui_test[i].expected = "15728640";
+ i++; ui_test[i].num = 0x00000000000F0000U; ui_test[i].expected = "983040";
+ i++; ui_test[i].num = 0x000000000000F000U; ui_test[i].expected = "61440";
+ i++; ui_test[i].num = 0x0000000000000F00U; ui_test[i].expected = "3840";
+ i++; ui_test[i].num = 0x00000000000000F0U; ui_test[i].expected = "240";
+ i++; ui_test[i].num = 0x000000000000000FU; ui_test[i].expected = "15";
+
+ i++; ui_test[i].num = 0xC000000000000000U; ui_test[i].expected = "13835058055282163712";
+ i++; ui_test[i].num = 0x0C00000000000000U; ui_test[i].expected = "864691128455135232";
+ i++; ui_test[i].num = 0x00C0000000000000U; ui_test[i].expected = "54043195528445952";
+ i++; ui_test[i].num = 0x000C000000000000U; ui_test[i].expected = "3377699720527872";
+ i++; ui_test[i].num = 0x0000C00000000000U; ui_test[i].expected = "211106232532992";
+ i++; ui_test[i].num = 0x00000C0000000000U; ui_test[i].expected = "13194139533312";
+ i++; ui_test[i].num = 0x000000C000000000U; ui_test[i].expected = "824633720832";
+ i++; ui_test[i].num = 0x0000000C00000000U; ui_test[i].expected = "51539607552";
+ i++; ui_test[i].num = 0x00000000C0000000U; ui_test[i].expected = "3221225472";
+ i++; ui_test[i].num = 0x000000000C000000U; ui_test[i].expected = "201326592";
+ i++; ui_test[i].num = 0x0000000000C00000U; ui_test[i].expected = "12582912";
+ i++; ui_test[i].num = 0x00000000000C0000U; ui_test[i].expected = "786432";
+ i++; ui_test[i].num = 0x000000000000C000U; ui_test[i].expected = "49152";
+ i++; ui_test[i].num = 0x0000000000000C00U; ui_test[i].expected = "3072";
+ i++; ui_test[i].num = 0x00000000000000C0U; ui_test[i].expected = "192";
+ i++; ui_test[i].num = 0x000000000000000CU; ui_test[i].expected = "12";
+
+ i++; ui_test[i].num = 0x00000001U; ui_test[i].expected = "1";
+ i++; ui_test[i].num = 0x00000000U; ui_test[i].expected = "0";
+
+ num_uint_tests = i;
+
+#endif
+
+ for(i=1; i<=num_uint_tests; i++) {
+
+ for(j=0; j<BUFSZ; j++)
+ ui_test[i].result[j] = 'X';
+ ui_test[i].result[BUFSZ-1] = '\0';
+
+ (void)curl_msprintf(ui_test[i].result, "%u", ui_test[i].num);
+
+ if(memcmp(ui_test[i].result,
+ ui_test[i].expected,
+ strlen(ui_test[i].expected))) {
+ printf("unsigned int test #%.2d: Failed (Expected: %s Got: %s)\n",
+ i, ui_test[i].expected, ui_test[i].result);
+ failed++;
+ }
+
+ }
+
+ if(!failed)
+ printf("All curl_mprintf() unsigned int tests OK!\n");
+ else
+ printf("Some curl_mprintf() unsigned int tests Failed!\n");
+
+ return failed;
+}
+
+
+static int test_signed_int_formatting(void)
+{
+ int i, j;
+ int num_sint_tests;
+ int failed = 0;
+
+#if (SIZEOF_INT == 2)
+
+ i=1; si_test[i].num = 0x7FFF; si_test[i].expected = "32767";
+ i++; si_test[i].num = 0x7FFE; si_test[i].expected = "32766";
+ i++; si_test[i].num = 0x7FFD; si_test[i].expected = "32765";
+ i++; si_test[i].num = 0x7F00; si_test[i].expected = "32512";
+ i++; si_test[i].num = 0x07F0; si_test[i].expected = "2032";
+ i++; si_test[i].num = 0x007F; si_test[i].expected = "127";
+
+ i++; si_test[i].num = 0x7000; si_test[i].expected = "28672";
+ i++; si_test[i].num = 0x0700; si_test[i].expected = "1792";
+ i++; si_test[i].num = 0x0070; si_test[i].expected = "112";
+ i++; si_test[i].num = 0x0007; si_test[i].expected = "7";
+
+ i++; si_test[i].num = 0x5000; si_test[i].expected = "20480";
+ i++; si_test[i].num = 0x0500; si_test[i].expected = "1280";
+ i++; si_test[i].num = 0x0050; si_test[i].expected = "80";
+ i++; si_test[i].num = 0x0005; si_test[i].expected = "5";
+
+ i++; si_test[i].num = 0x0001; si_test[i].expected = "1";
+ i++; si_test[i].num = 0x0000; si_test[i].expected = "0";
+
+ i++; si_test[i].num = -0x7FFF -1; si_test[i].expected = "-32768";
+ i++; si_test[i].num = -0x7FFE -1; si_test[i].expected = "-32767";
+ i++; si_test[i].num = -0x7FFD -1; si_test[i].expected = "-32766";
+ i++; si_test[i].num = -0x7F00 -1; si_test[i].expected = "-32513";
+ i++; si_test[i].num = -0x07F0 -1; si_test[i].expected = "-2033";
+ i++; si_test[i].num = -0x007F -1; si_test[i].expected = "-128";
+
+ i++; si_test[i].num = -0x7000 -1; si_test[i].expected = "-28673";
+ i++; si_test[i].num = -0x0700 -1; si_test[i].expected = "-1793";
+ i++; si_test[i].num = -0x0070 -1; si_test[i].expected = "-113";
+ i++; si_test[i].num = -0x0007 -1; si_test[i].expected = "-8";
+
+ i++; si_test[i].num = -0x5000 -1; si_test[i].expected = "-20481";
+ i++; si_test[i].num = -0x0500 -1; si_test[i].expected = "-1281";
+ i++; si_test[i].num = -0x0050 -1; si_test[i].expected = "-81";
+ i++; si_test[i].num = -0x0005 -1; si_test[i].expected = "-6";
+
+ i++; si_test[i].num = 0x0000 -1; si_test[i].expected = "-1";
+
+ num_sint_tests = i;
+
+#elif (SIZEOF_INT == 4)
+
+ i=1; si_test[i].num = 0x7FFFFFFF; si_test[i].expected = "2147483647";
+ i++; si_test[i].num = 0x7FFFFFFE; si_test[i].expected = "2147483646";
+ i++; si_test[i].num = 0x7FFFFFFD; si_test[i].expected = "2147483645";
+ i++; si_test[i].num = 0x7FFF0000; si_test[i].expected = "2147418112";
+ i++; si_test[i].num = 0x00007FFF; si_test[i].expected = "32767";
+
+ i++; si_test[i].num = 0x7F000000; si_test[i].expected = "2130706432";
+ i++; si_test[i].num = 0x007F0000; si_test[i].expected = "8323072";
+ i++; si_test[i].num = 0x00007F00; si_test[i].expected = "32512";
+ i++; si_test[i].num = 0x0000007F; si_test[i].expected = "127";
+
+ i++; si_test[i].num = 0x70000000; si_test[i].expected = "1879048192";
+ i++; si_test[i].num = 0x07000000; si_test[i].expected = "117440512";
+ i++; si_test[i].num = 0x00700000; si_test[i].expected = "7340032";
+ i++; si_test[i].num = 0x00070000; si_test[i].expected = "458752";
+ i++; si_test[i].num = 0x00007000; si_test[i].expected = "28672";
+ i++; si_test[i].num = 0x00000700; si_test[i].expected = "1792";
+ i++; si_test[i].num = 0x00000070; si_test[i].expected = "112";
+ i++; si_test[i].num = 0x00000007; si_test[i].expected = "7";
+
+ i++; si_test[i].num = 0x50000000; si_test[i].expected = "1342177280";
+ i++; si_test[i].num = 0x05000000; si_test[i].expected = "83886080";
+ i++; si_test[i].num = 0x00500000; si_test[i].expected = "5242880";
+ i++; si_test[i].num = 0x00050000; si_test[i].expected = "327680";
+ i++; si_test[i].num = 0x00005000; si_test[i].expected = "20480";
+ i++; si_test[i].num = 0x00000500; si_test[i].expected = "1280";
+ i++; si_test[i].num = 0x00000050; si_test[i].expected = "80";
+ i++; si_test[i].num = 0x00000005; si_test[i].expected = "5";
+
+ i++; si_test[i].num = 0x00000001; si_test[i].expected = "1";
+ i++; si_test[i].num = 0x00000000; si_test[i].expected = "0";
+
+ i++; si_test[i].num = -0x7FFFFFFF -1; si_test[i].expected = "-2147483648";
+ i++; si_test[i].num = -0x7FFFFFFE -1; si_test[i].expected = "-2147483647";
+ i++; si_test[i].num = -0x7FFFFFFD -1; si_test[i].expected = "-2147483646";
+ i++; si_test[i].num = -0x7FFF0000 -1; si_test[i].expected = "-2147418113";
+ i++; si_test[i].num = -0x00007FFF -1; si_test[i].expected = "-32768";
+
+ i++; si_test[i].num = -0x7F000000 -1; si_test[i].expected = "-2130706433";
+ i++; si_test[i].num = -0x007F0000 -1; si_test[i].expected = "-8323073";
+ i++; si_test[i].num = -0x00007F00 -1; si_test[i].expected = "-32513";
+ i++; si_test[i].num = -0x0000007F -1; si_test[i].expected = "-128";
+
+ i++; si_test[i].num = -0x70000000 -1; si_test[i].expected = "-1879048193";
+ i++; si_test[i].num = -0x07000000 -1; si_test[i].expected = "-117440513";
+ i++; si_test[i].num = -0x00700000 -1; si_test[i].expected = "-7340033";
+ i++; si_test[i].num = -0x00070000 -1; si_test[i].expected = "-458753";
+ i++; si_test[i].num = -0x00007000 -1; si_test[i].expected = "-28673";
+ i++; si_test[i].num = -0x00000700 -1; si_test[i].expected = "-1793";
+ i++; si_test[i].num = -0x00000070 -1; si_test[i].expected = "-113";
+ i++; si_test[i].num = -0x00000007 -1; si_test[i].expected = "-8";
+
+ i++; si_test[i].num = -0x50000000 -1; si_test[i].expected = "-1342177281";
+ i++; si_test[i].num = -0x05000000 -1; si_test[i].expected = "-83886081";
+ i++; si_test[i].num = -0x00500000 -1; si_test[i].expected = "-5242881";
+ i++; si_test[i].num = -0x00050000 -1; si_test[i].expected = "-327681";
+ i++; si_test[i].num = -0x00005000 -1; si_test[i].expected = "-20481";
+ i++; si_test[i].num = -0x00000500 -1; si_test[i].expected = "-1281";
+ i++; si_test[i].num = -0x00000050 -1; si_test[i].expected = "-81";
+ i++; si_test[i].num = -0x00000005 -1; si_test[i].expected = "-6";
+
+ i++; si_test[i].num = 0x00000000 -1; si_test[i].expected = "-1";
+
+ num_sint_tests = i;
+
+#elif (SIZEOF_INT == 8)
+
+ i=1; si_test[i].num = 0x7FFFFFFFFFFFFFFF; si_test[i].expected = "9223372036854775807";
+ i++; si_test[i].num = 0x7FFFFFFFFFFFFFFE; si_test[i].expected = "9223372036854775806";
+ i++; si_test[i].num = 0x7FFFFFFFFFFFFFFD; si_test[i].expected = "9223372036854775805";
+ i++; si_test[i].num = 0x7FFFFFFF00000000; si_test[i].expected = "9223372032559808512";
+ i++; si_test[i].num = 0x000000007FFFFFFF; si_test[i].expected = "2147483647";
+
+ i++; si_test[i].num = 0x7FFF000000000000; si_test[i].expected = "9223090561878065152";
+ i++; si_test[i].num = 0x00007FFF00000000; si_test[i].expected = "140733193388032";
+ i++; si_test[i].num = 0x000000007FFF0000; si_test[i].expected = "2147418112";
+ i++; si_test[i].num = 0x0000000000007FFF; si_test[i].expected = "32767";
+
+ i++; si_test[i].num = 0x7F00000000000000; si_test[i].expected = "9151314442816847872";
+ i++; si_test[i].num = 0x007F000000000000; si_test[i].expected = "35747322042253312";
+ i++; si_test[i].num = 0x00007F0000000000; si_test[i].expected = "139637976727552";
+ i++; si_test[i].num = 0x0000007F00000000; si_test[i].expected = "545460846592";
+ i++; si_test[i].num = 0x000000007F000000; si_test[i].expected = "2130706432";
+ i++; si_test[i].num = 0x00000000007F0000; si_test[i].expected = "8323072";
+ i++; si_test[i].num = 0x0000000000007F00; si_test[i].expected = "32512";
+ i++; si_test[i].num = 0x000000000000007F; si_test[i].expected = "127";
+
+ i++; si_test[i].num = 0x7000000000000000; si_test[i].expected = "8070450532247928832";
+ i++; si_test[i].num = 0x0700000000000000; si_test[i].expected = "504403158265495552";
+ i++; si_test[i].num = 0x0070000000000000; si_test[i].expected = "31525197391593472";
+ i++; si_test[i].num = 0x0007000000000000; si_test[i].expected = "1970324836974592";
+ i++; si_test[i].num = 0x0000700000000000; si_test[i].expected = "123145302310912";
+ i++; si_test[i].num = 0x0000070000000000; si_test[i].expected = "7696581394432";
+ i++; si_test[i].num = 0x0000007000000000; si_test[i].expected = "481036337152";
+ i++; si_test[i].num = 0x0000000700000000; si_test[i].expected = "30064771072";
+ i++; si_test[i].num = 0x0000000070000000; si_test[i].expected = "1879048192";
+ i++; si_test[i].num = 0x0000000007000000; si_test[i].expected = "117440512";
+ i++; si_test[i].num = 0x0000000000700000; si_test[i].expected = "7340032";
+ i++; si_test[i].num = 0x0000000000070000; si_test[i].expected = "458752";
+ i++; si_test[i].num = 0x0000000000007000; si_test[i].expected = "28672";
+ i++; si_test[i].num = 0x0000000000000700; si_test[i].expected = "1792";
+ i++; si_test[i].num = 0x0000000000000070; si_test[i].expected = "112";
+ i++; si_test[i].num = 0x0000000000000007; si_test[i].expected = "7";
+
+ i++; si_test[i].num = 0x0000000000000001; si_test[i].expected = "1";
+ i++; si_test[i].num = 0x0000000000000000; si_test[i].expected = "0";
+
+ i++; si_test[i].num = -0x7FFFFFFFFFFFFFFF -1; si_test[i].expected = "-9223372036854775808";
+ i++; si_test[i].num = -0x7FFFFFFFFFFFFFFE -1; si_test[i].expected = "-9223372036854775807";
+ i++; si_test[i].num = -0x7FFFFFFFFFFFFFFD -1; si_test[i].expected = "-9223372036854775806";
+ i++; si_test[i].num = -0x7FFFFFFF00000000 -1; si_test[i].expected = "-9223372032559808513";
+ i++; si_test[i].num = -0x000000007FFFFFFF -1; si_test[i].expected = "-2147483648";
+
+ i++; si_test[i].num = -0x7FFF000000000000 -1; si_test[i].expected = "-9223090561878065153";
+ i++; si_test[i].num = -0x00007FFF00000000 -1; si_test[i].expected = "-140733193388033";
+ i++; si_test[i].num = -0x000000007FFF0000 -1; si_test[i].expected = "-2147418113";
+ i++; si_test[i].num = -0x0000000000007FFF -1; si_test[i].expected = "-32768";
+
+ i++; si_test[i].num = -0x7F00000000000000 -1; si_test[i].expected = "-9151314442816847873";
+ i++; si_test[i].num = -0x007F000000000000 -1; si_test[i].expected = "-35747322042253313";
+ i++; si_test[i].num = -0x00007F0000000000 -1; si_test[i].expected = "-139637976727553";
+ i++; si_test[i].num = -0x0000007F00000000 -1; si_test[i].expected = "-545460846593";
+ i++; si_test[i].num = -0x000000007F000000 -1; si_test[i].expected = "-2130706433";
+ i++; si_test[i].num = -0x00000000007F0000 -1; si_test[i].expected = "-8323073";
+ i++; si_test[i].num = -0x0000000000007F00 -1; si_test[i].expected = "-32513";
+ i++; si_test[i].num = -0x000000000000007F -1; si_test[i].expected = "-128";
+
+ i++; si_test[i].num = -0x7000000000000000 -1; si_test[i].expected = "-8070450532247928833";
+ i++; si_test[i].num = -0x0700000000000000 -1; si_test[i].expected = "-504403158265495553";
+ i++; si_test[i].num = -0x0070000000000000 -1; si_test[i].expected = "-31525197391593473";
+ i++; si_test[i].num = -0x0007000000000000 -1; si_test[i].expected = "-1970324836974593";
+ i++; si_test[i].num = -0x0000700000000000 -1; si_test[i].expected = "-123145302310913";
+ i++; si_test[i].num = -0x0000070000000000 -1; si_test[i].expected = "-7696581394433";
+ i++; si_test[i].num = -0x0000007000000000 -1; si_test[i].expected = "-481036337153";
+ i++; si_test[i].num = -0x0000000700000000 -1; si_test[i].expected = "-30064771073";
+ i++; si_test[i].num = -0x0000000070000000 -1; si_test[i].expected = "-1879048193";
+ i++; si_test[i].num = -0x0000000007000000 -1; si_test[i].expected = "-117440513";
+ i++; si_test[i].num = -0x0000000000700000 -1; si_test[i].expected = "-7340033";
+ i++; si_test[i].num = -0x0000000000070000 -1; si_test[i].expected = "-458753";
+ i++; si_test[i].num = -0x0000000000007000 -1; si_test[i].expected = "-28673";
+ i++; si_test[i].num = -0x0000000000000700 -1; si_test[i].expected = "-1793";
+ i++; si_test[i].num = -0x0000000000000070 -1; si_test[i].expected = "-113";
+ i++; si_test[i].num = -0x0000000000000007 -1; si_test[i].expected = "-8";
+
+ i++; si_test[i].num = 0x0000000000000000 -1; si_test[i].expected = "-1";
+
+ num_sint_tests = i;
+
+#endif
+
+ for(i=1; i<=num_sint_tests; i++) {
+
+ for(j=0; j<BUFSZ; j++)
+ si_test[i].result[j] = 'X';
+ si_test[i].result[BUFSZ-1] = '\0';
+
+ (void)curl_msprintf(si_test[i].result, "%d", si_test[i].num);
+
+ if(memcmp(si_test[i].result,
+ si_test[i].expected,
+ strlen(si_test[i].expected))) {
+ printf("signed int test #%.2d: Failed (Expected: %s Got: %s)\n",
+ i, si_test[i].expected, si_test[i].result);
+ failed++;
+ }
+
+ }
+
+ if(!failed)
+ printf("All curl_mprintf() signed int tests OK!\n");
+ else
+ printf("Some curl_mprintf() signed int tests Failed!\n");
+
+ return failed;
+}
+
+
+static int test_unsigned_long_formatting(void)
+{
+ int i, j;
+ int num_ulong_tests;
+ int failed = 0;
+
+#if (CURL_SIZEOF_LONG == 2)
+
+ i=1; ul_test[i].num = 0xFFFFUL; ul_test[i].expected = "65535";
+ i++; ul_test[i].num = 0xFF00UL; ul_test[i].expected = "65280";
+ i++; ul_test[i].num = 0x00FFUL; ul_test[i].expected = "255";
+
+ i++; ul_test[i].num = 0xF000UL; ul_test[i].expected = "61440";
+ i++; ul_test[i].num = 0x0F00UL; ul_test[i].expected = "3840";
+ i++; ul_test[i].num = 0x00F0UL; ul_test[i].expected = "240";
+ i++; ul_test[i].num = 0x000FUL; ul_test[i].expected = "15";
+
+ i++; ul_test[i].num = 0xC000UL; ul_test[i].expected = "49152";
+ i++; ul_test[i].num = 0x0C00UL; ul_test[i].expected = "3072";
+ i++; ul_test[i].num = 0x00C0UL; ul_test[i].expected = "192";
+ i++; ul_test[i].num = 0x000CUL; ul_test[i].expected = "12";
+
+ i++; ul_test[i].num = 0x0001UL; ul_test[i].expected = "1";
+ i++; ul_test[i].num = 0x0000UL; ul_test[i].expected = "0";
+
+ num_ulong_tests = i;
+
+#elif (CURL_SIZEOF_LONG == 4)
+
+ i=1; ul_test[i].num = 0xFFFFFFFFUL; ul_test[i].expected = "4294967295";
+ i++; ul_test[i].num = 0xFFFF0000UL; ul_test[i].expected = "4294901760";
+ i++; ul_test[i].num = 0x0000FFFFUL; ul_test[i].expected = "65535";
+
+ i++; ul_test[i].num = 0xFF000000UL; ul_test[i].expected = "4278190080";
+ i++; ul_test[i].num = 0x00FF0000UL; ul_test[i].expected = "16711680";
+ i++; ul_test[i].num = 0x0000FF00UL; ul_test[i].expected = "65280";
+ i++; ul_test[i].num = 0x000000FFUL; ul_test[i].expected = "255";
+
+ i++; ul_test[i].num = 0xF0000000UL; ul_test[i].expected = "4026531840";
+ i++; ul_test[i].num = 0x0F000000UL; ul_test[i].expected = "251658240";
+ i++; ul_test[i].num = 0x00F00000UL; ul_test[i].expected = "15728640";
+ i++; ul_test[i].num = 0x000F0000UL; ul_test[i].expected = "983040";
+ i++; ul_test[i].num = 0x0000F000UL; ul_test[i].expected = "61440";
+ i++; ul_test[i].num = 0x00000F00UL; ul_test[i].expected = "3840";
+ i++; ul_test[i].num = 0x000000F0UL; ul_test[i].expected = "240";
+ i++; ul_test[i].num = 0x0000000FUL; ul_test[i].expected = "15";
+
+ i++; ul_test[i].num = 0xC0000000UL; ul_test[i].expected = "3221225472";
+ i++; ul_test[i].num = 0x0C000000UL; ul_test[i].expected = "201326592";
+ i++; ul_test[i].num = 0x00C00000UL; ul_test[i].expected = "12582912";
+ i++; ul_test[i].num = 0x000C0000UL; ul_test[i].expected = "786432";
+ i++; ul_test[i].num = 0x0000C000UL; ul_test[i].expected = "49152";
+ i++; ul_test[i].num = 0x00000C00UL; ul_test[i].expected = "3072";
+ i++; ul_test[i].num = 0x000000C0UL; ul_test[i].expected = "192";
+ i++; ul_test[i].num = 0x0000000CUL; ul_test[i].expected = "12";
+
+ i++; ul_test[i].num = 0x00000001UL; ul_test[i].expected = "1";
+ i++; ul_test[i].num = 0x00000000UL; ul_test[i].expected = "0";
+
+ num_ulong_tests = i;
+
+#elif (CURL_SIZEOF_LONG == 8)
+
+ i=1; ul_test[i].num = 0xFFFFFFFFFFFFFFFFUL; ul_test[i].expected = "18446744073709551615";
+ i++; ul_test[i].num = 0xFFFFFFFF00000000UL; ul_test[i].expected = "18446744069414584320";
+ i++; ul_test[i].num = 0x00000000FFFFFFFFUL; ul_test[i].expected = "4294967295";
+
+ i++; ul_test[i].num = 0xFFFF000000000000UL; ul_test[i].expected = "18446462598732840960";
+ i++; ul_test[i].num = 0x0000FFFF00000000UL; ul_test[i].expected = "281470681743360";
+ i++; ul_test[i].num = 0x00000000FFFF0000UL; ul_test[i].expected = "4294901760";
+ i++; ul_test[i].num = 0x000000000000FFFFUL; ul_test[i].expected = "65535";
+
+ i++; ul_test[i].num = 0xFF00000000000000UL; ul_test[i].expected = "18374686479671623680";
+ i++; ul_test[i].num = 0x00FF000000000000UL; ul_test[i].expected = "71776119061217280";
+ i++; ul_test[i].num = 0x0000FF0000000000UL; ul_test[i].expected = "280375465082880";
+ i++; ul_test[i].num = 0x000000FF00000000UL; ul_test[i].expected = "1095216660480";
+ i++; ul_test[i].num = 0x00000000FF000000UL; ul_test[i].expected = "4278190080";
+ i++; ul_test[i].num = 0x0000000000FF0000UL; ul_test[i].expected = "16711680";
+ i++; ul_test[i].num = 0x000000000000FF00UL; ul_test[i].expected = "65280";
+ i++; ul_test[i].num = 0x00000000000000FFUL; ul_test[i].expected = "255";
+
+ i++; ul_test[i].num = 0xF000000000000000UL; ul_test[i].expected = "17293822569102704640";
+ i++; ul_test[i].num = 0x0F00000000000000UL; ul_test[i].expected = "1080863910568919040";
+ i++; ul_test[i].num = 0x00F0000000000000UL; ul_test[i].expected = "67553994410557440";
+ i++; ul_test[i].num = 0x000F000000000000UL; ul_test[i].expected = "4222124650659840";
+ i++; ul_test[i].num = 0x0000F00000000000UL; ul_test[i].expected = "263882790666240";
+ i++; ul_test[i].num = 0x00000F0000000000UL; ul_test[i].expected = "16492674416640";
+ i++; ul_test[i].num = 0x000000F000000000UL; ul_test[i].expected = "1030792151040";
+ i++; ul_test[i].num = 0x0000000F00000000UL; ul_test[i].expected = "64424509440";
+ i++; ul_test[i].num = 0x00000000F0000000UL; ul_test[i].expected = "4026531840";
+ i++; ul_test[i].num = 0x000000000F000000UL; ul_test[i].expected = "251658240";
+ i++; ul_test[i].num = 0x0000000000F00000UL; ul_test[i].expected = "15728640";
+ i++; ul_test[i].num = 0x00000000000F0000UL; ul_test[i].expected = "983040";
+ i++; ul_test[i].num = 0x000000000000F000UL; ul_test[i].expected = "61440";
+ i++; ul_test[i].num = 0x0000000000000F00UL; ul_test[i].expected = "3840";
+ i++; ul_test[i].num = 0x00000000000000F0UL; ul_test[i].expected = "240";
+ i++; ul_test[i].num = 0x000000000000000FUL; ul_test[i].expected = "15";
+
+ i++; ul_test[i].num = 0xC000000000000000UL; ul_test[i].expected = "13835058055282163712";
+ i++; ul_test[i].num = 0x0C00000000000000UL; ul_test[i].expected = "864691128455135232";
+ i++; ul_test[i].num = 0x00C0000000000000UL; ul_test[i].expected = "54043195528445952";
+ i++; ul_test[i].num = 0x000C000000000000UL; ul_test[i].expected = "3377699720527872";
+ i++; ul_test[i].num = 0x0000C00000000000UL; ul_test[i].expected = "211106232532992";
+ i++; ul_test[i].num = 0x00000C0000000000UL; ul_test[i].expected = "13194139533312";
+ i++; ul_test[i].num = 0x000000C000000000UL; ul_test[i].expected = "824633720832";
+ i++; ul_test[i].num = 0x0000000C00000000UL; ul_test[i].expected = "51539607552";
+ i++; ul_test[i].num = 0x00000000C0000000UL; ul_test[i].expected = "3221225472";
+ i++; ul_test[i].num = 0x000000000C000000UL; ul_test[i].expected = "201326592";
+ i++; ul_test[i].num = 0x0000000000C00000UL; ul_test[i].expected = "12582912";
+ i++; ul_test[i].num = 0x00000000000C0000UL; ul_test[i].expected = "786432";
+ i++; ul_test[i].num = 0x000000000000C000UL; ul_test[i].expected = "49152";
+ i++; ul_test[i].num = 0x0000000000000C00UL; ul_test[i].expected = "3072";
+ i++; ul_test[i].num = 0x00000000000000C0UL; ul_test[i].expected = "192";
+ i++; ul_test[i].num = 0x000000000000000CUL; ul_test[i].expected = "12";
+
+ i++; ul_test[i].num = 0x00000001UL; ul_test[i].expected = "1";
+ i++; ul_test[i].num = 0x00000000UL; ul_test[i].expected = "0";
+
+ num_ulong_tests = i;
+
+#endif
+
+ for(i=1; i<=num_ulong_tests; i++) {
+
+ for(j=0; j<BUFSZ; j++)
+ ul_test[i].result[j] = 'X';
+ ul_test[i].result[BUFSZ-1] = '\0';
+
+ (void)curl_msprintf(ul_test[i].result, "%lu", ul_test[i].num);
+
+ if(memcmp(ul_test[i].result,
+ ul_test[i].expected,
+ strlen(ul_test[i].expected))) {
+ printf("unsigned long test #%.2d: Failed (Expected: %s Got: %s)\n",
+ i, ul_test[i].expected, ul_test[i].result);
+ failed++;
+ }
+
+ }
+
+ if(!failed)
+ printf("All curl_mprintf() unsigned long tests OK!\n");
+ else
+ printf("Some curl_mprintf() unsigned long tests Failed!\n");
+
+ return failed;
+}
+
+
+static int test_signed_long_formatting(void)
+{
+ int i, j;
+ int num_slong_tests;
+ int failed = 0;
+
+#if (CURL_SIZEOF_LONG == 2)
+
+ i=1; sl_test[i].num = 0x7FFFL; sl_test[i].expected = "32767";
+ i++; sl_test[i].num = 0x7FFEL; sl_test[i].expected = "32766";
+ i++; sl_test[i].num = 0x7FFDL; sl_test[i].expected = "32765";
+ i++; sl_test[i].num = 0x7F00L; sl_test[i].expected = "32512";
+ i++; sl_test[i].num = 0x07F0L; sl_test[i].expected = "2032";
+ i++; sl_test[i].num = 0x007FL; sl_test[i].expected = "127";
+
+ i++; sl_test[i].num = 0x7000L; sl_test[i].expected = "28672";
+ i++; sl_test[i].num = 0x0700L; sl_test[i].expected = "1792";
+ i++; sl_test[i].num = 0x0070L; sl_test[i].expected = "112";
+ i++; sl_test[i].num = 0x0007L; sl_test[i].expected = "7";
+
+ i++; sl_test[i].num = 0x5000L; sl_test[i].expected = "20480";
+ i++; sl_test[i].num = 0x0500L; sl_test[i].expected = "1280";
+ i++; sl_test[i].num = 0x0050L; sl_test[i].expected = "80";
+ i++; sl_test[i].num = 0x0005L; sl_test[i].expected = "5";
+
+ i++; sl_test[i].num = 0x0001L; sl_test[i].expected = "1";
+ i++; sl_test[i].num = 0x0000L; sl_test[i].expected = "0";
+
+ i++; sl_test[i].num = -0x7FFFL -1L; sl_test[i].expected = "-32768";
+ i++; sl_test[i].num = -0x7FFEL -1L; sl_test[i].expected = "-32767";
+ i++; sl_test[i].num = -0x7FFDL -1L; sl_test[i].expected = "-32766";
+ i++; sl_test[i].num = -0x7F00L -1L; sl_test[i].expected = "-32513";
+ i++; sl_test[i].num = -0x07F0L -1L; sl_test[i].expected = "-2033";
+ i++; sl_test[i].num = -0x007FL -1L; sl_test[i].expected = "-128";
+
+ i++; sl_test[i].num = -0x7000L -1L; sl_test[i].expected = "-28673";
+ i++; sl_test[i].num = -0x0700L -1L; sl_test[i].expected = "-1793";
+ i++; sl_test[i].num = -0x0070L -1L; sl_test[i].expected = "-113";
+ i++; sl_test[i].num = -0x0007L -1L; sl_test[i].expected = "-8";
+
+ i++; sl_test[i].num = -0x5000L -1L; sl_test[i].expected = "-20481";
+ i++; sl_test[i].num = -0x0500L -1L; sl_test[i].expected = "-1281";
+ i++; sl_test[i].num = -0x0050L -1L; sl_test[i].expected = "-81";
+ i++; sl_test[i].num = -0x0005L -1L; sl_test[i].expected = "-6";
+
+ i++; sl_test[i].num = 0x0000L -1L; sl_test[i].expected = "-1";
+
+ num_slong_tests = i;
+
+#elif (CURL_SIZEOF_LONG == 4)
+
+ i=1; sl_test[i].num = 0x7FFFFFFFL; sl_test[i].expected = "2147483647";
+ i++; sl_test[i].num = 0x7FFFFFFEL; sl_test[i].expected = "2147483646";
+ i++; sl_test[i].num = 0x7FFFFFFDL; sl_test[i].expected = "2147483645";
+ i++; sl_test[i].num = 0x7FFF0000L; sl_test[i].expected = "2147418112";
+ i++; sl_test[i].num = 0x00007FFFL; sl_test[i].expected = "32767";
+
+ i++; sl_test[i].num = 0x7F000000L; sl_test[i].expected = "2130706432";
+ i++; sl_test[i].num = 0x007F0000L; sl_test[i].expected = "8323072";
+ i++; sl_test[i].num = 0x00007F00L; sl_test[i].expected = "32512";
+ i++; sl_test[i].num = 0x0000007FL; sl_test[i].expected = "127";
+
+ i++; sl_test[i].num = 0x70000000L; sl_test[i].expected = "1879048192";
+ i++; sl_test[i].num = 0x07000000L; sl_test[i].expected = "117440512";
+ i++; sl_test[i].num = 0x00700000L; sl_test[i].expected = "7340032";
+ i++; sl_test[i].num = 0x00070000L; sl_test[i].expected = "458752";
+ i++; sl_test[i].num = 0x00007000L; sl_test[i].expected = "28672";
+ i++; sl_test[i].num = 0x00000700L; sl_test[i].expected = "1792";
+ i++; sl_test[i].num = 0x00000070L; sl_test[i].expected = "112";
+ i++; sl_test[i].num = 0x00000007L; sl_test[i].expected = "7";
+
+ i++; sl_test[i].num = 0x50000000L; sl_test[i].expected = "1342177280";
+ i++; sl_test[i].num = 0x05000000L; sl_test[i].expected = "83886080";
+ i++; sl_test[i].num = 0x00500000L; sl_test[i].expected = "5242880";
+ i++; sl_test[i].num = 0x00050000L; sl_test[i].expected = "327680";
+ i++; sl_test[i].num = 0x00005000L; sl_test[i].expected = "20480";
+ i++; sl_test[i].num = 0x00000500L; sl_test[i].expected = "1280";
+ i++; sl_test[i].num = 0x00000050L; sl_test[i].expected = "80";
+ i++; sl_test[i].num = 0x00000005L; sl_test[i].expected = "5";
+
+ i++; sl_test[i].num = 0x00000001L; sl_test[i].expected = "1";
+ i++; sl_test[i].num = 0x00000000L; sl_test[i].expected = "0";
+
+ i++; sl_test[i].num = -0x7FFFFFFFL -1L; sl_test[i].expected = "-2147483648";
+ i++; sl_test[i].num = -0x7FFFFFFEL -1L; sl_test[i].expected = "-2147483647";
+ i++; sl_test[i].num = -0x7FFFFFFDL -1L; sl_test[i].expected = "-2147483646";
+ i++; sl_test[i].num = -0x7FFF0000L -1L; sl_test[i].expected = "-2147418113";
+ i++; sl_test[i].num = -0x00007FFFL -1L; sl_test[i].expected = "-32768";
+
+ i++; sl_test[i].num = -0x7F000000L -1L; sl_test[i].expected = "-2130706433";
+ i++; sl_test[i].num = -0x007F0000L -1L; sl_test[i].expected = "-8323073";
+ i++; sl_test[i].num = -0x00007F00L -1L; sl_test[i].expected = "-32513";
+ i++; sl_test[i].num = -0x0000007FL -1L; sl_test[i].expected = "-128";
+
+ i++; sl_test[i].num = -0x70000000L -1L; sl_test[i].expected = "-1879048193";
+ i++; sl_test[i].num = -0x07000000L -1L; sl_test[i].expected = "-117440513";
+ i++; sl_test[i].num = -0x00700000L -1L; sl_test[i].expected = "-7340033";
+ i++; sl_test[i].num = -0x00070000L -1L; sl_test[i].expected = "-458753";
+ i++; sl_test[i].num = -0x00007000L -1L; sl_test[i].expected = "-28673";
+ i++; sl_test[i].num = -0x00000700L -1L; sl_test[i].expected = "-1793";
+ i++; sl_test[i].num = -0x00000070L -1L; sl_test[i].expected = "-113";
+ i++; sl_test[i].num = -0x00000007L -1L; sl_test[i].expected = "-8";
+
+ i++; sl_test[i].num = -0x50000000L -1L; sl_test[i].expected = "-1342177281";
+ i++; sl_test[i].num = -0x05000000L -1L; sl_test[i].expected = "-83886081";
+ i++; sl_test[i].num = -0x00500000L -1L; sl_test[i].expected = "-5242881";
+ i++; sl_test[i].num = -0x00050000L -1L; sl_test[i].expected = "-327681";
+ i++; sl_test[i].num = -0x00005000L -1L; sl_test[i].expected = "-20481";
+ i++; sl_test[i].num = -0x00000500L -1L; sl_test[i].expected = "-1281";
+ i++; sl_test[i].num = -0x00000050L -1L; sl_test[i].expected = "-81";
+ i++; sl_test[i].num = -0x00000005L -1L; sl_test[i].expected = "-6";
+
+ i++; sl_test[i].num = 0x00000000L -1L; sl_test[i].expected = "-1";
+
+ num_slong_tests = i;
+
+#elif (CURL_SIZEOF_LONG == 8)
+
+ i=1; sl_test[i].num = 0x7FFFFFFFFFFFFFFFL; sl_test[i].expected = "9223372036854775807";
+ i++; sl_test[i].num = 0x7FFFFFFFFFFFFFFEL; sl_test[i].expected = "9223372036854775806";
+ i++; sl_test[i].num = 0x7FFFFFFFFFFFFFFDL; sl_test[i].expected = "9223372036854775805";
+ i++; sl_test[i].num = 0x7FFFFFFF00000000L; sl_test[i].expected = "9223372032559808512";
+ i++; sl_test[i].num = 0x000000007FFFFFFFL; sl_test[i].expected = "2147483647";
+
+ i++; sl_test[i].num = 0x7FFF000000000000L; sl_test[i].expected = "9223090561878065152";
+ i++; sl_test[i].num = 0x00007FFF00000000L; sl_test[i].expected = "140733193388032";
+ i++; sl_test[i].num = 0x000000007FFF0000L; sl_test[i].expected = "2147418112";
+ i++; sl_test[i].num = 0x0000000000007FFFL; sl_test[i].expected = "32767";
+
+ i++; sl_test[i].num = 0x7F00000000000000L; sl_test[i].expected = "9151314442816847872";
+ i++; sl_test[i].num = 0x007F000000000000L; sl_test[i].expected = "35747322042253312";
+ i++; sl_test[i].num = 0x00007F0000000000L; sl_test[i].expected = "139637976727552";
+ i++; sl_test[i].num = 0x0000007F00000000L; sl_test[i].expected = "545460846592";
+ i++; sl_test[i].num = 0x000000007F000000L; sl_test[i].expected = "2130706432";
+ i++; sl_test[i].num = 0x00000000007F0000L; sl_test[i].expected = "8323072";
+ i++; sl_test[i].num = 0x0000000000007F00L; sl_test[i].expected = "32512";
+ i++; sl_test[i].num = 0x000000000000007FL; sl_test[i].expected = "127";
+
+ i++; sl_test[i].num = 0x7000000000000000L; sl_test[i].expected = "8070450532247928832";
+ i++; sl_test[i].num = 0x0700000000000000L; sl_test[i].expected = "504403158265495552";
+ i++; sl_test[i].num = 0x0070000000000000L; sl_test[i].expected = "31525197391593472";
+ i++; sl_test[i].num = 0x0007000000000000L; sl_test[i].expected = "1970324836974592";
+ i++; sl_test[i].num = 0x0000700000000000L; sl_test[i].expected = "123145302310912";
+ i++; sl_test[i].num = 0x0000070000000000L; sl_test[i].expected = "7696581394432";
+ i++; sl_test[i].num = 0x0000007000000000L; sl_test[i].expected = "481036337152";
+ i++; sl_test[i].num = 0x0000000700000000L; sl_test[i].expected = "30064771072";
+ i++; sl_test[i].num = 0x0000000070000000L; sl_test[i].expected = "1879048192";
+ i++; sl_test[i].num = 0x0000000007000000L; sl_test[i].expected = "117440512";
+ i++; sl_test[i].num = 0x0000000000700000L; sl_test[i].expected = "7340032";
+ i++; sl_test[i].num = 0x0000000000070000L; sl_test[i].expected = "458752";
+ i++; sl_test[i].num = 0x0000000000007000L; sl_test[i].expected = "28672";
+ i++; sl_test[i].num = 0x0000000000000700L; sl_test[i].expected = "1792";
+ i++; sl_test[i].num = 0x0000000000000070L; sl_test[i].expected = "112";
+ i++; sl_test[i].num = 0x0000000000000007L; sl_test[i].expected = "7";
+
+ i++; sl_test[i].num = 0x0000000000000001L; sl_test[i].expected = "1";
+ i++; sl_test[i].num = 0x0000000000000000L; sl_test[i].expected = "0";
+
+ i++; sl_test[i].num = -0x7FFFFFFFFFFFFFFFL -1L; sl_test[i].expected = "-9223372036854775808";
+ i++; sl_test[i].num = -0x7FFFFFFFFFFFFFFEL -1L; sl_test[i].expected = "-9223372036854775807";
+ i++; sl_test[i].num = -0x7FFFFFFFFFFFFFFDL -1L; sl_test[i].expected = "-9223372036854775806";
+ i++; sl_test[i].num = -0x7FFFFFFF00000000L -1L; sl_test[i].expected = "-9223372032559808513";
+ i++; sl_test[i].num = -0x000000007FFFFFFFL -1L; sl_test[i].expected = "-2147483648";
+
+ i++; sl_test[i].num = -0x7FFF000000000000L -1L; sl_test[i].expected = "-9223090561878065153";
+ i++; sl_test[i].num = -0x00007FFF00000000L -1L; sl_test[i].expected = "-140733193388033";
+ i++; sl_test[i].num = -0x000000007FFF0000L -1L; sl_test[i].expected = "-2147418113";
+ i++; sl_test[i].num = -0x0000000000007FFFL -1L; sl_test[i].expected = "-32768";
+
+ i++; sl_test[i].num = -0x7F00000000000000L -1L; sl_test[i].expected = "-9151314442816847873";
+ i++; sl_test[i].num = -0x007F000000000000L -1L; sl_test[i].expected = "-35747322042253313";
+ i++; sl_test[i].num = -0x00007F0000000000L -1L; sl_test[i].expected = "-139637976727553";
+ i++; sl_test[i].num = -0x0000007F00000000L -1L; sl_test[i].expected = "-545460846593";
+ i++; sl_test[i].num = -0x000000007F000000L -1L; sl_test[i].expected = "-2130706433";
+ i++; sl_test[i].num = -0x00000000007F0000L -1L; sl_test[i].expected = "-8323073";
+ i++; sl_test[i].num = -0x0000000000007F00L -1L; sl_test[i].expected = "-32513";
+ i++; sl_test[i].num = -0x000000000000007FL -1L; sl_test[i].expected = "-128";
+
+ i++; sl_test[i].num = -0x7000000000000000L -1L; sl_test[i].expected = "-8070450532247928833";
+ i++; sl_test[i].num = -0x0700000000000000L -1L; sl_test[i].expected = "-504403158265495553";
+ i++; sl_test[i].num = -0x0070000000000000L -1L; sl_test[i].expected = "-31525197391593473";
+ i++; sl_test[i].num = -0x0007000000000000L -1L; sl_test[i].expected = "-1970324836974593";
+ i++; sl_test[i].num = -0x0000700000000000L -1L; sl_test[i].expected = "-123145302310913";
+ i++; sl_test[i].num = -0x0000070000000000L -1L; sl_test[i].expected = "-7696581394433";
+ i++; sl_test[i].num = -0x0000007000000000L -1L; sl_test[i].expected = "-481036337153";
+ i++; sl_test[i].num = -0x0000000700000000L -1L; sl_test[i].expected = "-30064771073";
+ i++; sl_test[i].num = -0x0000000070000000L -1L; sl_test[i].expected = "-1879048193";
+ i++; sl_test[i].num = -0x0000000007000000L -1L; sl_test[i].expected = "-117440513";
+ i++; sl_test[i].num = -0x0000000000700000L -1L; sl_test[i].expected = "-7340033";
+ i++; sl_test[i].num = -0x0000000000070000L -1L; sl_test[i].expected = "-458753";
+ i++; sl_test[i].num = -0x0000000000007000L -1L; sl_test[i].expected = "-28673";
+ i++; sl_test[i].num = -0x0000000000000700L -1L; sl_test[i].expected = "-1793";
+ i++; sl_test[i].num = -0x0000000000000070L -1L; sl_test[i].expected = "-113";
+ i++; sl_test[i].num = -0x0000000000000007L -1L; sl_test[i].expected = "-8";
+
+ i++; sl_test[i].num = 0x0000000000000000L -1L; sl_test[i].expected = "-1";
+
+ num_slong_tests = i;
+
+#endif
+
+ for(i=1; i<=num_slong_tests; i++) {
+
+ for(j=0; j<BUFSZ; j++)
+ sl_test[i].result[j] = 'X';
+ sl_test[i].result[BUFSZ-1] = '\0';
+
+ (void)curl_msprintf(sl_test[i].result, "%ld", sl_test[i].num);
+
+ if(memcmp(sl_test[i].result,
+ sl_test[i].expected,
+ strlen(sl_test[i].expected))) {
+ printf("signed long test #%.2d: Failed (Expected: %s Got: %s)\n",
+ i, sl_test[i].expected, sl_test[i].result);
+ failed++;
+ }
+
+ }
+
+ if(!failed)
+ printf("All curl_mprintf() signed long tests OK!\n");
+ else
+ printf("Some curl_mprintf() signed long tests Failed!\n");
+
+ return failed;
+}
+
+
+static int test_curl_off_t_formatting(void)
+{
+ int i, j;
+ int num_cofft_tests;
+ int failed = 0;
+
+#if (CURL_SIZEOF_CURL_OFF_T == 2)
+
+ i=1; co_test[i].num = MPRNT_OFF_T_C(0x7FFF); co_test[i].expected = "32767";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x7FFE); co_test[i].expected = "32766";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x7FFD); co_test[i].expected = "32765";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x7F00); co_test[i].expected = "32512";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x07F0); co_test[i].expected = "2032";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x007F); co_test[i].expected = "127";
+
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x7000); co_test[i].expected = "28672";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x0700); co_test[i].expected = "1792";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x0070); co_test[i].expected = "112";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x0007); co_test[i].expected = "7";
+
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x5000); co_test[i].expected = "20480";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x0500); co_test[i].expected = "1280";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x0050); co_test[i].expected = "80";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x0005); co_test[i].expected = "5";
+
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x0001); co_test[i].expected = "1";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x0000); co_test[i].expected = "0";
+
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x7FFF) -MPRNT_OFF_T_C(1); co_test[i].expected = "-32768";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x7FFE) -MPRNT_OFF_T_C(1); co_test[i].expected = "-32767";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x7FFD) -MPRNT_OFF_T_C(1); co_test[i].expected = "-32766";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x7F00) -MPRNT_OFF_T_C(1); co_test[i].expected = "-32513";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x07F0) -MPRNT_OFF_T_C(1); co_test[i].expected = "-2033";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x007F) -MPRNT_OFF_T_C(1); co_test[i].expected = "-128";
+
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x7000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-28673";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x0700) -MPRNT_OFF_T_C(1); co_test[i].expected = "-1793";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x0070) -MPRNT_OFF_T_C(1); co_test[i].expected = "-113";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x0007) -MPRNT_OFF_T_C(1); co_test[i].expected = "-8";
+
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x5000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-20481";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x0500) -MPRNT_OFF_T_C(1); co_test[i].expected = "-1281";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x0050) -MPRNT_OFF_T_C(1); co_test[i].expected = "-81";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x0005) -MPRNT_OFF_T_C(1); co_test[i].expected = "-6";
+
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x0000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-1";
+
+ num_cofft_tests = i;
+
+#elif (CURL_SIZEOF_CURL_OFF_T == 4)
+
+ i=1; co_test[i].num = MPRNT_OFF_T_C(0x7FFFFFFF); co_test[i].expected = "2147483647";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x7FFFFFFE); co_test[i].expected = "2147483646";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x7FFFFFFD); co_test[i].expected = "2147483645";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x7FFF0000); co_test[i].expected = "2147418112";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x00007FFF); co_test[i].expected = "32767";
+
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x7F000000); co_test[i].expected = "2130706432";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x007F0000); co_test[i].expected = "8323072";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x00007F00); co_test[i].expected = "32512";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x0000007F); co_test[i].expected = "127";
+
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x70000000); co_test[i].expected = "1879048192";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x07000000); co_test[i].expected = "117440512";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x00700000); co_test[i].expected = "7340032";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x00070000); co_test[i].expected = "458752";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x00007000); co_test[i].expected = "28672";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x00000700); co_test[i].expected = "1792";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x00000070); co_test[i].expected = "112";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x00000007); co_test[i].expected = "7";
+
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x50000000); co_test[i].expected = "1342177280";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x05000000); co_test[i].expected = "83886080";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x00500000); co_test[i].expected = "5242880";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x00050000); co_test[i].expected = "327680";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x00005000); co_test[i].expected = "20480";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x00000500); co_test[i].expected = "1280";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x00000050); co_test[i].expected = "80";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x00000005); co_test[i].expected = "5";
+
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x00000001); co_test[i].expected = "1";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x00000000); co_test[i].expected = "0";
+
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x7FFFFFFF) -MPRNT_OFF_T_C(1); co_test[i].expected = "-2147483648";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x7FFFFFFE) -MPRNT_OFF_T_C(1); co_test[i].expected = "-2147483647";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x7FFFFFFD) -MPRNT_OFF_T_C(1); co_test[i].expected = "-2147483646";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x7FFF0000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-2147418113";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x00007FFF) -MPRNT_OFF_T_C(1); co_test[i].expected = "-32768";
+
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x7F000000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-2130706433";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x007F0000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-8323073";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x00007F00) -MPRNT_OFF_T_C(1); co_test[i].expected = "-32513";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x0000007F) -MPRNT_OFF_T_C(1); co_test[i].expected = "-128";
+
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x70000000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-1879048193";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x07000000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-117440513";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x00700000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-7340033";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x00070000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-458753";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x00007000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-28673";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x00000700) -MPRNT_OFF_T_C(1); co_test[i].expected = "-1793";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x00000070) -MPRNT_OFF_T_C(1); co_test[i].expected = "-113";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x00000007) -MPRNT_OFF_T_C(1); co_test[i].expected = "-8";
+
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x50000000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-1342177281";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x05000000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-83886081";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x00500000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-5242881";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x00050000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-327681";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x00005000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-20481";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x00000500) -MPRNT_OFF_T_C(1); co_test[i].expected = "-1281";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x00000050) -MPRNT_OFF_T_C(1); co_test[i].expected = "-81";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x00000005) -MPRNT_OFF_T_C(1); co_test[i].expected = "-6";
+
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x00000000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-1";
+
+ num_cofft_tests = i;
+
+#elif (CURL_SIZEOF_CURL_OFF_T == 8)
+
+ i=1; co_test[i].num = MPRNT_OFF_T_C(0x7FFFFFFFFFFFFFFF); co_test[i].expected = "9223372036854775807";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x7FFFFFFFFFFFFFFE); co_test[i].expected = "9223372036854775806";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x7FFFFFFFFFFFFFFD); co_test[i].expected = "9223372036854775805";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x7FFFFFFF00000000); co_test[i].expected = "9223372032559808512";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x000000007FFFFFFF); co_test[i].expected = "2147483647";
+
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x7FFF000000000000); co_test[i].expected = "9223090561878065152";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x00007FFF00000000); co_test[i].expected = "140733193388032";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x000000007FFF0000); co_test[i].expected = "2147418112";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x0000000000007FFF); co_test[i].expected = "32767";
+
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x7F00000000000000); co_test[i].expected = "9151314442816847872";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x007F000000000000); co_test[i].expected = "35747322042253312";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x00007F0000000000); co_test[i].expected = "139637976727552";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x0000007F00000000); co_test[i].expected = "545460846592";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x000000007F000000); co_test[i].expected = "2130706432";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x00000000007F0000); co_test[i].expected = "8323072";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x0000000000007F00); co_test[i].expected = "32512";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x000000000000007F); co_test[i].expected = "127";
+
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x7000000000000000); co_test[i].expected = "8070450532247928832";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x0700000000000000); co_test[i].expected = "504403158265495552";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x0070000000000000); co_test[i].expected = "31525197391593472";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x0007000000000000); co_test[i].expected = "1970324836974592";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x0000700000000000); co_test[i].expected = "123145302310912";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x0000070000000000); co_test[i].expected = "7696581394432";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x0000007000000000); co_test[i].expected = "481036337152";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x0000000700000000); co_test[i].expected = "30064771072";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x0000000070000000); co_test[i].expected = "1879048192";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x0000000007000000); co_test[i].expected = "117440512";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x0000000000700000); co_test[i].expected = "7340032";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x0000000000070000); co_test[i].expected = "458752";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x0000000000007000); co_test[i].expected = "28672";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x0000000000000700); co_test[i].expected = "1792";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x0000000000000070); co_test[i].expected = "112";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x0000000000000007); co_test[i].expected = "7";
+
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x0000000000000001); co_test[i].expected = "1";
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x0000000000000000); co_test[i].expected = "0";
+
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x7FFFFFFFFFFFFFFF) -MPRNT_OFF_T_C(1); co_test[i].expected = "-9223372036854775808";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x7FFFFFFFFFFFFFFE) -MPRNT_OFF_T_C(1); co_test[i].expected = "-9223372036854775807";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x7FFFFFFFFFFFFFFD) -MPRNT_OFF_T_C(1); co_test[i].expected = "-9223372036854775806";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x7FFFFFFF00000000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-9223372032559808513";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x000000007FFFFFFF) -MPRNT_OFF_T_C(1); co_test[i].expected = "-2147483648";
+
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x7FFF000000000000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-9223090561878065153";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x00007FFF00000000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-140733193388033";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x000000007FFF0000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-2147418113";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x0000000000007FFF) -MPRNT_OFF_T_C(1); co_test[i].expected = "-32768";
+
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x7F00000000000000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-9151314442816847873";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x007F000000000000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-35747322042253313";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x00007F0000000000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-139637976727553";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x0000007F00000000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-545460846593";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x000000007F000000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-2130706433";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x00000000007F0000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-8323073";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x0000000000007F00) -MPRNT_OFF_T_C(1); co_test[i].expected = "-32513";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x000000000000007F) -MPRNT_OFF_T_C(1); co_test[i].expected = "-128";
+
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x7000000000000000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-8070450532247928833";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x0700000000000000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-504403158265495553";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x0070000000000000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-31525197391593473";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x0007000000000000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-1970324836974593";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x0000700000000000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-123145302310913";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x0000070000000000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-7696581394433";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x0000007000000000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-481036337153";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x0000000700000000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-30064771073";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x0000000070000000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-1879048193";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x0000000007000000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-117440513";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x0000000000700000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-7340033";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x0000000000070000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-458753";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x0000000000007000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-28673";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x0000000000000700) -MPRNT_OFF_T_C(1); co_test[i].expected = "-1793";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x0000000000000070) -MPRNT_OFF_T_C(1); co_test[i].expected = "-113";
+ i++; co_test[i].num = -MPRNT_OFF_T_C(0x0000000000000007) -MPRNT_OFF_T_C(1); co_test[i].expected = "-8";
+
+ i++; co_test[i].num = MPRNT_OFF_T_C(0x0000000000000000) -MPRNT_OFF_T_C(1); co_test[i].expected = "-1";
+
+ num_cofft_tests = i;
+
+#endif
+
+ for(i=1; i<=num_cofft_tests; i++) {
+
+ for(j=0; j<BUFSZ; j++)
+ co_test[i].result[j] = 'X';
+ co_test[i].result[BUFSZ-1] = '\0';
+
+ (void)curl_msprintf(co_test[i].result, "%" FORMAT_OFF_T, co_test[i].num);
+
+ if(memcmp(co_test[i].result,
+ co_test[i].expected,
+ strlen(co_test[i].expected))) {
+ printf("curl_off_t test #%.2d: Failed (Expected: %s Got: %s)\n",
+ i, co_test[i].expected, co_test[i].result);
+ failed++;
+ }
+
+ }
+
+ if(!failed)
+ printf("All curl_mprintf() curl_off_t tests OK!\n");
+ else
+ printf("Some curl_mprintf() curl_off_t tests Failed!\n");
+
+ return failed;
+}
+
+
+int test(char *URL)
+{
+ int errors = 0;
+ (void)URL; /* not used */
+
+ errors += test_unsigned_short_formatting();
+
+ errors += test_signed_short_formatting();
+
+ errors += test_unsigned_int_formatting();
+
+ errors += test_signed_int_formatting();
+
+ errors += test_unsigned_long_formatting();
+
+ errors += test_signed_long_formatting();
+
+ errors += test_curl_off_t_formatting();
+
+ if(errors)
+ return TEST_ERR_MAJOR_BAD;
+ else
+ return 0;
+}
diff --git a/tests/libtest/lib558.c b/tests/libtest/lib558.c
new file mode 100644
index 000000000..56f2a2612
--- /dev/null
+++ b/tests/libtest/lib558.c
@@ -0,0 +1,188 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#ifdef HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+# include <arpa/inet.h>
+#endif
+
+#define ENABLE_CURLX_PRINTF
+#include "curlx.h"
+
+#include "hash.h"
+#include "hostip.h"
+
+#include "curl_memory.h"
+#include "memdebug.h"
+
+/* This source file is used for test # 558 and 559 */
+
+/*
+ * This hacky test bypasses the library external API,
+ * using internal only libcurl functions. So don't be
+ * surprised if we cannot run it when the library has
+ * been built with hidden symbols, exporting only the
+ * ones in the public API.
+ */
+
+#if defined(CURL_HIDDEN_SYMBOLS)
+# define SKIP_TEST 1
+#elif defined(WIN32) && !defined(CURL_STATICLIB)
+# define SKIP_TEST 1
+#else
+# undef SKIP_TEST
+#endif
+
+
+#if !defined(SKIP_TEST)
+
+#ifdef LIB559
+static Curl_addrinfo *fake_ai(void)
+{
+ Curl_addrinfo *ai;
+ int ss_size;
+
+ ss_size = sizeof (struct sockaddr_in);
+
+ if((ai = calloc(1, sizeof(Curl_addrinfo))) == NULL)
+ return NULL;
+
+ if((ai->ai_canonname = strdup("dummy")) == NULL) {
+ free(ai);
+ return NULL;
+ }
+
+ if((ai->ai_addr = calloc(1, ss_size)) == NULL) {
+ free(ai->ai_canonname);
+ free(ai);
+ return NULL;
+ }
+
+ ai->ai_family = AF_INET;
+ ai->ai_addrlen = ss_size;
+
+ return ai;
+}
+#endif /* LIB559 */
+
+
+int test(char *URL)
+{
+ CURL *easyh = NULL;
+ struct curl_hash *hp = NULL;
+ int result = 0;
+
+ if(!strcmp(URL, "check")) {
+ /* test harness script verifying if this test can run */
+ return 0; /* sure, run this! */
+ }
+
+ easyh = curl_easy_init();
+ if(!easyh) {
+ fprintf(stdout, "easy handle init failed\n");
+ result = TEST_ERR_MAJOR_BAD;
+ goto cleanup;
+ }
+ fprintf(stdout, "easy handle init OK\n");
+
+ fprintf(stdout, "creating hash...\n");
+ hp = Curl_mk_dnscache();
+ if(!hp) {
+ fprintf(stdout, "hash creation failed\n");
+ result = TEST_ERR_MAJOR_BAD;
+ goto cleanup;
+ }
+ fprintf(stdout, "hash creation OK\n");
+
+ /**/
+#ifdef LIB559
+ {
+ char *data_key;
+ struct Curl_dns_entry *data_node;
+ struct Curl_dns_entry *nodep;
+ size_t key_len;
+
+ data_key = aprintf("%s:%d", "dummy", 0);
+ if(!data_key) {
+ fprintf(stdout, "data key creation failed\n");
+ result = TEST_ERR_MAJOR_BAD;
+ goto cleanup;
+ }
+ key_len = strlen(data_key);
+
+ data_node = calloc(1, sizeof(struct Curl_dns_entry));
+ if(!data_node) {
+ fprintf(stdout, "data node creation failed\n");
+ result = TEST_ERR_MAJOR_BAD;
+ free(data_key);
+ goto cleanup;
+ }
+
+ data_node->addr = fake_ai();
+ if(!data_node->addr) {
+ fprintf(stdout, "actual data creation failed\n");
+ result = TEST_ERR_MAJOR_BAD;
+ free(data_node);
+ free(data_key);
+ goto cleanup;
+ }
+
+ nodep = Curl_hash_add(hp, data_key, key_len+1, (void *)data_node);
+ if(!nodep) {
+ fprintf(stdout, "insertion into hash failed\n");
+ result = TEST_ERR_MAJOR_BAD;
+ Curl_freeaddrinfo(data_node->addr);
+ free(data_node);
+ free(data_key);
+ goto cleanup;
+ }
+
+ free(data_key);
+ }
+#endif /* LIB559 */
+ /**/
+
+cleanup:
+
+ fprintf(stdout, "destroying hash...\n");
+ Curl_hash_destroy(hp);
+ fprintf(stdout, "hash destruction OK\n");
+
+ fprintf(stdout, "destroying easy handle...\n");
+ curl_easy_cleanup(easyh);
+ fprintf(stdout, "easy handle destruction OK\n");
+
+ curl_global_cleanup();
+
+ return result;
+}
+
+
+#else /* !defined(SKIP_TEST) */
+
+
+int test(char *URL)
+{
+ (void)URL;
+ fprintf(stdout, "libcurl built with hidden symbols");
+ return 1; /* skip test */
+}
+
+
+#endif /* !defined(SKIP_TEST) */
diff --git a/tests/libtest/lib560.c b/tests/libtest/lib560.c
new file mode 100644
index 000000000..87e854555
--- /dev/null
+++ b/tests/libtest/lib560.c
@@ -0,0 +1,105 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ *
+ */
+#include "test.h"
+
+/*
+ * Simply download a HTTPS file!
+ *
+ * This test was added after the HTTPS-using-multi-interface with OpenSSL
+ * regression of 7.19.1 to hopefully prevent this embarassing mistake from
+ * appearing again... Unfortunately the bug wasn't triggered by this test,
+ * which presumably is because the connect to a local server is too
+ * fast/different compared to the real/distant servers we saw the bug happen
+ * with.
+ */
+int test(char *URL)
+{
+ CURL *http_handle;
+ CURLM *multi_handle = NULL;
+ CURLMcode code;
+ int res;
+
+ int still_running; /* keep number of running handles */
+
+ http_handle = curl_easy_init();
+ if (!http_handle)
+ return TEST_ERR_MAJOR_BAD;
+
+ /* set options */
+ test_setopt(http_handle, CURLOPT_URL, URL);
+ test_setopt(http_handle, CURLOPT_HEADER, 1L);
+ test_setopt(http_handle, CURLOPT_SSL_VERIFYPEER, 0L);
+ test_setopt(http_handle, CURLOPT_SSL_VERIFYHOST, 0L);
+
+ /* init a multi stack */
+ multi_handle = curl_multi_init();
+ if (!multi_handle) {
+ curl_easy_cleanup(http_handle);
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ /* add the individual transfers */
+ curl_multi_add_handle(multi_handle, http_handle);
+
+ /* we start some action by calling perform right away */
+ do {
+ code = curl_multi_perform(multi_handle, &still_running);
+ } while(code == CURLM_CALL_MULTI_PERFORM);
+
+ while(still_running) {
+ struct timeval timeout;
+ int rc; /* select() return code */
+
+ fd_set fdread;
+ fd_set fdwrite;
+ fd_set fdexcep;
+ int maxfd;
+
+ FD_ZERO(&fdread);
+ FD_ZERO(&fdwrite);
+ FD_ZERO(&fdexcep);
+
+ /* set a suitable timeout to play around with */
+ timeout.tv_sec = 1;
+ timeout.tv_usec = 0;
+
+ /* get file descriptors from the transfers */
+ curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);
+
+ /* In a real-world program you OF COURSE check the return code of the
+ function calls, *and* you make sure that maxfd is bigger than -1 so
+ that the call to select() below makes sense! */
+
+ rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
+
+ switch(rc) {
+ case -1:
+ /* select error */
+ break;
+ case 0:
+ default:
+ /* timeout or readable/writable sockets */
+ do {
+ code = curl_multi_perform(multi_handle, &still_running);
+ } while(code == CURLM_CALL_MULTI_PERFORM);
+ break;
+ }
+ }
+
+test_cleanup:
+
+ if(multi_handle)
+ curl_multi_cleanup(multi_handle);
+
+ curl_easy_cleanup(http_handle);
+ curl_global_cleanup();
+
+ return res;
+}
diff --git a/tests/libtest/lib562.c b/tests/libtest/lib562.c
new file mode 100644
index 000000000..acdd79aab
--- /dev/null
+++ b/tests/libtest/lib562.c
@@ -0,0 +1,74 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#include "memdebug.h"
+
+/*
+ * From "KNOWN_BUGS" April 2009:
+
+ 59. If the CURLOPT_PORT option is used on an FTP URL like
+ "ftp://example.com/file;type=A" the ";type=A" is stripped off.
+
+ */
+
+int test(char *URL)
+{
+ CURL *curl;
+ CURLcode res = CURLE_OK;
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ /* get a curl handle */
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ /* enable verbose */
+ test_setopt(curl, CURLOPT_VERBOSE, 1L);
+
+ /* set port number */
+ test_setopt(curl, CURLOPT_PORT, strtol(libtest_arg2, NULL, 10));
+
+ /* specify target */
+ test_setopt(curl,CURLOPT_URL, URL);
+
+ /* Now run off and do what you've been told! */
+ res = curl_easy_perform(curl);
+
+test_cleanup:
+
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return res;
+}
diff --git a/tests/libtest/lib564.c b/tests/libtest/lib564.c
new file mode 100644
index 000000000..d33f23042
--- /dev/null
+++ b/tests/libtest/lib564.c
@@ -0,0 +1,143 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include "testutil.h"
+#include "memdebug.h"
+
+#define MAIN_LOOP_HANG_TIMEOUT 90 * 1000
+#define MULTI_PERFORM_HANG_TIMEOUT 60 * 1000
+
+int test(char *URL)
+{
+ int res = 0;
+ CURL *curl;
+ int running;
+ char done=FALSE;
+ CURLM *m = NULL;
+ struct timeval ml_start;
+ struct timeval mp_start;
+ char ml_timedout = FALSE;
+ char mp_timedout = FALSE;
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ test_setopt(curl, CURLOPT_URL, URL);
+ test_setopt(curl, CURLOPT_VERBOSE, 1);
+ test_setopt(curl, CURLOPT_PROXY, libtest_arg2);
+ test_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);
+
+ if ((m = curl_multi_init()) == NULL) {
+ fprintf(stderr, "curl_multi_init() failed\n");
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((res = (int)curl_multi_add_handle(m, curl)) != CURLM_OK) {
+ fprintf(stderr, "curl_multi_add_handle() failed, "
+ "with code %d\n", res);
+ curl_multi_cleanup(m);
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ ml_timedout = FALSE;
+ ml_start = tutil_tvnow();
+
+ fprintf(stderr, "Start at URL 0\n");
+
+ while (!done) {
+ fd_set rd, wr, exc;
+ int max_fd;
+ struct timeval interval;
+
+ interval.tv_sec = 1;
+ interval.tv_usec = 0;
+
+ if (tutil_tvdiff(tutil_tvnow(), ml_start) >
+ MAIN_LOOP_HANG_TIMEOUT) {
+ ml_timedout = TRUE;
+ break;
+ }
+ mp_timedout = FALSE;
+ mp_start = tutil_tvnow();
+
+ while (res == CURLM_CALL_MULTI_PERFORM) {
+ res = (int)curl_multi_perform(m, &running);
+ if (tutil_tvdiff(tutil_tvnow(), mp_start) >
+ MULTI_PERFORM_HANG_TIMEOUT) {
+ mp_timedout = TRUE;
+ break;
+ }
+ if (running <= 0) {
+ done = TRUE; /* bail out */
+ break;
+ }
+ }
+ if (mp_timedout || done)
+ break;
+
+ if (res != CURLM_OK) {
+ fprintf(stderr, "not okay???\n");
+ break;
+ }
+
+ FD_ZERO(&rd);
+ FD_ZERO(&wr);
+ FD_ZERO(&exc);
+ max_fd = 0;
+
+ if (curl_multi_fdset(m, &rd, &wr, &exc, &max_fd) != CURLM_OK) {
+ fprintf(stderr, "unexpected failured of fdset.\n");
+ res = 189;
+ break;
+ }
+
+ if (select_test(max_fd+1, &rd, &wr, &exc, &interval) == -1) {
+ fprintf(stderr, "bad select??\n");
+ res = 195;
+ break;
+ }
+
+ res = CURLM_CALL_MULTI_PERFORM;
+ }
+
+ if (ml_timedout || mp_timedout) {
+ if (ml_timedout) fprintf(stderr, "ml_timedout\n");
+ if (mp_timedout) fprintf(stderr, "mp_timedout\n");
+ fprintf(stderr, "ABORTING TEST, since it seems "
+ "that it would have run forever.\n");
+ res = TEST_ERR_RUNS_FOREVER;
+ }
+
+test_cleanup:
+
+ curl_easy_cleanup(curl);
+ if(m)
+ curl_multi_cleanup(m);
+ curl_global_cleanup();
+
+ return res;
+}
diff --git a/tests/libtest/lib566.c b/tests/libtest/lib566.c
new file mode 100644
index 000000000..889f15b3a
--- /dev/null
+++ b/tests/libtest/lib566.c
@@ -0,0 +1,55 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#include "memdebug.h"
+
+int test(char *URL)
+{
+ CURLcode res;
+ CURL *curl;
+
+ double content_length = 3;
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ test_setopt(curl, CURLOPT_URL, URL);
+ test_setopt(curl, CURLOPT_HEADER, 1L);
+
+ res = curl_easy_perform(curl);
+
+ if(!res) {
+ FILE *moo;
+ res = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD,
+ &content_length);
+ moo = fopen(libtest_arg2, "wb");
+ if(moo) {
+ fprintf(moo, "CL: %.0f\n", content_length);
+ fclose(moo);
+ }
+ }
+
+test_cleanup:
+
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return (int)res;
+}
+
diff --git a/tests/libtest/lib567.c b/tests/libtest/lib567.c
new file mode 100644
index 000000000..e1df0c1e4
--- /dev/null
+++ b/tests/libtest/lib567.c
@@ -0,0 +1,56 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+#include "memdebug.h"
+
+/*
+ * Test a simple OPTIONS request with a custom header
+ */
+int test(char *URL)
+{
+ CURLcode res;
+ CURL *curl;
+ struct curl_slist *custom_headers=NULL;
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ /* Dump data to stdout for protocol verification */
+ test_setopt(curl, CURLOPT_HEADERDATA, stdout);
+ test_setopt(curl, CURLOPT_WRITEDATA, stdout);
+
+ test_setopt(curl, CURLOPT_URL, URL);
+ test_setopt(curl, CURLOPT_RTSP_STREAM_URI, URL);
+ test_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_OPTIONS);
+ test_setopt(curl, CURLOPT_USERAGENT, "test567");
+
+ custom_headers = curl_slist_append(custom_headers, "Test-Number: 567");
+ test_setopt(curl, CURLOPT_RTSPHEADER, custom_headers);
+
+ res = curl_easy_perform(curl);
+
+test_cleanup:
+
+ if(custom_headers)
+ curl_slist_free_all(custom_headers);
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return (int)res;
+}
+
diff --git a/tests/libtest/lib568.c b/tests/libtest/lib568.c
new file mode 100644
index 000000000..1f16664cb
--- /dev/null
+++ b/tests/libtest/lib568.c
@@ -0,0 +1,163 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
+#include <curl/mprintf.h>
+
+#include "memdebug.h"
+
+/* build request url */
+static char *suburl(const char *base, int i)
+{
+ return curl_maprintf("%s%.4d", base, i);
+}
+
+/*
+ * Test the Client->Server ANNOUNCE functionality (PUT style)
+ */
+int test(char *URL)
+{
+ int res;
+ CURL *curl;
+ int sdp;
+ FILE *sdpf = NULL;
+ struct_stat file_info;
+ char *stream_uri = NULL;
+ int request=1;
+ struct curl_slist *custom_headers=NULL;
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ test_setopt(curl, CURLOPT_HEADERDATA, stdout);
+ test_setopt(curl, CURLOPT_WRITEDATA, stdout);
+
+ test_setopt(curl, CURLOPT_URL, URL);
+
+ if((stream_uri = suburl(URL, request++)) == NULL) {
+ res = TEST_ERR_MAJOR_BAD;
+ goto test_cleanup;
+ }
+ test_setopt(curl, CURLOPT_RTSP_STREAM_URI, stream_uri);
+ free(stream_uri);
+ stream_uri = NULL;
+
+ sdp = open("log/file568.txt", O_RDONLY);
+ fstat(sdp, &file_info);
+ close(sdp);
+
+ sdpf = fopen("log/file568.txt", "rb");
+ if(sdpf == NULL) {
+ fprintf(stderr, "can't open log/file568.txt\n");
+ res = TEST_ERR_MAJOR_BAD;
+ goto test_cleanup;
+ }
+ test_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_ANNOUNCE);
+
+ test_setopt(curl, CURLOPT_READDATA, sdpf);
+ test_setopt(curl, CURLOPT_UPLOAD, 1L);
+ test_setopt(curl, CURLOPT_INFILESIZE_LARGE, (curl_off_t) file_info.st_size);
+
+ /* Do the ANNOUNCE */
+ res = curl_easy_perform(curl);
+ if(res)
+ goto test_cleanup;
+
+ test_setopt(curl, CURLOPT_UPLOAD, 0L);
+ fclose(sdpf);
+ sdpf = NULL;
+
+ /* Make sure we can do a normal request now */
+ if((stream_uri = suburl(URL, request++)) == NULL) {
+ res = TEST_ERR_MAJOR_BAD;
+ goto test_cleanup;
+ }
+ test_setopt(curl, CURLOPT_RTSP_STREAM_URI, stream_uri);
+ free(stream_uri);
+ stream_uri = NULL;
+
+ test_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_DESCRIBE);
+ res = curl_easy_perform(curl);
+ if(res)
+ goto test_cleanup;
+
+ /* Now do a POST style one */
+
+ if((stream_uri = suburl(URL, request++)) == NULL) {
+ res = TEST_ERR_MAJOR_BAD;
+ goto test_cleanup;
+ }
+ test_setopt(curl, CURLOPT_RTSP_STREAM_URI, stream_uri);
+ free(stream_uri);
+ stream_uri = NULL;
+
+ custom_headers = curl_slist_append(custom_headers,
+ "Content-Type: posty goodness");
+ if(!custom_headers) {
+ res = TEST_ERR_MAJOR_BAD;
+ goto test_cleanup;
+ }
+ test_setopt(curl, CURLOPT_RTSPHEADER, custom_headers);
+ test_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_ANNOUNCE);
+ test_setopt(curl, CURLOPT_POSTFIELDS, "postyfield=postystuff&project=curl\n");
+
+ res = curl_easy_perform(curl);
+ if(res)
+ goto test_cleanup;
+
+ test_setopt(curl, CURLOPT_POSTFIELDS, NULL);
+ test_setopt(curl, CURLOPT_RTSPHEADER, NULL);
+ curl_slist_free_all(custom_headers);
+ custom_headers = NULL;
+
+ /* Make sure we can do a normal request now */
+ if((stream_uri = suburl(URL, request++)) == NULL) {
+ res = TEST_ERR_MAJOR_BAD;
+ goto test_cleanup;
+ }
+ test_setopt(curl, CURLOPT_RTSP_STREAM_URI, stream_uri);
+ free(stream_uri);
+ stream_uri = NULL;
+
+ test_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_OPTIONS);
+ res = curl_easy_perform(curl);
+
+test_cleanup:
+
+ if(sdpf)
+ fclose(sdpf);
+
+ if(stream_uri)
+ free(stream_uri);
+
+ if(custom_headers)
+ curl_slist_free_all(custom_headers);
+
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return res;
+}
+
diff --git a/tests/libtest/lib569.c b/tests/libtest/lib569.c
new file mode 100644
index 000000000..b5182d64c
--- /dev/null
+++ b/tests/libtest/lib569.c
@@ -0,0 +1,117 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#include <curl/mprintf.h>
+
+#include "memdebug.h"
+
+/* build request url */
+static char *suburl(const char *base, int i)
+{
+ return curl_maprintf("%s%.4d", base, i);
+}
+
+/*
+ * Test Session ID capture
+ */
+int test(char *URL)
+{
+ int res;
+ CURL *curl;
+ char *stream_uri = NULL;
+ char *rtsp_session_id;
+ int request=1;
+ int i;
+ FILE *idfile = NULL;
+
+ idfile = fopen(libtest_arg2, "wb");
+ if(idfile == NULL) {
+ fprintf(stderr, "couldn't open the Session ID File\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ fclose(idfile);
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ fclose(idfile);
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ test_setopt(curl, CURLOPT_HEADERDATA, stdout);
+ test_setopt(curl, CURLOPT_WRITEDATA, stdout);
+ test_setopt(curl, CURLOPT_VERBOSE, 1L);
+
+ test_setopt(curl, CURLOPT_URL, URL);
+
+ test_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_SETUP);
+ res = curl_easy_perform(curl);
+ if(res != (int)CURLE_BAD_FUNCTION_ARGUMENT) {
+ fprintf(stderr, "This should have failed. "
+ "Cannot setup without a Transport: header");
+ res = TEST_ERR_MAJOR_BAD;
+ goto test_cleanup;
+ }
+
+ /* Go through the various Session IDs */
+ for(i = 0; i < 3; i++) {
+ if((stream_uri = suburl(URL, request++)) == NULL) {
+ res = TEST_ERR_MAJOR_BAD;
+ goto test_cleanup;
+ }
+ test_setopt(curl, CURLOPT_RTSP_STREAM_URI, stream_uri);
+ free(stream_uri);
+ stream_uri = NULL;
+
+ test_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_SETUP);
+ test_setopt(curl, CURLOPT_RTSP_TRANSPORT, "Fake/NotReal/JustATest;foo=baz");
+ res = curl_easy_perform(curl);
+ if(res)
+ goto test_cleanup;
+
+ curl_easy_getinfo(curl, CURLINFO_RTSP_SESSION_ID, &rtsp_session_id);
+ fprintf(idfile, "Got Session ID: [%s]\n", rtsp_session_id);
+ rtsp_session_id = NULL;
+
+ if((stream_uri = suburl(URL, request++)) == NULL) {
+ res = TEST_ERR_MAJOR_BAD;
+ goto test_cleanup;
+ }
+ test_setopt(curl, CURLOPT_RTSP_STREAM_URI, stream_uri);
+ free(stream_uri);
+ stream_uri = NULL;
+
+ test_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_TEARDOWN);
+ res = curl_easy_perform(curl);
+
+ /* Clear for the next go-round */
+ test_setopt(curl, CURLOPT_RTSP_SESSION_ID, NULL);
+ }
+
+test_cleanup:
+
+ if(idfile)
+ fclose(idfile);
+
+ if(stream_uri)
+ free(stream_uri);
+
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return res;
+}
+
diff --git a/tests/libtest/lib570.c b/tests/libtest/lib570.c
new file mode 100644
index 000000000..9fe2eceaa
--- /dev/null
+++ b/tests/libtest/lib570.c
@@ -0,0 +1,105 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#include <curl/mprintf.h>
+
+#include "memdebug.h"
+
+/* build request url */
+static char *suburl(const char *base, int i)
+{
+ return curl_maprintf("%s%.4d", base, i);
+}
+
+int test(char *URL)
+{
+ int res;
+ CURL *curl;
+ int request=1;
+ char *stream_uri = NULL;
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ test_setopt(curl, CURLOPT_HEADERDATA, stdout);
+ test_setopt(curl, CURLOPT_WRITEDATA, stdout);
+ test_setopt(curl, CURLOPT_VERBOSE, 1L);
+
+ test_setopt(curl, CURLOPT_URL, URL);
+
+ test_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_OPTIONS);
+
+ if((stream_uri = suburl(URL, request++)) == NULL) {
+ res = TEST_ERR_MAJOR_BAD;
+ goto test_cleanup;
+ }
+ test_setopt(curl, CURLOPT_RTSP_STREAM_URI, stream_uri);
+ free(stream_uri);
+ stream_uri = NULL;
+
+ res = curl_easy_perform(curl);
+ if(res != (int)CURLE_RTSP_CSEQ_ERROR) {
+ fprintf(stderr, "Failed to detect CSeq mismatch");
+ res = TEST_ERR_MAJOR_BAD;
+ goto test_cleanup;
+ }
+
+ test_setopt(curl, CURLOPT_RTSP_CLIENT_CSEQ, 999);
+ test_setopt(curl, CURLOPT_RTSP_TRANSPORT,
+ "RAW/RAW/UDP;unicast;client_port=3056-3057");
+ test_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_SETUP);
+
+ if((stream_uri = suburl(URL, request++)) == NULL) {
+ res = TEST_ERR_MAJOR_BAD;
+ goto test_cleanup;
+ }
+ test_setopt(curl, CURLOPT_RTSP_STREAM_URI, stream_uri);
+ free(stream_uri);
+ stream_uri = NULL;
+
+ res = curl_easy_perform(curl);
+ if(res)
+ goto test_cleanup;
+
+ test_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_PLAY);
+
+ if((stream_uri = suburl(URL, request++)) == NULL) {
+ res = TEST_ERR_MAJOR_BAD;
+ goto test_cleanup;
+ }
+ test_setopt(curl, CURLOPT_RTSP_STREAM_URI, stream_uri);
+ free(stream_uri);
+ stream_uri = NULL;
+
+ res = curl_easy_perform(curl);
+ if(res != CURLE_RTSP_SESSION_ERROR) {
+ fprintf(stderr, "Failed to detect a Session ID mismatch");
+ }
+
+test_cleanup:
+
+ if(stream_uri)
+ free(stream_uri);
+
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return res;
+}
+
diff --git a/tests/libtest/lib571.c b/tests/libtest/lib571.c
new file mode 100644
index 000000000..2892211aa
--- /dev/null
+++ b/tests/libtest/lib571.c
@@ -0,0 +1,200 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#ifdef HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+# include <arpa/inet.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+
+#include <curl/mprintf.h>
+
+#include "memdebug.h"
+
+#define RTP_PKT_CHANNEL(p) ((int)((unsigned char)((p)[1])))
+
+#define RTP_PKT_LENGTH(p) ((((int)((unsigned char)((p)[2]))) << 8) | \
+ ((int)((unsigned char)((p)[3]))))
+
+#define RTP_DATA_SIZE 12
+static const char *RTP_DATA = "$_1234\n\0asdf";
+
+static int rtp_packet_count = 0;
+
+static size_t rtp_write(void *ptr, size_t size, size_t nmemb, void *stream) {
+ char *data = (char *)ptr;
+ int channel = RTP_PKT_CHANNEL(data);
+ int message_size = (int)(size * nmemb) - 4;
+ int coded_size = RTP_PKT_LENGTH(data);
+ size_t failure = (size * nmemb) ? 0 : 1;
+ int i;
+ (void)stream;
+
+ printf("RTP: message size %d, channel %d\n", message_size, channel);
+ if(message_size != coded_size) {
+ printf("RTP embedded size (%d) does not match the write size (%d).\n",
+ coded_size, message_size);
+ return failure;
+ }
+
+ data += 4;
+ for(i = 0; i < message_size; i+= RTP_DATA_SIZE) {
+ if(message_size - i > RTP_DATA_SIZE) {
+ if(memcmp(RTP_DATA, data + i, RTP_DATA_SIZE) != 0) {
+ printf("RTP PAYLOAD CORRUPTED [%s]\n", data + i);
+ return failure;
+ }
+ } else {
+ if (memcmp(RTP_DATA, data + i, message_size - i) != 0) {
+ printf("RTP PAYLOAD END CORRUPTED (%d), [%s]\n",
+ message_size - i, data + i);
+ return failure;
+ }
+ }
+ }
+
+ rtp_packet_count++;
+ fprintf(stderr, "packet count is %d\n", rtp_packet_count);
+
+ return size * nmemb;
+}
+
+/* build request url */
+static char *suburl(const char *base, int i)
+{
+ return curl_maprintf("%s%.4d", base, i);
+}
+
+int test(char *URL)
+{
+ int res;
+ CURL *curl;
+ char *stream_uri = NULL;
+ int request=1;
+ FILE *protofile = NULL;
+
+ protofile = fopen(libtest_arg2, "wb");
+ if(protofile == NULL) {
+ fprintf(stderr, "Couldn't open the protocol dump file\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ fclose(protofile);
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ fclose(protofile);
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+ test_setopt(curl, CURLOPT_URL, URL);
+
+ if((stream_uri = suburl(URL, request++)) == NULL) {
+ res = TEST_ERR_MAJOR_BAD;
+ goto test_cleanup;
+ }
+ test_setopt(curl, CURLOPT_RTSP_STREAM_URI, stream_uri);
+ free(stream_uri);
+ stream_uri = NULL;
+
+ test_setopt(curl, CURLOPT_INTERLEAVEFUNCTION, rtp_write);
+ test_setopt(curl, CURLOPT_TIMEOUT, 3);
+ test_setopt(curl, CURLOPT_VERBOSE, 1L);
+ test_setopt(curl, CURLOPT_WRITEDATA, protofile);
+
+ test_setopt(curl, CURLOPT_RTSP_TRANSPORT, "RTP/AVP/TCP;interleaved=0-1");
+ test_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_SETUP);
+
+ res = curl_easy_perform(curl);
+ if(res)
+ goto test_cleanup;
+
+ /* This PLAY starts the interleave */
+ if((stream_uri = suburl(URL, request++)) == NULL) {
+ res = TEST_ERR_MAJOR_BAD;
+ goto test_cleanup;
+ }
+ test_setopt(curl, CURLOPT_RTSP_STREAM_URI, stream_uri);
+ free(stream_uri);
+ stream_uri = NULL;
+ test_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_PLAY);
+
+ res = curl_easy_perform(curl);
+ if(res)
+ goto test_cleanup;
+
+ /* The DESCRIBE request will try to consume data after the Content */
+ if((stream_uri = suburl(URL, request++)) == NULL) {
+ res = TEST_ERR_MAJOR_BAD;
+ goto test_cleanup;
+ }
+ test_setopt(curl, CURLOPT_RTSP_STREAM_URI, stream_uri);
+ free(stream_uri);
+ stream_uri = NULL;
+ test_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_DESCRIBE);
+
+ res = curl_easy_perform(curl);
+ if(res)
+ goto test_cleanup;
+
+ if((stream_uri = suburl(URL, request++)) == NULL) {
+ res = TEST_ERR_MAJOR_BAD;
+ goto test_cleanup;
+ }
+ test_setopt(curl, CURLOPT_RTSP_STREAM_URI, stream_uri);
+ free(stream_uri);
+ stream_uri = NULL;
+ test_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_PLAY);
+
+ res = curl_easy_perform(curl);
+ if(res)
+ goto test_cleanup;
+
+ fprintf(stderr, "PLAY COMPLETE\n");
+
+ /* Use Receive to get the rest of the data */
+ while(!res && rtp_packet_count < 13) {
+ fprintf(stderr, "LOOPY LOOP!\n");
+ test_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_RECEIVE);
+ res = curl_easy_perform(curl);
+ }
+
+test_cleanup:
+
+ if(stream_uri)
+ free(stream_uri);
+
+ if(protofile)
+ fclose(protofile);
+
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return res;
+}
+
diff --git a/tests/libtest/lib572.c b/tests/libtest/lib572.c
new file mode 100644
index 000000000..18e74d4db
--- /dev/null
+++ b/tests/libtest/lib572.c
@@ -0,0 +1,169 @@
+
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ */
+
+#include "test.h"
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
+#include <curl/mprintf.h>
+
+#include "memdebug.h"
+
+/* build request url */
+static char *suburl(const char *base, int i)
+{
+ return curl_maprintf("%s%.4d", base, i);
+}
+
+/*
+ * Test GET_PARAMETER: PUT, HEARTBEAT, and POST
+ */
+int test(char *URL)
+{
+ int res;
+ CURL *curl;
+ int params;
+ FILE *paramsf = NULL;
+ struct_stat file_info;
+ char *stream_uri = NULL;
+ int request=1;
+ struct curl_slist *custom_headers=NULL;
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+
+ test_setopt(curl, CURLOPT_HEADERDATA, stdout);
+ test_setopt(curl, CURLOPT_WRITEDATA, stdout);
+ test_setopt(curl, CURLOPT_VERBOSE, 1L);
+
+ test_setopt(curl, CURLOPT_URL, URL);
+
+ /* SETUP */
+ if((stream_uri = suburl(URL, request++)) == NULL) {
+ res = TEST_ERR_MAJOR_BAD;
+ goto test_cleanup;
+ }
+ test_setopt(curl, CURLOPT_RTSP_STREAM_URI, stream_uri);
+ free(stream_uri);
+ stream_uri = NULL;
+
+ test_setopt(curl, CURLOPT_RTSP_TRANSPORT, "Planes/Trains/Automobiles");
+ test_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_SETUP);
+ res = curl_easy_perform(curl);
+ if(res)
+ goto test_cleanup;
+
+ if((stream_uri = suburl(URL, request++)) == NULL) {
+ res = TEST_ERR_MAJOR_BAD;
+ goto test_cleanup;
+ }
+ test_setopt(curl, CURLOPT_RTSP_STREAM_URI, stream_uri);
+ free(stream_uri);
+ stream_uri = NULL;
+
+ /* PUT style GET_PARAMETERS */
+ params = open("log/file572.txt", O_RDONLY);
+ fstat(params, &file_info);
+ close(params);
+
+ paramsf = fopen("log/file572.txt", "rb");
+ if(paramsf == NULL) {
+ fprintf(stderr, "can't open log/file572.txt\n");
+ res = TEST_ERR_MAJOR_BAD;
+ goto test_cleanup;
+ }
+ test_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_GET_PARAMETER);
+
+ test_setopt(curl, CURLOPT_READDATA, paramsf);
+ test_setopt(curl, CURLOPT_UPLOAD, 1L);
+ test_setopt(curl, CURLOPT_INFILESIZE_LARGE, (curl_off_t) file_info.st_size);
+
+ res = curl_easy_perform(curl);
+ if(res)
+ goto test_cleanup;
+
+ test_setopt(curl, CURLOPT_UPLOAD, 0L);
+ fclose(paramsf);
+ paramsf = NULL;
+
+ /* Heartbeat GET_PARAMETERS */
+ if((stream_uri = suburl(URL, request++)) == NULL) {
+ res = TEST_ERR_MAJOR_BAD;
+ goto test_cleanup;
+ }
+ test_setopt(curl, CURLOPT_RTSP_STREAM_URI, stream_uri);
+ free(stream_uri);
+ stream_uri = NULL;
+
+ res = curl_easy_perform(curl);
+ if(res)
+ goto test_cleanup;
+
+ /* POST GET_PARAMETERS */
+
+ if((stream_uri = suburl(URL, request++)) == NULL) {
+ res = TEST_ERR_MAJOR_BAD;
+ goto test_cleanup;
+ }
+ test_setopt(curl, CURLOPT_RTSP_STREAM_URI, stream_uri);
+ free(stream_uri);
+ stream_uri = NULL;
+
+ test_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_GET_PARAMETER);
+ test_setopt(curl, CURLOPT_POSTFIELDS, "packets_received\njitter\n");
+
+ res = curl_easy_perform(curl);
+ if(res)
+ goto test_cleanup;
+
+ test_setopt(curl, CURLOPT_POSTFIELDS, NULL);
+
+ /* Make sure we can do a normal request now */
+ if((stream_uri = suburl(URL, request++)) == NULL) {
+ res = TEST_ERR_MAJOR_BAD;
+ goto test_cleanup;
+ }
+ test_setopt(curl, CURLOPT_RTSP_STREAM_URI, stream_uri);
+ free(stream_uri);
+ stream_uri = NULL;
+
+ test_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_OPTIONS);
+ res = curl_easy_perform(curl);
+
+test_cleanup:
+
+ if(paramsf)
+ fclose(paramsf);
+
+ if(stream_uri)
+ free(stream_uri);
+
+ if(custom_headers)
+ curl_slist_free_all(custom_headers);
+
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return res;
+}
+
diff --git a/tests/libtest/lib573.c b/tests/libtest/lib573.c
new file mode 100644
index 000000000..5edb1814a
--- /dev/null
+++ b/tests/libtest/lib573.c
@@ -0,0 +1,102 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#include "testutil.h"
+#include "memdebug.h"
+
+#define MAIN_LOOP_HANG_TIMEOUT 90 * 1000
+#define MULTI_PERFORM_HANG_TIMEOUT 60 * 1000
+
+/*
+ * Get a single URL without select().
+ */
+
+int test(char *URL)
+{
+ CURL *c;
+ CURLM *m = NULL;
+ int res = 0;
+ int running=1;
+ double connect_time = 0.0;
+ struct timeval mp_start;
+ char mp_timedout = FALSE;
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((c = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ test_setopt(c, CURLOPT_HEADER, 1L);
+ test_setopt(c, CURLOPT_URL, URL);
+
+ if ((m = curl_multi_init()) == NULL) {
+ fprintf(stderr, "curl_multi_init() failed\n");
+ curl_easy_cleanup(c);
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((res = (int)curl_multi_add_handle(m, c)) != CURLM_OK) {
+ fprintf(stderr, "curl_multi_add_handle() failed, "
+ "with code %d\n", res);
+ curl_multi_cleanup(m);
+ curl_easy_cleanup(c);
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ mp_timedout = FALSE;
+ mp_start = tutil_tvnow();
+
+ while (running) {
+ res = (int)curl_multi_perform(m, &running);
+ if (tutil_tvdiff(tutil_tvnow(), mp_start) >
+ MULTI_PERFORM_HANG_TIMEOUT) {
+ mp_timedout = TRUE;
+ break;
+ }
+ if (running <= 0) {
+ fprintf(stderr, "nothing left running.\n");
+ break;
+ }
+ }
+
+ if (mp_timedout) {
+ if (mp_timedout) fprintf(stderr, "mp_timedout\n");
+ fprintf(stderr, "ABORTING TEST, since it seems "
+ "that it would have run forever.\n");
+ res = TEST_ERR_RUNS_FOREVER;
+ }
+
+ curl_easy_getinfo(c, CURLINFO_CONNECT_TIME, &connect_time);
+ if (connect_time <= 0.0) {
+ fprintf(stderr, "connect time is <=0.0\n");
+ res = TEST_ERR_MAJOR_BAD;
+ }
+
+test_cleanup:
+
+ if(m) {
+ curl_multi_remove_handle(m, c);
+ curl_multi_cleanup(m);
+ }
+ curl_easy_cleanup(c);
+ curl_global_cleanup();
+
+ return res;
+}
+
diff --git a/tests/libtest/lib574.c b/tests/libtest/lib574.c
new file mode 100644
index 000000000..69b2979a8
--- /dev/null
+++ b/tests/libtest/lib574.c
@@ -0,0 +1,56 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#include "memdebug.h"
+
+static int new_fnmatch(const char *pattern, const char *string)
+{
+ (void)pattern;
+ (void)string;
+ return CURL_FNMATCHFUNC_MATCH;
+}
+
+int test(char *URL)
+{
+ int res;
+ CURL *curl;
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ test_setopt(curl, CURLOPT_URL, URL);
+ test_setopt(curl, CURLOPT_WILDCARDMATCH, 1L);
+ test_setopt(curl, CURLOPT_FNMATCH_FUNCTION, new_fnmatch);
+
+ res = curl_easy_perform(curl);
+ if(res) {
+ fprintf(stderr, "curl_easy_perform() failed %d\n", res);
+ goto test_cleanup;
+ }
+ res = curl_easy_perform(curl);
+ if(res) {
+ fprintf(stderr, "curl_easy_perform() failed %d\n", res);
+ goto test_cleanup;
+ }
+
+test_cleanup:
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+ return res;
+}
diff --git a/tests/libtest/lib575.c b/tests/libtest/lib575.c
new file mode 100644
index 000000000..521720e95
--- /dev/null
+++ b/tests/libtest/lib575.c
@@ -0,0 +1,109 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include "testutil.h"
+#include "memdebug.h"
+
+/* 3x download!
+ * 1. normal
+ * 2. dup handle
+ * 3. with multi interface
+ */
+
+int test(char *URL)
+{
+ CURLMcode m;
+ CURL *handle = NULL, *duphandle;
+ CURLM *mhandle = NULL;
+ int res = 0;
+ int still_running = 0;
+
+ if(curl_global_init(CURL_GLOBAL_ALL)) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ goto test_cleanup;
+ }
+
+ handle = curl_easy_init();
+ if(!handle) {
+ res = CURLE_OUT_OF_MEMORY;
+ goto test_cleanup;
+ }
+
+ test_setopt(handle, CURLOPT_URL, URL);
+ test_setopt(handle, CURLOPT_WILDCARDMATCH, 1L);
+ test_setopt(handle, CURLOPT_VERBOSE, 1L);
+
+ res = curl_easy_perform(handle);
+ if(res)
+ goto test_cleanup;
+
+ res = curl_easy_perform(handle);
+ if(res)
+ goto test_cleanup;
+
+ duphandle = curl_easy_duphandle(handle);
+ if(!duphandle)
+ goto test_cleanup;
+ curl_easy_cleanup(handle);
+ handle = duphandle;
+
+ mhandle = curl_multi_init();
+ if(!mhandle) {
+ fprintf(stderr, "curl_multi_init() failed\n");
+ goto test_cleanup;
+ }
+
+ curl_multi_add_handle(mhandle, handle);
+
+ while(CURLM_CALL_MULTI_PERFORM ==
+ curl_multi_perform(mhandle, &still_running));
+
+ while(still_running) {
+ static struct timeval timeout = /* 100 ms */ { 0, 100000L };
+ int rc;
+ fd_set fdread;
+ fd_set fdwrite;
+ fd_set fdexcep;
+ int max_fdset = -1;
+ FD_ZERO(&fdread);
+ FD_ZERO(&fdwrite);
+ FD_ZERO(&fdexcep);
+
+ m = curl_multi_fdset(mhandle, &fdread, &fdwrite, &fdexcep, &max_fdset);
+ if(m != CURLM_OK) {
+ fprintf(stderr, "curl_multi_fdset() error\n");
+ goto test_cleanup;
+ }
+ /* We call select(max_fdset + 1, ...), specially in case of (maxfd == -1),
+ * we call select(0, ...), which is basically equal to sleep. */
+ rc = select(max_fdset + 1, &fdread, &fdwrite, &fdexcep, &timeout);
+ if(rc == -1) {
+ fprintf(stderr, "select() error\n");
+ goto test_cleanup;
+ }
+ else {
+ while(CURLM_CALL_MULTI_PERFORM ==
+ curl_multi_perform(mhandle, &still_running));
+ }
+ }
+
+test_cleanup:
+ if(mhandle)
+ curl_multi_cleanup(mhandle);
+ if(handle)
+ curl_easy_cleanup(handle);
+ curl_global_cleanup();
+ return res;
+}
diff --git a/tests/libtest/lib576.c b/tests/libtest/lib576.c
new file mode 100644
index 000000000..821eb61ac
--- /dev/null
+++ b/tests/libtest/lib576.c
@@ -0,0 +1,111 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+#include "testutil.h"
+#include "memdebug.h"
+
+typedef struct {
+ int remains;
+ int print_content;
+} chunk_data_t;
+
+static
+long chunk_bgn(const struct curl_fileinfo *finfo, void *ptr, int remains);
+static
+long chunk_end(void *ptr);
+
+static
+long chunk_bgn(const struct curl_fileinfo *finfo, void *ptr, int remains)
+{
+ chunk_data_t *ch_d = ptr;
+ ch_d->remains = remains;
+
+ printf("=============================================================\n");
+ printf("Remains: %d\n", remains);
+ printf("Filename: %s\n", finfo->filename);
+ if(finfo->strings.perm) {
+ printf("Permissions: %s", finfo->strings.perm);
+ if(finfo->flags & CURLFINFOFLAG_KNOWN_PERM)
+ printf(" (parsed => %o)", finfo->perm);
+ printf("\n");
+ }
+ printf("Size: %ldB\n", (long)finfo->size);
+ if(finfo->strings.user)
+ printf("User: %s\n", finfo->strings.user);
+ if(finfo->strings.group)
+ printf("Group: %s\n", finfo->strings.group);
+ if(finfo->strings.time)
+ printf("Time: %s\n", finfo->strings.time);
+ printf("Filetype: ");
+ switch(finfo->filetype) {
+ case CURLFILETYPE_FILE:
+ printf("regular file\n");
+ break;
+ case CURLFILETYPE_DIRECTORY:
+ printf("directory\n");
+ break;
+ case CURLFILETYPE_SYMLINK:
+ printf("symlink\n");
+ printf("Target: %s\n", finfo->strings.target);
+ break;
+ default:
+ printf("other type\n");
+ break;
+ }
+ if(finfo->filetype == CURLFILETYPE_FILE) {
+ ch_d->print_content = 1;
+ printf("Content:\n-------------------------------------------------------------\n");
+ }
+ if(strcmp(finfo->filename, "someothertext.txt") == 0) {
+ printf("# THIS CONTENT WAS SKIPPED IN CHUNK_BGN CALLBACK #\n");
+ return CURL_CHUNK_BGN_FUNC_SKIP;
+ }
+ return CURL_CHUNK_BGN_FUNC_OK;
+}
+
+static
+long chunk_end(void *ptr)
+{
+ chunk_data_t *ch_d = ptr;
+ if(ch_d->print_content) {
+ ch_d->print_content = 0;
+ printf("-------------------------------------------------------------\n");
+ }
+ if(ch_d->remains == 1)
+ printf("=============================================================\n");
+ return CURL_CHUNK_END_FUNC_OK;
+}
+
+int test(char *URL)
+{
+ CURL *handle = NULL;
+ CURLcode res = CURLE_OK;
+ chunk_data_t chunk_data = {0,0};
+ curl_global_init(CURL_GLOBAL_ALL);
+ handle = curl_easy_init();
+ if(!handle) {
+ res = CURLE_OUT_OF_MEMORY;
+ goto test_cleanup;
+ }
+
+ test_setopt(handle, CURLOPT_URL, URL);
+ test_setopt(handle, CURLOPT_WILDCARDMATCH, 1L);
+ test_setopt(handle, CURLOPT_CHUNK_BGN_FUNCTION, chunk_bgn);
+ test_setopt(handle, CURLOPT_CHUNK_END_FUNCTION, chunk_end);
+ test_setopt(handle, CURLOPT_CHUNK_DATA, &chunk_data);
+
+ res = curl_easy_perform(handle);
+
+test_cleanup:
+ if(handle)
+ curl_easy_cleanup(handle);
+ curl_global_cleanup();
+ return res;
+}
diff --git a/tests/libtest/lib577.c b/tests/libtest/lib577.c
new file mode 100644
index 000000000..bd52c6251
--- /dev/null
+++ b/tests/libtest/lib577.c
@@ -0,0 +1,255 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+/*
+ * This hacky test bypasses the library external API,
+ * using internal only libcurl functions. So don't be
+ * surprised if we cannot run it when the library has
+ * been built with hidden symbols, exporting only the
+ * ones in the public API.
+ */
+
+#if defined(CURL_HIDDEN_SYMBOLS)
+# define SKIP_TEST 1
+#elif defined(WIN32) && !defined(CURL_STATICLIB)
+# define SKIP_TEST 1
+#else
+# undef SKIP_TEST
+#endif
+
+
+#if !defined(SKIP_TEST)
+
+#include "memdebug.h"
+
+#include "curl_fnmatch.h"
+
+#define MATCH CURL_FNMATCH_MATCH
+#define NOMATCH CURL_FNMATCH_NOMATCH
+#define RE_ERR CURL_FNMATCH_FAIL
+
+#define MAX_PATTERN_L 100
+#define MAX_STRING_L 100
+
+struct testcase {
+ char pattern[MAX_PATTERN_L];
+ char string[MAX_STRING_L];
+ int result;
+};
+
+static const struct testcase tests[] = {
+ /* brackets syntax */
+ { "\\[", "[", MATCH },
+ { "[", "[", RE_ERR },
+ { "[]", "[]", RE_ERR },
+ { "[][]", "[", MATCH },
+ { "[][]", "]", MATCH },
+ { "[[]", "[", MATCH },
+ { "[[[]", "[", MATCH },
+ { "[[[[]", "[", MATCH },
+ { "[[[[]", "[", MATCH },
+
+ { "[][[]", "]", MATCH },
+ { "[][[[]", "[", MATCH },
+ { "[[]", "]", NOMATCH },
+
+ { "[a-z]", "a", MATCH },
+ { "[a-z]", "A", NOMATCH },
+ { "?[a-z]", "?Z", NOMATCH },
+ { "[A-Z]", "C", MATCH },
+ { "[A-Z]", "c", NOMATCH },
+ { "[0-9]", "7", MATCH },
+ { "[7-8]", "7", MATCH },
+ { "[7-]", "7", MATCH },
+ { "[7-]", "-", MATCH },
+ { "[7-]", "[", NOMATCH },
+ { "[a-bA-F]", "F", MATCH },
+ { "[a-bA-B9]", "9", MATCH },
+ { "[a-bA-B98]", "8", MATCH },
+ { "[a-bA-B98]", "C", NOMATCH },
+ { "[a-bA-Z9]", "F", MATCH },
+ { "[a-bA-Z9]ero*", "Zero chance.", MATCH },
+ { "S[a-][x]opho*", "Saxophone", MATCH },
+ { "S[a-][x]opho*", "SaXophone", NOMATCH },
+ { "S[a-][x]*.txt", "S-x.txt", MATCH },
+ { "[\\a-\\b]", "a", MATCH },
+ { "[\\a-\\b]", "b", MATCH },
+ { "[?*[][?*[][?*[]", "?*[", MATCH },
+ { "[][?*-]", "]", MATCH },
+ { "[][?*-]", "[", MATCH },
+ { "[][?*-]", "?", MATCH },
+ { "[][?*-]", "*", MATCH },
+ { "[][?*-]", "-", MATCH },
+ { "[]?*-]", "-", MATCH },
+ { "?/b/c", "a/b/c", MATCH },
+ { "^_{}~", "^_{}~", MATCH },
+ { "!#%+,-./01234567889", "!#%+,-./01234567889", MATCH },
+ { "PQRSTUVWXYZ]abcdefg", "PQRSTUVWXYZ]abcdefg", MATCH },
+ { ":;=@ABCDEFGHIJKLMNO", ":;=@ABCDEFGHIJKLMNO", MATCH },
+
+ /* negate */
+ { "[!a]", "b", MATCH },
+ { "[!a]", "a", NOMATCH },
+ { "[^a]", "b", MATCH },
+ { "[^a]", "a", NOMATCH },
+ { "[^a-z0-9A-Z]", "a", NOMATCH },
+ { "[^a-z0-9A-Z]", "-", MATCH },
+ { "curl[!a-z]lib", "curl lib", MATCH },
+ { "curl[! ]lib", "curl lib", NOMATCH },
+ { "[! ][ ]", " ", NOMATCH },
+ { "[! ][ ]", "a ", MATCH },
+ { "*[^a].t?t", "a.txt", NOMATCH },
+ { "*[^a].t?t", "ba.txt", NOMATCH },
+ { "*[^a].t?t", "ab.txt", MATCH },
+ { "[!?*[]", "?", NOMATCH },
+ { "[!!]", "!", NOMATCH },
+ { "[!!]", "x", MATCH },
+
+ { "[[:alpha:]]", "a", MATCH },
+ { "[[:alpha:]]", "9", NOMATCH },
+ { "[[:alnum:]]", "a", MATCH },
+ { "[[:alnum:]]", "[", NOMATCH },
+ { "[[:alnum:]]", "]", NOMATCH },
+ { "[[:alnum:]]", "9", MATCH },
+ { "[[:digit:]]", "9", MATCH },
+ { "[[:xdigit:]]", "9", MATCH },
+ { "[[:xdigit:]]", "F", MATCH },
+ { "[[:xdigit:]]", "G", NOMATCH },
+ { "[[:upper:]]", "U", MATCH },
+ { "[[:upper:]]", "u", NOMATCH },
+ { "[[:lower:]]", "l", MATCH },
+ { "[[:lower:]]", "L", NOMATCH },
+ { "[[:print:]]", "L", MATCH },
+ { "[[:print:]]", {'\10'}, NOMATCH },
+ { "[[:print:]]", {'\10'}, NOMATCH },
+ { "[[:space:]]", " ", MATCH },
+ { "[[:space:]]", "x", NOMATCH },
+ { "[[:graph:]]", " ", NOMATCH },
+ { "[[:graph:]]", "x", MATCH },
+ { "[[:blank:]]", {'\t'}, MATCH },
+ { "[[:blank:]]", {' '}, MATCH },
+ { "[[:blank:]]", {'\r'}, NOMATCH },
+ { "[^[:blank:]]", {'\t'}, NOMATCH },
+ { "[^[:print:]]", {'\10'}, MATCH },
+ { "[[:lower:]][[:lower:]]", "ll", MATCH },
+
+ { "Curl[[:blank:]];-)", "Curl ;-)", MATCH },
+ { "*[[:blank:]]*", " ", MATCH },
+ { "*[[:blank:]]*", "", NOMATCH },
+ { "*[[:blank:]]*", "hi, im_Pavel", MATCH },
+
+ /* common using */
+ { "filename.dat", "filename.dat", MATCH },
+ { "*curl*", "lets use curl!!", MATCH },
+ { "filename.txt", "filename.dat", NOMATCH },
+ { "*.txt", "text.txt", MATCH },
+ { "*.txt", "a.txt", MATCH },
+ { "*.txt", ".txt", MATCH },
+ { "*.txt", "txt", NOMATCH },
+ { "??.txt", "99.txt", MATCH },
+ { "??.txt", "a99.txt", NOMATCH },
+ { "?.???", "a.txt", MATCH },
+ { "*.???", "somefile.dat", MATCH },
+ { "*.???", "photo.jpeg", NOMATCH },
+ { ".*", ".htaccess", MATCH },
+ { ".*", ".", MATCH },
+ { ".*", "..", MATCH },
+
+ /* many stars => one star */
+ { "**.txt", "text.txt", MATCH },
+ { "***.txt", "t.txt", MATCH },
+ { "****.txt", ".txt", MATCH },
+
+ /* empty string or pattern */
+ { "", "", MATCH } ,
+ { "", "hello", NOMATCH },
+ { "file", "", NOMATCH },
+ { "?", "", NOMATCH },
+ { "*", "", MATCH },
+ { "x", "", NOMATCH },
+
+ /* backslash */
+ { "\\", "\\", RE_ERR },
+ { "\\\\", "\\", MATCH },
+ { "\\\\", "\\\\", NOMATCH },
+ { "\\?", "?", MATCH },
+ { "\\*", "*", MATCH },
+ { "?.txt", "?.txt", MATCH },
+ { "*.txt", "*.txt", MATCH },
+ { "\\?.txt", "?.txt", MATCH },
+ { "\\*.txt", "*.txt", MATCH },
+ { "\\?.txt", "x.txt", NOMATCH },
+ { "\\*.txt", "x.txt", NOMATCH },
+ { "\\*\\\\.txt", "*\\.txt", MATCH },
+ { "*\\**\\?*\\\\*", "cc*cc?cc\\cc*cc", MATCH },
+ { "*\\**\\?*\\\\*", "cc*cc?cccc", NOMATCH },
+ { "*\\**\\?*\\\\*", "cc*cc?cc\\cc*cc", MATCH },
+ { "*\\?*\\**", "cc?c*c", MATCH },
+ { "*\\?*\\**curl*", "cc?c*curl", MATCH },
+ { "*\\?*\\**", "cc?cc", NOMATCH },
+ { "\\\"\\$\\&\\'\\(\\)", "\"$&'()", MATCH },
+ { "\\*\\?\\[\\\\\\`\\|", "*?[\\`|", MATCH },
+ { "[\\a\\b]c", "ac", MATCH },
+ { "[\\a\\b]c", "bc", MATCH },
+ { "[\\a\\b]d", "bc", NOMATCH },
+ { "[a-bA-B\\?]", "?", MATCH },
+ { "cu[a-ab-b\\r]l", "curl", MATCH },
+ { "[\\a-z]", "c", MATCH },
+
+ { "?*?*?.*?*", "abc.c", MATCH },
+ { "?*?*?.*?*", "abcc", NOMATCH },
+ { "?*?*?.*?*", "abc.", NOMATCH },
+ { "?*?*?.*?*", "abc.c++", MATCH },
+ { "?*?*?.*?*", "abcdef.c++", MATCH },
+ { "?*?*?.?", "abcdef.c", MATCH },
+ { "?*?*?.?", "abcdef.cd", NOMATCH },
+
+ { "Lindmätarv", "Lindmätarv", MATCH },
+
+ { "", "", MATCH }
+};
+
+
+int test(char *URL)
+{
+ int testnum = sizeof(tests) / sizeof(struct testcase);
+ int i, rc;
+ (void)URL; /* not used */
+
+ if(!strcmp(URL, "check")) {
+ /* test harness script verifying if this test can run */
+ return 0; /* sure, run this! */
+ }
+
+ printf("===========================\n");
+ for(i = 0; i < testnum; i++) {
+ rc = Curl_fnmatch(NULL, tests[i].pattern, tests[i].string);
+ if(rc != tests[i].result) {
+ printf("Curl_fnmatch(\"%s\", \"%s\") should return %d (returns %d)\n",
+ tests[i].pattern, tests[i].string, tests[i].result, rc);
+ }
+ }
+ printf("===========================\n");
+ return 0;
+}
+
+#else /* !defined(SKIP_TEST) */
+
+
+int test(char *URL)
+{
+ (void)URL;
+ fprintf(stdout, "libcurl built with hidden symbols");
+ return 1; /* skip test */
+}
+
+
+#endif /* !defined(SKIP_TEST) */
diff --git a/tests/libtest/lib578.c b/tests/libtest/lib578.c
new file mode 100644
index 000000000..2efb003ae
--- /dev/null
+++ b/tests/libtest/lib578.c
@@ -0,0 +1,90 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#include "memdebug.h"
+
+/* The size of data should be kept below MAX_INITIAL_POST_SIZE! */
+static char data[]="this is a short string.\n";
+
+static size_t data_size = sizeof(data) / sizeof(char);
+
+static int progress_callback(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow)
+{
+ FILE *moo = fopen(libtest_arg2, "wb");
+
+ (void)clientp; /* UNUSED */
+ (void)dltotal; /* UNUSED */
+ (void)dlnow; /* UNUSED */
+
+ if(moo) {
+ if ((size_t)ultotal == data_size && (size_t)ulnow == data_size)
+ fprintf(moo, "PASSED, UL data matched data size\n");
+ else
+ fprintf(moo, "Progress callback called with UL %f out of %f\n", ulnow, ultotal);
+ fclose(moo);
+ }
+ return 0;
+}
+
+int test(char *URL)
+{
+ CURL *curl;
+ CURLcode res=CURLE_OK;
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ /* First set the URL that is about to receive our POST. */
+ test_setopt(curl, CURLOPT_URL, URL);
+
+ /* Now specify we want to POST data */
+ test_setopt(curl, CURLOPT_POST, 1L);
+
+#ifdef CURL_DOES_CONVERSIONS
+ /* Convert the POST data to ASCII */
+ test_setopt(curl, CURLOPT_TRANSFERTEXT, 1L);
+#endif
+
+ /* Set the expected POST size */
+ test_setopt(curl, CURLOPT_POSTFIELDSIZE, data_size);
+ test_setopt(curl, CURLOPT_POSTFIELDS, data);
+
+ /* we want to use our own progress function */
+ test_setopt(curl, CURLOPT_NOPROGRESS, 0L);
+ test_setopt(curl, CURLOPT_PROGRESSFUNCTION, progress_callback);
+
+ /* pointer to pass to our read function */
+
+ /* get verbose debug output please */
+ test_setopt(curl, CURLOPT_VERBOSE, 1L);
+
+ /* include headers in the output */
+ test_setopt(curl, CURLOPT_HEADER, 1L);
+
+ /* Perform the request, res will get the return code */
+ res = curl_easy_perform(curl);
+
+test_cleanup:
+
+ /* always cleanup */
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return res;
+}
diff --git a/tests/libtest/lib579.c b/tests/libtest/lib579.c
new file mode 100644
index 000000000..2b80ab0b6
--- /dev/null
+++ b/tests/libtest/lib579.c
@@ -0,0 +1,149 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "test.h"
+
+#include "memdebug.h"
+
+static const char * const post[]={
+ "one",
+ "two",
+ "three",
+ "and a final longer crap: four",
+ NULL
+};
+
+
+struct WriteThis {
+ int counter;
+};
+
+static int progress_callback(void *clientp, double dltotal, double dlnow,
+ double ultotal, double ulnow)
+{
+ FILE *moo;
+ static int prev_ultotal = -1;
+ static int prev_ulnow = -1;
+ (void)clientp; /* UNUSED */
+ (void)dltotal; /* UNUSED */
+ (void)dlnow; /* UNUSED */
+
+ /* to avoid depending on timing, which will cause this progress function to
+ get called a different number of times depending on circumstances, we
+ only log these lines if the numbers are different from the previous
+ invoke */
+ if((prev_ultotal != (int)ultotal) ||
+ (prev_ulnow != (int)ulnow)) {
+
+ moo = fopen(libtest_arg2, "ab");
+ if(moo) {
+ fprintf(moo, "Progress callback called with UL %d out of %d\n",
+ (int)ulnow, (int)ultotal);
+ fclose(moo);
+ }
+ prev_ulnow = (int) ulnow;
+ prev_ultotal = (int) ultotal;
+ }
+ return 0;
+}
+
+static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *userp)
+{
+ struct WriteThis *pooh = (struct WriteThis *)userp;
+ const char *data;
+
+ if(size*nmemb < 1)
+ return 0;
+
+ data = post[pooh->counter];
+
+ if(data) {
+ size_t len = strlen(data);
+ memcpy(ptr, data, len);
+ pooh->counter++; /* advance pointer */
+ return len;
+ }
+ return 0; /* no more data left to deliver */
+}
+
+int test(char *URL)
+{
+ CURL *curl;
+ CURLcode res=CURLE_OK;
+ struct curl_slist *slist = NULL;
+ struct WriteThis pooh;
+ pooh.counter = 0;
+
+ if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+ fprintf(stderr, "curl_global_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ if ((curl = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ slist = curl_slist_append(slist, "Transfer-Encoding: chunked");
+ if (slist == NULL) {
+ fprintf(stderr, "curl_slist_append() failed\n");
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ /* First set the URL that is about to receive our POST. */
+ test_setopt(curl, CURLOPT_URL, URL);
+
+ /* Now specify we want to POST data */
+ test_setopt(curl, CURLOPT_POST, 1L);
+
+#ifdef CURL_DOES_CONVERSIONS
+ /* Convert the POST data to ASCII */
+ test_setopt(curl, CURLOPT_TRANSFERTEXT, 1L);
+#endif
+
+ /* we want to use our own read function */
+ test_setopt(curl, CURLOPT_READFUNCTION, read_callback);
+
+ /* pointer to pass to our read function */
+ test_setopt(curl, CURLOPT_INFILE, &pooh);
+
+ /* get verbose debug output please */
+ test_setopt(curl, CURLOPT_VERBOSE, 1L);
+
+ /* include headers in the output */
+ test_setopt(curl, CURLOPT_HEADER, 1L);
+
+ /* enforce chunked transfer by setting the header */
+ test_setopt(curl, CURLOPT_HTTPHEADER, slist);
+
+ test_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
+ test_setopt(curl, CURLOPT_USERPWD, "foo:bar");
+
+ /* we want to use our own progress function */
+ test_setopt(curl, CURLOPT_NOPROGRESS, 0L);
+ test_setopt(curl, CURLOPT_PROGRESSFUNCTION, progress_callback);
+
+ /* Perform the request, res will get the return code */
+ res = curl_easy_perform(curl);
+
+test_cleanup:
+
+ /* clean up the headers list */
+ if(slist)
+ curl_slist_free_all(slist);
+
+ /* always cleanup */
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return res;
+}
diff --git a/tests/libtest/sethostname.c b/tests/libtest/sethostname.c
new file mode 100644
index 000000000..3dabb8231
--- /dev/null
+++ b/tests/libtest/sethostname.c
@@ -0,0 +1,29 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#include "setup.h"
+
+#include "sethostname.h"
+
+/*
+ * we force our own host name, in order to make some tests machine independent
+ */
+
+int gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen)
+{
+ const char *force_hostname = getenv("CURL_GETHOSTNAME");
+ if(force_hostname) {
+ strncpy(name, force_hostname, namelen);
+ name[namelen-1] = '\0';
+ return 0;
+ }
+
+ /* LD_PRELOAD used, but no hostname set, we'll just return a failure */
+ return -1;
+}
diff --git a/tests/libtest/sethostname.h b/tests/libtest/sethostname.h
new file mode 100644
index 000000000..83034a536
--- /dev/null
+++ b/tests/libtest/sethostname.h
@@ -0,0 +1,32 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+#if (defined(WIN32) || defined(__SYMBIAN32__)) && !defined(CURL_STATICLIB)
+# if defined(BUILDING_LIBCURL)
+# define LIBHOSTNAME_EXTERN __declspec(dllexport)
+# else
+# define LIBHOSTNAME_EXTERN __declspec(dllimport)
+# endif
+#else
+# ifdef CURL_HIDDEN_SYMBOLS
+# define LIBHOSTNAME_EXTERN CURL_EXTERN_SYMBOL
+# else
+# define LIBHOSTNAME_EXTERN
+# endif
+#endif
+
+#ifdef USE_WINSOCK
+# define FUNCALLCONV __stdcall
+#else
+# define FUNCALLCONV
+#endif
+
+LIBHOSTNAME_EXTERN int FUNCALLCONV
+ gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen);
+
diff --git a/tests/libtest/test.h b/tests/libtest/test.h
new file mode 100644
index 000000000..2a3671181
--- /dev/null
+++ b/tests/libtest/test.h
@@ -0,0 +1,59 @@
+/*****************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ */
+
+/* Now include the setup.h file from libcurl's private libdir (the source
+ version, but that might include "curl_config.h" from the build dir so we
+ need both of them in the include path), so that we get good in-depth
+ knowledge about the system we're building this on */
+
+#define CURL_NO_OLDIES
+
+#include "setup.h"
+
+#include <curl/curl.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <errno.h>
+
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_SYS_SELECT_H
+/* since so many tests use select(), we can just as well include it here */
+#include <sys/select.h>
+#endif
+#ifdef HAVE_UNISTD_H
+/* at least somewhat oldish FreeBSD systems need this for select() */
+#include <unistd.h>
+#endif
+
+#ifdef TPF
+# include "select.h"
+#endif
+
+#define TEST_ERR_MAJOR_BAD 100
+#define TEST_ERR_RUNS_FOREVER 99
+
+#define test_setopt(A,B,C) \
+ if((res = curl_easy_setopt((A),(B),(C))) != CURLE_OK) goto test_cleanup
+
+extern char *libtest_arg2; /* set by first.c to the argv[2] or NULL */
+extern char *libtest_arg3; /* set by first.c to the argv[3] or NULL */
+
+/* argc and argv as passed in to the main() function */
+extern int test_argc;
+extern char **test_argv;
+
+extern int select_test(int num_fds, fd_set *rd, fd_set *wr, fd_set *exc,
+ struct timeval *tv);
+
+extern int test(char *URL); /* the actual test function provided by each
+ individual libXXX.c file */
+
diff --git a/tests/libtest/test1013.pl b/tests/libtest/test1013.pl
new file mode 100755
index 000000000..99ad524eb
--- /dev/null
+++ b/tests/libtest/test1013.pl
@@ -0,0 +1,49 @@
+#!/usr/bin/env perl
+# Determine if curl-config --protocols/--features matches the
+# curl --version protocols/features
+if ( $#ARGV != 2 )
+{
+ print "Usage: $0 curl-config-script curl-version-output-file features|protocols\n";
+ exit 3;
+}
+
+my $what=$ARGV[2];
+
+# Read the output of curl --version
+my $curl_protocols="";
+open(CURL, "$ARGV[1]") || die "Can't get curl $what list\n";
+while( <CURL> )
+{
+ $curl_protocols = lc($_) if ( /$what:/i );
+}
+close CURL;
+
+$curl_protocols =~ /\w+: (.*)$/;
+@curl = split / /,$1;
+
+# These features are not supported by curl-config
+@curl = grep(!/^(Debug|TrackMemory|Largefile|CharConv|GSS-Negotiate|SPNEGO)$/i, @curl);
+@curl = sort @curl;
+
+# Read the output of curl-config
+my @curl_config;
+open(CURLCONFIG, "sh $ARGV[0] --$what|") || die "Can't get curl-config $what list\n";
+while( <CURLCONFIG> )
+{
+ chomp;
+ push @curl_config, lc($_);
+}
+close CURLCONFIG;
+
+@curl_config = sort @curl_config;
+
+my $curlproto = join ' ', @curl;
+my $curlconfigproto = join ' ', @curl_config;
+
+my $different = $curlproto ne $curlconfigproto;
+if ($different) {
+ print "Mismatch in $what lists:\n";
+ print "curl: $curlproto\n";
+ print "curl-config: $curlconfigproto\n";
+}
+exit $different;
diff --git a/tests/libtest/test1022.pl b/tests/libtest/test1022.pl
new file mode 100755
index 000000000..60eee384c
--- /dev/null
+++ b/tests/libtest/test1022.pl
@@ -0,0 +1,45 @@
+#!/usr/bin/env perl
+# Determine if curl-config --version matches the curl --version
+if ( $#ARGV != 2 )
+{
+ print "Usage: $0 curl-config-script curl-version-output-file version|vernum\n";
+ exit 3;
+}
+
+my $what=$ARGV[2];
+
+# Read the output of curl --version
+open(CURL, "$ARGV[1]") || die "Can't open curl --version list in $ARGV[1]\n";
+$_ = <CURL>;
+chomp;
+/libcurl\/([\.\d]+(-DEV)?)/;
+my $version = $1;
+close CURL;
+
+my $curlconfigversion;
+
+# Read the output of curl-config --version/--vernum
+open(CURLCONFIG, "sh $ARGV[0] --$what|") || die "Can't get curl-config --$what list\n";
+$_ = <CURLCONFIG>;
+chomp;
+if ( $what eq "version" ) {
+ /^libcurl ([\.\d]+(-DEV)?)$/ ;
+ $curlconfigversion = $1;
+}
+else {
+ # Convert hex version to decimal for comparison's sake
+ /^(..)(..)(..)$/ ;
+ $curlconfigversion = hex($1) . "." . hex($2) . "." . hex($3);
+
+ # Strip off the -DEV from the curl version if it's there
+ $version =~ s/-DEV$//;
+}
+close CURLCONFIG;
+
+my $different = $version ne $curlconfigversion;
+if ($different || !$version) {
+ print "Mismatch in --version:\n";
+ print "curl: $version\n";
+ print "curl-config: $curlconfigversion\n";
+ exit 1;
+}
diff --git a/tests/libtest/test307.pl b/tests/libtest/test307.pl
new file mode 100755
index 000000000..469af3c21
--- /dev/null
+++ b/tests/libtest/test307.pl
@@ -0,0 +1,19 @@
+#!/usr/bin/env perl
+# Determine if the given curl executable supports the 'openssl' SSL engine
+if ( $#ARGV != 0 )
+{
+ print "Usage: $0 curl-executable\n";
+ exit 3;
+}
+if (!open(CURL, "@ARGV[0] -s --engine list|"))
+{
+ print "Can't get SSL engine list\n";
+ exit 2;
+}
+while( <CURL> )
+{
+ exit 0 if ( /openssl/ );
+}
+close CURL;
+print "openssl engine not supported\n";
+exit 1;
diff --git a/tests/libtest/test610.pl b/tests/libtest/test610.pl
new file mode 100755
index 000000000..a900d94b4
--- /dev/null
+++ b/tests/libtest/test610.pl
@@ -0,0 +1,33 @@
+#!/usr/bin/env perl
+# Perform simple file and directory manipulation in a portable way
+if ( $#ARGV <= 0 )
+{
+ print "Usage: $0 mkdir|rmdir|rm|move|gone path1 [path2] [more commands...]\n";
+ exit 1;
+}
+
+use File::Copy;
+while(@ARGV) {
+ my $cmd = shift @ARGV;
+ my $arg = shift @ARGV;
+ if ($cmd eq "mkdir") {
+ mkdir $arg || die "$!";
+ }
+ elsif ($cmd eq "rmdir") {
+ rmdir $arg || die "$!";
+ }
+ elsif ($cmd eq "rm") {
+ unlink $arg || die "$!";
+ }
+ elsif ($cmd eq "move") {
+ my $arg2 = shift @ARGV;
+ move($arg,$arg2) || die "$!";
+ }
+ elsif ($cmd eq "gone") {
+ ! -e $arg || die "Path $arg exists";
+ } else {
+ print "Unsupported command $cmd\n";
+ exit 1;
+ }
+}
+exit 0;
diff --git a/tests/libtest/test613.pl b/tests/libtest/test613.pl
new file mode 100755
index 000000000..b4caaae07
--- /dev/null
+++ b/tests/libtest/test613.pl
@@ -0,0 +1,105 @@
+#!/usr/bin/env perl
+# Prepare a directory with known files and clean up afterwards
+use Time::Local;
+
+if ( $#ARGV < 1 )
+{
+ print "Usage: $0 prepare|postprocess dir [logfile]\n";
+ exit 1;
+}
+
+# <precheck> expects an error message on stdout
+sub errout {
+ print $_[0] . "\n";
+ exit 1;
+}
+
+if ($ARGV[0] eq "prepare")
+{
+ my $dirname = $ARGV[1];
+ mkdir $dirname || errout "$!";
+ chdir $dirname;
+
+ # Create the files in alphabetical order, to increase the chances
+ # of receiving a consistent set of directory contents regardless
+ # of whether the server alphabetizes the results or not.
+ mkdir "asubdir" || errout "$!";
+ chmod 0777, "asubdir";
+
+ open(FILE, ">plainfile.txt") || errout "$!";
+ binmode FILE;
+ print FILE "Test file to support curl test suite\n";
+ close(FILE);
+ utime time, timegm(0,0,12,1,0,100), "plainfile.txt";
+ chmod 0666, "plainfile.txt";
+
+ open(FILE, ">rofile.txt") || errout "$!";
+ binmode FILE;
+ print FILE "Read-only test file to support curl test suite\n";
+ close(FILE);
+ utime time, timegm(0,0,12,31,11,100), "rofile.txt";
+ chmod 0444, "rofile.txt";
+
+ exit 0;
+}
+elsif ($ARGV[0] eq "postprocess")
+{
+ my $dirname = $ARGV[1];
+ my $logfile = $ARGV[2];
+
+ # Clean up the test directory
+ unlink "$dirname/rofile.txt";
+ unlink "$dirname/plainfile.txt";
+ rmdir "$dirname/asubdir";
+
+ rmdir $dirname || die "$!";
+
+ if ($logfile) {
+ # Process the directory file to remove all information that
+ # could be inconsistent from one test run to the next (e.g.
+ # file date) or may be unsupported on some platforms (e.g.
+ # Windows). Also, since 7.17.0, the sftp directory listing
+ # format can be dependent on the server (with a recent
+ # enough version of libssh2) so this script must also
+ # canonicalize the format. Here are examples of the general
+ # format supported:
+ # -r--r--r-- 12 ausername grp 47 Dec 31 2000 rofile.txt
+ # -r--r--r-- 1 1234 4321 47 Dec 31 2000 rofile.txt
+ # The "canonical" format is similar to the first (which is
+ # the one generated on a typical Linux installation):
+ # -r-?r-?r-? 12 U U 47 Dec 31 2000 rofile.txt
+
+ my @canondir;
+ open(IN, "<$logfile") || die "$!";
+ while (<IN>) {
+ /^(.)(..).(..).(..).\s*(\S+)\s+\S+\s+\S+\s+(\S+)\s+(\S+\s+\S+\s+\S+)(.*)$/;
+ if ($1 eq "d") {
+ # Erase all directory metadata except for the name, as it is not
+ # consistent for across all test systems and filesystems
+ push @canondir, "d????????? N U U N ??? N NN:NN$8\n";
+ } elsif ($1 eq "-") {
+ # Erase user and group names, as they are not consistent across
+ # all test systems
+ my $line = sprintf("%s%s?%s?%s?%5d U U %15d %s%s\n", $1,$2,$3,$4,$5,$6,$7,$8);
+ push @canondir, $line;
+ } else {
+ # Unexpected format; just pass it through and let the test fail
+ push @canondir, $_;
+ }
+ }
+ close(IN);
+
+ @canondir = sort {substr($a,57) cmp substr($b,57)} @canondir;
+ my $newfile = $logfile . ".new";
+ open(OUT, ">$newfile") || die "$!";
+ print OUT join('', @canondir);
+ close(OUT);
+
+ unlink $logfile;
+ rename $newfile, $logfile;
+ }
+
+ exit 0;
+}
+print "Unsupported command $ARGV[0]\n";
+exit 1;
diff --git a/tests/libtest/test75.pl b/tests/libtest/test75.pl
new file mode 100755
index 000000000..31cdfb8cc
--- /dev/null
+++ b/tests/libtest/test75.pl
@@ -0,0 +1,13 @@
+#!/usr/bin/env perl
+# Check that the length of a given URL is correct
+if ( $#ARGV != 1 )
+{
+ print "Usage: $0 string length\n";
+ exit 3;
+}
+if (length(@ARGV[0]) != @ARGV[1])
+{
+ print "Given host IP and port not supported\n";
+ exit 1;
+}
+exit 0;
diff --git a/tests/libtest/testutil.c b/tests/libtest/testutil.c
new file mode 100644
index 000000000..63393c589
--- /dev/null
+++ b/tests/libtest/testutil.c
@@ -0,0 +1,135 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+
+#include "setup.h"
+
+#include "testutil.h"
+#include "memdebug.h"
+
+#if defined(WIN32) && !defined(MSDOS)
+
+struct timeval tutil_tvnow(void)
+{
+ /*
+ ** GetTickCount() is available on _all_ Windows versions from W95 up
+ ** to nowadays. Returns milliseconds elapsed since last system boot,
+ ** increases monotonically and wraps once 49.7 days have elapsed.
+ */
+ struct timeval now;
+ DWORD milliseconds = GetTickCount();
+ now.tv_sec = milliseconds / 1000;
+ now.tv_usec = (milliseconds % 1000) * 1000;
+ return now;
+}
+
+#elif defined(HAVE_CLOCK_GETTIME_MONOTONIC)
+
+struct timeval tutil_tvnow(void)
+{
+ /*
+ ** clock_gettime() is granted to be increased monotonically when the
+ ** monotonic clock is queried. Time starting point is unspecified, it
+ ** could be the system start-up time, the Epoch, or something else,
+ ** in any case the time starting point does not change once that the
+ ** system has started up.
+ */
+ struct timeval now;
+ struct timespec tsnow;
+ if(0 == clock_gettime(CLOCK_MONOTONIC, &tsnow)) {
+ now.tv_sec = tsnow.tv_sec;
+ now.tv_usec = tsnow.tv_nsec / 1000;
+ }
+ /*
+ ** Even when the configure process has truly detected monotonic clock
+ ** availability, it might happen that it is not actually available at
+ ** run-time. When this occurs simply fallback to other time source.
+ */
+#ifdef HAVE_GETTIMEOFDAY
+ else
+ (void)gettimeofday(&now, NULL);
+#else
+ else {
+ now.tv_sec = (long)time(NULL);
+ now.tv_usec = 0;
+ }
+#endif
+ return now;
+}
+
+#elif defined(HAVE_GETTIMEOFDAY)
+
+struct timeval tutil_tvnow(void)
+{
+ /*
+ ** gettimeofday() is not granted to be increased monotonically, due to
+ ** clock drifting and external source time synchronization it can jump
+ ** forward or backward in time.
+ */
+ struct timeval now;
+ (void)gettimeofday(&now, NULL);
+ return now;
+}
+
+#else
+
+struct timeval tutil_tvnow(void)
+{
+ /*
+ ** time() returns the value of time in seconds since the Epoch.
+ */
+ struct timeval now;
+ now.tv_sec = (long)time(NULL);
+ now.tv_usec = 0;
+ return now;
+}
+
+#endif
+
+/*
+ * Make sure that the first argument is the more recent time, as otherwise
+ * we'll get a weird negative time-diff back...
+ *
+ * Returns: the time difference in number of milliseconds.
+ */
+long tutil_tvdiff(struct timeval newer, struct timeval older)
+{
+ return (newer.tv_sec-older.tv_sec)*1000+
+ (newer.tv_usec-older.tv_usec)/1000;
+}
+
+/*
+ * Same as tutil_tvdiff but with full usec resolution.
+ *
+ * Returns: the time difference in seconds with subsecond resolution.
+ */
+double tutil_tvdiff_secs(struct timeval newer, struct timeval older)
+{
+ return (double)(newer.tv_sec-older.tv_sec)+
+ (double)(newer.tv_usec-older.tv_usec)/1000000.0;
+}
+
+/* return the number of seconds in the given input timeval struct */
+long tutil_tvlong(struct timeval t1)
+{
+ return t1.tv_sec;
+}
+
diff --git a/tests/libtest/testutil.h b/tests/libtest/testutil.h
new file mode 100644
index 000000000..6a322e3cb
--- /dev/null
+++ b/tests/libtest/testutil.h
@@ -0,0 +1,49 @@
+#ifndef __LIBTEST_TESTUTIL_H
+#define __LIBTEST_TESTUTIL_H
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+
+#include "setup.h"
+
+
+struct timeval tutil_tvnow(void);
+
+/*
+ * Make sure that the first argument (t1) is the more recent time and t2 is
+ * the older time, as otherwise you get a weird negative time-diff back...
+ *
+ * Returns: the time difference in number of milliseconds.
+ */
+long tutil_tvdiff(struct timeval t1, struct timeval t2);
+
+/*
+ * Same as tutil_tvdiff but with full usec resolution.
+ *
+ * Returns: the time difference in seconds with subsecond resolution.
+ */
+double tutil_tvdiff_secs(struct timeval t1, struct timeval t2);
+
+long tutil_tvlong(struct timeval t1);
+
+
+#endif /* __LIBTEST_TESTUTIL_H */
+
diff --git a/tests/memanalyze.pl b/tests/memanalyze.pl
new file mode 100755
index 000000000..e9f9d2255
--- /dev/null
+++ b/tests/memanalyze.pl
@@ -0,0 +1,356 @@
+#!/usr/bin/env perl
+#
+# Example input:
+#
+# MEM mprintf.c:1094 malloc(32) = e5718
+# MEM mprintf.c:1103 realloc(e5718, 64) = e6118
+# MEM sendf.c:232 free(f6520)
+
+my $mallocs=0;
+my $callocs=0;
+my $reallocs=0;
+my $strdups=0;
+my $showlimit;
+
+while(1) {
+ if($ARGV[0] eq "-v") {
+ $verbose=1;
+ shift @ARGV;
+ }
+ elsif($ARGV[0] eq "-t") {
+ $trace=1;
+ shift @ARGV;
+ }
+ elsif($ARGV[0] eq "-l") {
+ # only show what alloc that caused a memlimit failure
+ $showlimit=1;
+ shift @ARGV;
+ }
+ else {
+ last;
+ }
+}
+
+my $maxmem;
+
+sub newtotal {
+ my ($newtot)=@_;
+ # count a max here
+
+ if($newtot > $maxmem) {
+ $maxmem= $newtot;
+ }
+}
+
+my $file = $ARGV[0];
+
+if(! -f $file) {
+ print "Usage: memanalyze.pl [options] <dump file>\n",
+ "Options:\n",
+ " -l memlimit failure displayed\n",
+ " -v Verbose\n",
+ " -t Trace\n";
+ exit;
+}
+
+open(FILE, "<$file");
+
+if($showlimit) {
+ while(<FILE>) {
+ if(/^LIMIT.*memlimit$/) {
+ print $_;
+ last;
+ }
+ }
+ close(FILE);
+ exit;
+}
+
+
+my $lnum=0;
+while(<FILE>) {
+ chomp $_;
+ $line = $_;
+ $lnum++;
+ if($line =~ /^LIMIT ([^ ]*):(\d*) (.*)/) {
+ # new memory limit test prefix
+ my $i = $3;
+ my ($source, $linenum) = ($1, $2);
+ if($trace && ($i =~ /([^ ]*) reached memlimit/)) {
+ print "LIMIT: $1 returned error at $source:$linenum\n";
+ }
+ }
+ elsif($line =~ /^MEM ([^ ]*):(\d*) (.*)/) {
+ # generic match for the filename+linenumber
+ $source = $1;
+ $linenum = $2;
+ $function = $3;
+
+ if($function =~ /free\(0x([0-9a-f]*)/) {
+ $addr = $1;
+ if(!exists $sizeataddr{$addr}) {
+ print "FREE ERROR: No memory allocated: $line\n";
+ }
+ elsif(-1 == $sizeataddr{$addr}) {
+ print "FREE ERROR: Memory freed twice: $line\n";
+ print "FREE ERROR: Previously freed at: ".$getmem{$addr}."\n";
+ }
+ else {
+ $totalmem -= $sizeataddr{$addr};
+ if($trace) {
+ print "FREE: malloc at ".$getmem{$addr}." is freed again at $source:$linenum\n";
+ printf("FREE: %d bytes freed, left allocated: $totalmem bytes\n", $sizeataddr{$addr});
+ }
+
+ newtotal($totalmem);
+ $frees++;
+
+ $sizeataddr{$addr}=-1; # set -1 to mark as freed
+ $getmem{$addr}="$source:$linenum";
+
+ }
+ }
+ elsif($function =~ /malloc\((\d*)\) = 0x([0-9a-f]*)/) {
+ $size = $1;
+ $addr = $2;
+
+ if($sizeataddr{$addr}>0) {
+ # this means weeeeeirdo
+ print "Mixed debug compile ($source:$linenum at line $lnum), rebuild curl now\n";
+ print "We think $sizeataddr{$addr} bytes are already allocated at that memory address: $addr!\n";
+ }
+
+ $sizeataddr{$addr}=$size;
+ $totalmem += $size;
+
+ if($trace) {
+ print "MALLOC: malloc($size) at $source:$linenum",
+ " makes totally $totalmem bytes\n";
+ }
+
+ newtotal($totalmem);
+ $mallocs++;
+
+ $getmem{$addr}="$source:$linenum";
+ }
+ elsif($function =~ /calloc\((\d*),(\d*)\) = 0x([0-9a-f]*)/) {
+ $size = $1*$2;
+ $addr = $3;
+
+ $arg1 = $1;
+ $arg2 = $2;
+
+ if($sizeataddr{$addr}>0) {
+ # this means weeeeeirdo
+ print "Mixed debug compile, rebuild curl now\n";
+ }
+
+ $sizeataddr{$addr}=$size;
+ $totalmem += $size;
+
+ if($trace) {
+ print "CALLOC: calloc($arg1,$arg2) at $source:$linenum",
+ " makes totally $totalmem bytes\n";
+ }
+
+ newtotal($totalmem);
+ $callocs++;
+
+ $getmem{$addr}="$source:$linenum";
+ }
+ elsif($function =~ /realloc\((\(nil\)|0x([0-9a-f]*)), (\d*)\) = 0x([0-9a-f]*)/) {
+ my ($oldaddr, $newsize, $newaddr) = ($2, $3, $4);
+
+ $totalmem -= $sizeataddr{$oldaddr};
+ if($trace) {
+ printf("REALLOC: %d less bytes and ", $sizeataddr{$oldaddr});
+ }
+ $sizeataddr{$oldaddr}=0;
+
+ $totalmem += $newsize;
+ $sizeataddr{$newaddr}=$newsize;
+
+ if($trace) {
+ printf("%d more bytes ($source:$linenum)\n", $newsize);
+ }
+
+ newtotal($totalmem);
+ $reallocs++;
+
+ $getmem{$oldaddr}="";
+ $getmem{$newaddr}="$source:$linenum";
+ }
+ elsif($function =~ /strdup\(0x([0-9a-f]*)\) \((\d*)\) = 0x([0-9a-f]*)/) {
+ # strdup(a5b50) (8) = df7c0
+
+ $dup = $1;
+ $size = $2;
+ $addr = $3;
+ $getmem{$addr}="$source:$linenum";
+ $sizeataddr{$addr}=$size;
+
+ $totalmem += $size;
+
+ if($trace) {
+ printf("STRDUP: $size bytes at %s, makes totally: %d bytes\n",
+ $getmem{$addr}, $totalmem);
+ }
+
+ newtotal($totalmem);
+ $strdups++;
+ }
+ else {
+ print "Not recognized input line: $function\n";
+ }
+ }
+ # FD url.c:1282 socket() = 5
+ elsif($_ =~ /^FD ([^ ]*):(\d*) (.*)/) {
+ # generic match for the filename+linenumber
+ $source = $1;
+ $linenum = $2;
+ $function = $3;
+
+ if($function =~ /socket\(\) = (\d*)/) {
+ $filedes{$1}=1;
+ $getfile{$1}="$source:$linenum";
+ $openfile++;
+ }
+ elsif($function =~ /accept\(\) = (\d*)/) {
+ $filedes{$1}=1;
+ $getfile{$1}="$source:$linenum";
+ $openfile++;
+ }
+ elsif($function =~ /sclose\((\d*)\)/) {
+ if($filedes{$1} != 1) {
+ print "Close without open: $line\n";
+ }
+ else {
+ $filedes{$1}=0; # closed now
+ $openfile--;
+ }
+ }
+ }
+ # FILE url.c:1282 fopen("blabla") = 0x5ddd
+ elsif($_ =~ /^FILE ([^ ]*):(\d*) (.*)/) {
+ # generic match for the filename+linenumber
+ $source = $1;
+ $linenum = $2;
+ $function = $3;
+
+ if($function =~ /f[d]*open\(\"([^\"]*)\",\"([^\"]*)\"\) = (\(nil\)|0x([0-9a-f]*))/) {
+ if($3 eq "(nil)") {
+ ;
+ }
+ else {
+ $fopen{$4}=1;
+ $fopenfile{$4}="$source:$linenum";
+ $fopens++;
+ }
+ }
+ # fclose(0x1026c8)
+ elsif($function =~ /fclose\(0x([0-9a-f]*)\)/) {
+ if(!$fopen{$1}) {
+ print "fclose() without fopen(): $line\n";
+ }
+ else {
+ $fopen{$1}=0;
+ $fopens--;
+ }
+ }
+ }
+ # GETNAME url.c:1901 getnameinfo()
+ elsif($_ =~ /^GETNAME ([^ ]*):(\d*) (.*)/) {
+ # not much to do
+ }
+
+ # ADDR url.c:1282 getaddrinfo() = 0x5ddd
+ elsif($_ =~ /^ADDR ([^ ]*):(\d*) (.*)/) {
+ # generic match for the filename+linenumber
+ $source = $1;
+ $linenum = $2;
+ $function = $3;
+
+ if($function =~ /getaddrinfo\(\) = (\(nil\)|0x([0-9a-f]*))/) {
+ my $add = $2;
+ if($add eq "(nil)") {
+ ;
+ }
+ else {
+ $addrinfo{$add}=1;
+ $addrinfofile{$add}="$source:$linenum";
+ $addrinfos++;
+ }
+ if($trace) {
+ printf("GETADDRINFO ($source:$linenum)\n");
+ }
+ }
+ # fclose(0x1026c8)
+ elsif($function =~ /freeaddrinfo\(0x([0-9a-f]*)\)/) {
+ if(!$addrinfo{$1}) {
+ print "freeaddrinfo() without getaddrinfo(): $line\n";
+ }
+ else {
+ $addrinfo{$1}=0;
+ $addrinfos--;
+ }
+ if($trace) {
+ printf("FREEADDRINFO ($source:$linenum)\n");
+ }
+ }
+
+ }
+ else {
+ print "Not recognized prefix line: $line\n";
+ }
+}
+close(FILE);
+
+if($totalmem) {
+ print "Leak detected: memory still allocated: $totalmem bytes\n";
+
+ for(keys %sizeataddr) {
+ $addr = $_;
+ $size = $sizeataddr{$addr};
+ if($size > 0) {
+ print "At $addr, there's $size bytes.\n";
+ print " allocated by ".$getmem{$addr}."\n";
+ }
+ }
+}
+
+if($openfile) {
+ for(keys %filedes) {
+ if($filedes{$_} == 1) {
+ print "Open file descriptor created at ".$getfile{$_}."\n";
+ }
+ }
+}
+
+if($fopens) {
+ print "Open FILE handles left at:\n";
+ for(keys %fopen) {
+ if($fopen{$_} == 1) {
+ print "fopen() called at ".$fopenfile{$_}."\n";
+ }
+ }
+}
+
+if($addrinfos) {
+ print "IPv6-style name resolve data left at:\n";
+ for(keys %addrinfofile) {
+ if($addrinfo{$_} == 1) {
+ print "getaddrinfo() called at ".$addrinfofile{$_}."\n";
+ }
+ }
+}
+
+if($verbose) {
+ print "Mallocs: $mallocs\n",
+ "Reallocs: $reallocs\n",
+ "Callocs: $callocs\n",
+ "Strdups: $strdups\n",
+ "Frees: $frees\n",
+ "Allocations: ".($mallocs + $callocs + $reallocs + $strdups)."\n";
+
+ print "Maximum allocated: $maxmem\n";
+}
diff --git a/tests/rtspserver.pl b/tests/rtspserver.pl
new file mode 100755
index 000000000..515128d7b
--- /dev/null
+++ b/tests/rtspserver.pl
@@ -0,0 +1,108 @@
+#!/usr/bin/env perl
+#***************************************************************************
+# _ _ ____ _
+# Project ___| | | | _ \| |
+# / __| | | | |_) | |
+# | (__| |_| | _ <| |___
+# \___|\___/|_| \_\_____|
+#
+# Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+#
+# This software is licensed as described in the file COPYING, which
+# you should have received as part of this distribution. The terms
+# are also available at http://curl.haxx.se/docs/copyright.html.
+#
+# You may opt to use, copy, modify, merge, publish, distribute and/or sell
+# copies of the Software, and permit persons to whom the Software is
+# furnished to do so, under the terms of the COPYING file.
+#
+# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+# KIND, either express or implied.
+#
+#***************************************************************************
+
+BEGIN {
+ @INC=(@INC, $ENV{'srcdir'}, '.');
+}
+
+use strict;
+use warnings;
+
+use serverhelp qw(
+ server_pidfilename
+ server_logfilename
+ );
+
+my $verbose = 0; # set to 1 for debugging
+my $port = 8990; # just a default
+my $ipvnum = 4; # default IP version of rtsp server
+my $idnum = 1; # dafault rtsp server instance number
+my $proto = 'rtsp'; # protocol the rtsp server speaks
+my $pidfile; # rtsp server pid file
+my $logfile; # rtsp server log file
+my $srcdir;
+
+my $flags = "";
+my $path = '.';
+my $logdir = $path .'/log';
+
+while(@ARGV) {
+ if($ARGV[0] eq '--pidfile') {
+ if($ARGV[1]) {
+ $pidfile = $ARGV[1];
+ shift @ARGV;
+ }
+ }
+ elsif($ARGV[0] eq '--logfile') {
+ if($ARGV[1]) {
+ $logfile = $ARGV[1];
+ shift @ARGV;
+ }
+ }
+ elsif($ARGV[0] eq '--srcdir') {
+ if($ARGV[1]) {
+ $srcdir = $ARGV[1];
+ shift @ARGV;
+ }
+ }
+ elsif($ARGV[0] eq '--ipv4') {
+ $ipvnum = 4;
+ }
+ elsif($ARGV[0] eq '--ipv6') {
+ $ipvnum = 6;
+ }
+ elsif($ARGV[0] eq '--port') {
+ if($ARGV[1] =~ /^(\d+)$/) {
+ $port = $1;
+ shift @ARGV;
+ }
+ }
+ elsif($ARGV[0] eq '--id') {
+ if($ARGV[1] =~ /^(\d+)$/) {
+ $idnum = $1 if($1 > 0);
+ shift @ARGV;
+ }
+ }
+ elsif($ARGV[0] eq '--verbose') {
+ $verbose = 1;
+ }
+ else {
+ print STDERR "\nWarning: rtspserver.pl unknown parameter: $ARGV[0]\n";
+ }
+ shift @ARGV;
+}
+
+if(!$srcdir) {
+ $srcdir = $ENV{'srcdir'} || '.';
+}
+if(!$pidfile) {
+ $pidfile = "$path/". server_pidfilename($proto, $ipvnum, $idnum);
+}
+if(!$logfile) {
+ $logfile = server_logfilename($logdir, $proto, $ipvnum, $idnum);
+}
+
+$flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
+$flags .= "--ipv$ipvnum --port $port --srcdir \"$srcdir\"";
+
+exec("server/rtspd $flags");
diff --git a/tests/runtests.1 b/tests/runtests.1
new file mode 100644
index 000000000..45f878333
--- /dev/null
+++ b/tests/runtests.1
@@ -0,0 +1,107 @@
+.\" **************************************************************************
+.\" * _ _ ____ _
+.\" * Project ___| | | | _ \| |
+.\" * / __| | | | |_) | |
+.\" * | (__| |_| | _ <| |___
+.\" * \___|\___/|_| \_\_____|
+.\" *
+.\" * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" *
+.\" * This software is licensed as described in the file COPYING, which
+.\" * you should have received as part of this distribution. The terms
+.\" * are also available at http://curl.haxx.se/docs/copyright.html.
+.\" *
+.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+.\" * copies of the Software, and permit persons to whom the Software is
+.\" * furnished to do so, under the terms of the COPYING file.
+.\" *
+.\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+.\" * KIND, either express or implied.
+.\" *
+.\" **************************************************************************
+.\"
+.TH runtests.pl 1 "2 Feb 2010" "Curl 7.20.0" "runtests"
+.SH NAME
+runtests.pl \- run one or more test cases
+.SH SYNOPSIS
+.B runtests.pl [options] [test number] [!test number] [key word] [!key word]
+.SH DESCRIPTION
+\fIruntests.pl\fP runs one, several or all the existing test cases in curl's
+test suite. It is often called from the root Makefile of the curl package with
+\&'make test'.
+.SH "TEST NUMBER"
+If no test case number is given, all existing tests that the script can find
+will be considered for running. You can specify single test cases to run,
+space-separated, like "1 3 5 7 11", and you can specify a range like "45 to
+67". You can also specify only the tests you don't want to run by listing
+the numbers with a leading exclamation point, like "!66".
+.P
+It is also possible to specify tests to skip based on a key word describing
+the test. These are specified with a leading exclamation point and the
+key word or phrase, like "!HTTP NTLM auth". Likewise, tests to run can
+be specified simply by specifying the unadorned key words, like "FTPS".
+Remember that the exclamation marks and spaces will need to be quoted somehow
+when entered at many command shells.
+.SH OPTIONS
+.IP "-a"
+Continue running the rest of the test cases even if one test fails. By
+default, the test script stops as soon as an error is detected.
+.IP "-bN"
+Use N as the base TCP/UDP port number on which to start the test servers.
+.IP "-c <curl>"
+Provide a custom curl binary to run the tests with. Default is the curl
+executable in the build tree.
+.IP "-d"
+Enable protocol debug: have the servers display protocol output.
+.IP "-g"
+Run the given test(s) with gdb. This is best used on a single test case and
+curl built --disable-shared. This then fires up gdb with command line set to
+run the specified test case. Simply (set a break-point and) type 'run' to
+start.
+.IP "-h"
+Displays a help text about this program's command line options.
+.IP "-k"
+Keep output and log files in log/ after a test run, even if no error was
+detected. Useful for debugging.
+.IP "-l"
+Lists all test case names.
+.IP "-n"
+Disable the check for and use of valgrind.
+.IP "-p"
+Prints out all files in "log/" to stdout when a test case fails. Very
+practical when used in the automated and distributed tests since then the
+people checking the failures and the reasons for them might not have physical
+access to the machine and logs.
+.IP "-r"
+Display run time statistics. (Requires Perl Time::HiRes module)
+.IP "-rf"
+Display full run time statistics. (Requires Perl Time::HiRes module)
+.IP "-s"
+Shorter output. Speaks less than default.
+.IP "-t[num]"
+Selects a \fBtorture\fP test for the given tests. This makes runtests.pl first
+run the tests once and count the number of memory allocations made. It then
+reruns the test that number of times, each time forcing one of the allocations
+to fail until all allocs have been tested. By setting \fInum\fP you can force
+the allocation with that number to be set to fail at once instead of looping
+through everyone, which is very handy when debugging and then often in
+combination with \fI-g\fP.
+.IP "-v"
+Enable verbose output. Speaks more than default.
+.SH "RUNNING TESTS"
+Many tests have conditions that must be met before the test case can run
+fine. They could depend on built-in features in libcurl or features present in
+the operating system or even in third-party libraries that curl may or may not
+use.
+.P
+The test script checks most of these by itself to determine when it is
+safe to attempt to run each test. Those which cannot be run due to
+failed requirements will simply be skipped and listed at the completion
+of all test cases. In some unusual configurations, the test script
+cannot make the correct determination for all tests. In these cases,
+the problematic tests can be skipped using the "!keyword" skip feature
+documented earlier.
+.SH "WRITING TESTS"
+The simplest way to write test cases is to start with a similar existing test,
+save it with a new number and then adjust it to fit. There's an attempt to
+document the test case file format in the tests/FILEFORMAT.
diff --git a/tests/runtests.html b/tests/runtests.html
new file mode 100644
index 000000000..e308cdb54
--- /dev/null
+++ b/tests/runtests.html
@@ -0,0 +1,87 @@
+<html><head>
+<title>runtests.pl man page</title>
+<meta name="generator" content="roffit 0.7">
+<STYLE type="text/css">
+P.level0 {
+ padding-left: 2em;
+}
+
+P.level1 {
+ padding-left: 4em;
+}
+
+P.level2 {
+ padding-left: 6em;
+}
+
+span.emphasis {
+ font-style: italic;
+}
+
+span.bold {
+ font-weight: bold;
+}
+
+span.manpage {
+ font-weight: bold;
+}
+
+h2.nroffsh {
+ background-color: #e0e0e0;
+}
+
+span.nroffip {
+ font-weight: bold;
+ font-size: 120%;
+ font-family: monospace;
+}
+
+p.roffit {
+ text-align: center;
+ font-size: 80%;
+}
+</STYLE>
+</head><body>
+
+<p class="level0"><a name="NAME"></a><h2 class="nroffsh">NAME</h2>
+<p class="level0">runtests.pl - run one or more test cases <a name="SYNOPSIS"></a><h2 class="nroffsh">SYNOPSIS</h2>
+<p class="level0"><span Class="bold">runtests.pl [options] [test number] [!test number] [key word] [!key word]</span> <a name="DESCRIPTION"></a><h2 class="nroffsh">DESCRIPTION</h2>
+<p class="level0"><span Class="emphasis">runtests.pl</span> runs one, several or all the existing test cases in curl's test suite. It is often called from the root Makefile of the curl package with 'make test'. <a name="TEST"></a><h2 class="nroffsh">TEST NUMBER</h2>
+<p class="level0">If no test case number is given, all existing tests that the script can find will be considered for running. You can specify single test cases to run, space-separated, like "1 3 5 7 11", and you can specify a range like "45 to 67". You can also specify only the tests you don't want to run by listing the numbers with a leading exclamation point, like "!66".
+<p class="level0">It is also possible to specify tests to skip based on a key word describing the test. These are specified with a leading exclamation point and the key word or phrase, like "!HTTP NTLM auth". Likewise, tests to run can be specified simply by specifying the unadorned key words, like "FTPS". Remember that the exclamation marks and spaces will need to be quoted somehow when entered at many command shells. <a name="OPTIONS"></a><h2 class="nroffsh">OPTIONS</h2>
+<p class="level0">
+<p class="level0"><a name="-a"></a><span class="nroffip">-a</span>
+<p class="level1">Continue running the rest of the test cases even if one test fails. By default, the test script stops as soon as an error is detected.
+<p class="level0"><a name="-bN"></a><span class="nroffip">-bN</span>
+<p class="level1">Use N as the base TCP/UDP port number on which to start the test servers.
+<p class="level0"><a name="-c"></a><span class="nroffip">-c &lt;curl&gt;</span>
+<p class="level1">Provide a custom curl binary to run the tests with. Default is the curl executable in the build tree.
+<p class="level0"><a name="-d"></a><span class="nroffip">-d</span>
+<p class="level1">Enable protocol debug: have the servers display protocol output.
+<p class="level0"><a name="-g"></a><span class="nroffip">-g</span>
+<p class="level1">Run the given test(s) with gdb. This is best used on a single test case and curl built --disable-shared. This then fires up gdb with command line set to run the specified test case. Simply (set a break-point and) type 'run' to start.
+<p class="level0"><a name="-h"></a><span class="nroffip">-h</span>
+<p class="level1">Displays a help text about this program's command line options.
+<p class="level0"><a name="-k"></a><span class="nroffip">-k</span>
+<p class="level1">Keep output and log files in log/ after a test run, even if no error was detected. Useful for debugging.
+<p class="level0"><a name="-l"></a><span class="nroffip">-l</span>
+<p class="level1">Lists all test case names.
+<p class="level0"><a name="-n"></a><span class="nroffip">-n</span>
+<p class="level1">Disable the check for and use of valgrind.
+<p class="level0"><a name="-p"></a><span class="nroffip">-p</span>
+<p class="level1">Prints out all files in "log/" to stdout when a test case fails. Very practical when used in the automated and distributed tests since then the people checking the failures and the reasons for them might not have physical access to the machine and logs.
+<p class="level0"><a name="-r"></a><span class="nroffip">-r</span>
+<p class="level1">Display run time statistics. (Requires Perl Time::HiRes module)
+<p class="level0"><a name="-rf"></a><span class="nroffip">-rf</span>
+<p class="level1">Display full run time statistics. (Requires Perl Time::HiRes module)
+<p class="level0"><a name="-s"></a><span class="nroffip">-s</span>
+<p class="level1">Shorter output. Speaks less than default.
+<p class="level0"><a name="-tnum"></a><span class="nroffip">-t[num]</span>
+<p class="level1">Selects a <span Class="bold">torture</span> test for the given tests. This makes runtests.pl first run the tests once and count the number of memory allocations made. It then reruns the test that number of times, each time forcing one of the allocations to fail until all allocs have been tested. By setting <span Class="emphasis">num</span> you can force the allocation with that number to be set to fail at once instead of looping through everyone, which is very handy when debugging and then often in combination with <a class="emphasis" href="#-g">-g</a>.
+<p class="level0"><a name="-v"></a><span class="nroffip">-v</span>
+<p class="level1">Enable verbose output. Speaks more than default. <a name="RUNNING"></a><h2 class="nroffsh">RUNNING TESTS</h2>
+<p class="level0">Many tests have conditions that must be met before the test case can run fine. They could depend on built-in features in libcurl or features present in the operating system or even in third-party libraries that curl may or may not use.
+<p class="level0">The test script checks most of these by itself to determine when it is safe to attempt to run each test. Those which cannot be run due to failed requirements will simply be skipped and listed at the completion of all test cases. In some unusual configurations, the test script cannot make the correct determination for all tests. In these cases, the problematic tests can be skipped using the "!keyword" skip feature documented earlier. <a name="WRITING"></a><h2 class="nroffsh">WRITING TESTS</h2>
+<p class="level0">The simplest way to write test cases is to start with a similar existing test, save it with a new number and then adjust it to fit. There's an attempt to document the test case file format in the tests/FILEFORMAT. <p class="roffit">
+ This HTML page was made with <a href="http://daniel.haxx.se/projects/roffit/">roffit</a>.
+</body></html>
diff --git a/tests/runtests.pdf b/tests/runtests.pdf
new file mode 100644
index 000000000..a8a79e70e
--- /dev/null
+++ b/tests/runtests.pdf
Binary files differ
diff --git a/tests/runtests.pl b/tests/runtests.pl
new file mode 100755
index 000000000..138c3835a
--- /dev/null
+++ b/tests/runtests.pl
@@ -0,0 +1,4138 @@
+#!/usr/bin/env perl
+#***************************************************************************
+# _ _ ____ _
+# Project ___| | | | _ \| |
+# / __| | | | |_) | |
+# | (__| |_| | _ <| |___
+# \___|\___/|_| \_\_____|
+#
+# Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+#
+# This software is licensed as described in the file COPYING, which
+# you should have received as part of this distribution. The terms
+# are also available at http://curl.haxx.se/docs/copyright.html.
+#
+# You may opt to use, copy, modify, merge, publish, distribute and/or sell
+# copies of the Software, and permit persons to whom the Software is
+# furnished to do so, under the terms of the COPYING file.
+#
+# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+# KIND, either express or implied.
+#
+###########################################################################
+
+# Experimental hooks are available to run tests remotely on machines that
+# are able to run curl but are unable to run the test harness.
+# The following sections need to be modified:
+#
+# $HOSTIP, $HOST6IP - Set to the address of the host running the test suite
+# $CLIENTIP, $CLIENT6IP - Set to the address of the host running curl
+# runclient, runclientoutput - Modify to copy all the files in the log/
+# directory to the system running curl, run the given command remotely
+# and save the return code or returned stdout (respectively), then
+# copy all the files from the remote system's log/ directory back to
+# the host running the test suite. This can be done a few ways, such
+# as using scp & ssh, rsync & telnet, or using a NFS shared directory
+# and ssh.
+#
+# 'make && make test' needs to be done on both machines before making the
+# above changes and running runtests.pl manually. In the shared NFS case,
+# the contents of the tests/server/ directory must be from the host
+# running the test suite, while the rest must be from the host running curl.
+#
+# Note that even with these changes a number of tests will still fail (mainly
+# to do with cookies, those that set environment variables, or those that
+# do more than touch the file system in a <precheck> or <postcheck>
+# section). These can be added to the $TESTCASES line below,
+# e.g. $TESTCASES="!8 !31 !63 !cookies..."
+#
+# Finally, to properly support -g and -n, checktestcmd needs to change
+# to check the remote system's PATH, and the places in the code where
+# the curl binary is read directly to determine its type also need to be
+# fixed. As long as the -g option is never given, and the -n is always
+# given, this won't be a problem.
+
+
+# These should be the only variables that might be needed to get edited:
+
+BEGIN {
+ @INC=(@INC, $ENV{'srcdir'}, ".");
+ # run time statistics needs Time::HiRes
+ eval {
+ no warnings "all";
+ require Time::HiRes;
+ import Time::HiRes qw( time );
+ }
+}
+
+use strict;
+use warnings;
+use Cwd;
+
+# Subs imported from serverhelp module
+use serverhelp qw(
+ serverfactors
+ servername_id
+ servername_str
+ servername_canon
+ server_pidfilename
+ server_logfilename
+ );
+
+# Variables and subs imported from sshhelp module
+use sshhelp qw(
+ $sshdexe
+ $sshexe
+ $sftpexe
+ $sshconfig
+ $sftpconfig
+ $sshdlog
+ $sshlog
+ $sftplog
+ $sftpcmds
+ display_sshdconfig
+ display_sshconfig
+ display_sftpconfig
+ display_sshdlog
+ display_sshlog
+ display_sftplog
+ exe_ext
+ find_sshd
+ find_ssh
+ find_sftp
+ sshversioninfo
+ );
+
+require "getpart.pm"; # array functions
+require "valgrind.pm"; # valgrind report parser
+require "ftp.pm";
+
+my $HOSTIP="127.0.0.1"; # address on which the test server listens
+my $HOST6IP="[::1]"; # address on which the test server listens
+my $CLIENTIP="127.0.0.1"; # address which curl uses for incoming connections
+my $CLIENT6IP="[::1]"; # address which curl uses for incoming connections
+
+my $base = 8990; # base port number
+
+my $HTTPPORT; # HTTP server port
+my $HTTP6PORT; # HTTP IPv6 server port
+my $HTTPSPORT; # HTTPS server port
+my $FTPPORT; # FTP server port
+my $FTP2PORT; # FTP server 2 port
+my $FTPSPORT; # FTPS server port
+my $FTP6PORT; # FTP IPv6 server port
+my $TFTPPORT; # TFTP
+my $TFTP6PORT; # TFTP
+my $SSHPORT; # SCP/SFTP
+my $SOCKSPORT; # SOCKS4/5 port
+my $POP3PORT; # POP3
+my $POP36PORT; # POP3 IPv6 server port
+my $IMAPPORT; # IMAP
+my $IMAP6PORT; # IMAP IPv6 server port
+my $SMTPPORT; # SMTP
+my $SMTP6PORT; # SMTP IPv6 server port
+my $RTSPPORT; # RTSP
+my $RTSP6PORT; # RTSP IPv6 server port
+my $GOPHERPORT; # Gopher
+my $GOPHER6PORT; # Gopher IPv6 server port
+
+my $srcdir = $ENV{'srcdir'} || '.';
+my $CURL="../src/curl".exe_ext(); # what curl executable to run on the tests
+my $VCURL=$CURL; # what curl binary to use to verify the servers with
+ # VCURL is handy to set to the system one when the one you
+ # just built hangs or crashes and thus prevent verification
+my $DBGCURL=$CURL; #"../src/.libs/curl"; # alternative for debugging
+my $LOGDIR="log";
+my $TESTDIR="$srcdir/data";
+my $LIBDIR="./libtest";
+my $SERVERIN="$LOGDIR/server.input"; # what curl sent the server
+my $SERVER2IN="$LOGDIR/server2.input"; # what curl sent the second server
+my $CURLLOG="$LOGDIR/curl.log"; # all command lines run
+my $FTPDCMD="$LOGDIR/ftpserver.cmd"; # copy ftp server instructions here
+my $SERVERLOGS_LOCK="$LOGDIR/serverlogs.lock"; # server logs advisor read lock
+my $CURLCONFIG="../curl-config"; # curl-config from current build
+
+# Normally, all test cases should be run, but at times it is handy to
+# simply run a particular one:
+my $TESTCASES="all";
+
+# To run specific test cases, set them like:
+# $TESTCASES="1 2 3 7 8";
+
+#######################################################################
+# No variables below this point should need to be modified
+#
+
+# invoke perl like this:
+my $perl="perl -I$srcdir";
+my $server_response_maxtime=13;
+
+my $debug_build=0; # curl built with --enable-debug
+my $curl_debug=0; # curl built with --enable-curldebug (memory tracking)
+my $libtool;
+
+# name of the file that the memory debugging creates:
+my $memdump="$LOGDIR/memdump";
+
+# the path to the script that analyzes the memory debug output file:
+my $memanalyze="$perl $srcdir/memanalyze.pl";
+
+my $pwd = getcwd(); # current working directory
+
+my $start;
+my $forkserver=0;
+my $ftpchecktime=1; # time it took to verify our test FTP server
+
+my $stunnel = checkcmd("stunnel4") || checkcmd("stunnel");
+my $valgrind = checktestcmd("valgrind");
+my $valgrind_logfile="--logfile";
+my $valgrind_tool;
+my $gdb = checktestcmd("gdb");
+
+my $ssl_version; # set if libcurl is built with SSL support
+my $large_file; # set if libcurl is built with large file support
+my $has_idn; # set if libcurl is built with IDN support
+my $http_ipv6; # set if HTTP server has IPv6 support
+my $ftp_ipv6; # set if FTP server has IPv6 support
+my $tftp_ipv6; # set if TFTP server has IPv6 support
+my $gopher_ipv6; # set if Gopher server has IPv6 support
+my $has_ipv6; # set if libcurl is built with IPv6 support
+my $has_libz; # set if libcurl is built with libz support
+my $has_getrlimit; # set if system has getrlimit()
+my $has_ntlm; # set if libcurl is built with NTLM support
+my $has_charconv;# set if libcurl is built with CharConv support
+
+my $has_openssl; # built with a lib using an OpenSSL-like API
+my $has_gnutls; # built with GnuTLS
+my $has_nss; # built with NSS
+my $has_yassl; # built with yassl
+my $has_polarssl;# built with polarssl
+
+my $has_shared; # built shared
+
+my $ssllib; # name of the lib we use (for human presentation)
+my $has_crypto; # set if libcurl is built with cryptographic support
+my $has_textaware; # set if running on a system that has a text mode concept
+ # on files. Windows for example
+my @protocols; # array of supported protocols
+
+my $skipped=0; # number of tests skipped; reported in main loop
+my %skipped; # skipped{reason}=counter, reasons for skip
+my @teststat; # teststat[testnum]=reason, reasons for skip
+my %disabled_keywords; # key words of tests to skip
+my %enabled_keywords; # key words of tests to run
+
+my $sshdid; # for socks server, ssh daemon version id
+my $sshdvernum; # for socks server, ssh daemon version number
+my $sshdverstr; # for socks server, ssh daemon version string
+my $sshderror; # for socks server, ssh daemon version error
+
+my $defserverlogslocktimeout = 20; # timeout to await server logs lock removal
+my $defpostcommanddelay = 0; # delay between command and postcheck sections
+
+my $timestats; # time stamping and stats generation
+my $fullstats; # show time stats for every single test
+my %timeprepini; # timestamp for each test preparation start
+my %timesrvrini; # timestamp for each test required servers verification start
+my %timesrvrend; # timestamp for each test required servers verification end
+my %timetoolini; # timestamp for each test command run starting
+my %timetoolend; # timestamp for each test command run stopping
+my %timesrvrlog; # timestamp for each test server logs lock removal
+my %timevrfyend; # timestamp for each test result verification end
+
+my $testnumcheck; # test number, set in singletest sub.
+my %oldenv;
+
+#######################################################################
+# variables the command line options may set
+#
+
+my $short;
+my $verbose;
+my $debugprotocol;
+my $anyway;
+my $gdbthis; # run test case with gdb debugger
+my $keepoutfiles; # keep stdout and stderr files after tests
+my $listonly; # only list the tests
+my $postmortem; # display detailed info about failed tests
+
+my %run; # running server
+my %doesntrun; # servers that don't work, identified by pidfile
+my %serverpidfile;# all server pid file names, identified by server id
+my %runcert; # cert file currently in use by an ssl running server
+
+# torture test variables
+my $torture;
+my $tortnum;
+my $tortalloc;
+
+#######################################################################
+# logmsg is our general message logging subroutine.
+#
+sub logmsg {
+ for(@_) {
+ print "$_";
+ }
+}
+
+# get the name of the current user
+my $USER = $ENV{USER}; # Linux
+if (!$USER) {
+ $USER = $ENV{USERNAME}; # Windows
+ if (!$USER) {
+ $USER = $ENV{LOGNAME}; # Some UNIX (I think)
+ }
+}
+
+# enable memory debugging if curl is compiled with it
+$ENV{'CURL_MEMDEBUG'} = $memdump;
+$ENV{'HOME'}=$pwd;
+
+sub catch_zap {
+ my $signame = shift;
+ logmsg "runtests.pl received SIG$signame, exiting\n";
+ stopservers($verbose);
+ die "Somebody sent me a SIG$signame";
+}
+$SIG{INT} = \&catch_zap;
+$SIG{TERM} = \&catch_zap;
+
+##########################################################################
+# Clear all possible '*_proxy' environment variables for various protocols
+# to prevent them to interfere with our testing!
+
+my $protocol;
+foreach $protocol (('ftp', 'http', 'ftps', 'https', 'no')) {
+ my $proxy = "${protocol}_proxy";
+ # clear lowercase version
+ delete $ENV{$proxy} if($ENV{$proxy});
+ # clear uppercase version
+ delete $ENV{uc($proxy)} if($ENV{uc($proxy)});
+}
+
+# make sure we don't get affected by other variables that control our
+# behaviour
+
+delete $ENV{'SSL_CERT_DIR'} if($ENV{'SSL_CERT_DIR'});
+delete $ENV{'SSL_CERT_PATH'} if($ENV{'SSL_CERT_PATH'});
+delete $ENV{'CURL_CA_BUNDLE'} if($ENV{'CURL_CA_BUNDLE'});
+
+#######################################################################
+# Load serverpidfile hash with pidfile names for all possible servers.
+#
+sub init_serverpidfile_hash {
+ for my $proto (('ftp', 'http', 'imap', 'pop3', 'smtp')) {
+ for my $ssl (('', 's')) {
+ for my $ipvnum ((4, 6)) {
+ for my $idnum ((1, 2)) {
+ my $serv = servername_id("$proto$ssl", $ipvnum, $idnum);
+ my $pidf = server_pidfilename("$proto$ssl", $ipvnum, $idnum);
+ $serverpidfile{$serv} = $pidf;
+ }
+ }
+ }
+ }
+ for my $proto (('tftp', 'sftp', 'socks', 'ssh', 'rtsp', 'gopher')) {
+ for my $ipvnum ((4, 6)) {
+ for my $idnum ((1, 2)) {
+ my $serv = servername_id($proto, $ipvnum, $idnum);
+ my $pidf = server_pidfilename($proto, $ipvnum, $idnum);
+ $serverpidfile{$serv} = $pidf;
+ }
+ }
+ }
+}
+
+#######################################################################
+# Check if a given child process has just died. Reaps it if so.
+#
+sub checkdied {
+ use POSIX ":sys_wait_h";
+ my $pid = $_[0];
+ if(not defined $pid || $pid <= 0) {
+ return 0;
+ }
+ my $rc = waitpid($pid, &WNOHANG);
+ return ($rc == $pid)?1:0;
+}
+
+#######################################################################
+# Start a new thread/process and run the given command line in there.
+# Return the pids (yes plural) of the new child process to the parent.
+#
+sub startnew {
+ my ($cmd, $pidfile, $timeout, $fake)=@_;
+
+ logmsg "startnew: $cmd\n" if ($verbose);
+
+ my $child = fork();
+ my $pid2 = 0;
+
+ if(not defined $child) {
+ logmsg "startnew: fork() failure detected\n";
+ return (-1,-1);
+ }
+
+ if(0 == $child) {
+ # Here we are the child. Run the given command.
+
+ # Put an "exec" in front of the command so that the child process
+ # keeps this child's process ID.
+ exec("exec $cmd") || die "Can't exec() $cmd: $!";
+
+ # exec() should never return back here to this process. We protect
+ # ourselves by calling die() just in case something goes really bad.
+ die "error: exec() has returned";
+ }
+
+ # Ugly hack but ssh client doesn't support pid files
+ if ($fake) {
+ if(open(OUT, ">$pidfile")) {
+ print OUT $child . "\n";
+ close(OUT);
+ logmsg "startnew: $pidfile faked with pid=$child\n" if($verbose);
+ }
+ else {
+ logmsg "startnew: failed to write fake $pidfile with pid=$child\n";
+ }
+ # could/should do a while connect fails sleep a bit and loop
+ sleep $timeout;
+ if (checkdied($child)) {
+ logmsg "startnew: child process has failed to start\n" if($verbose);
+ return (-1,-1);
+ }
+ }
+
+ my $count = $timeout;
+ while($count--) {
+ if(-f $pidfile && -s $pidfile && open(PID, "<$pidfile")) {
+ $pid2 = 0 + <PID>;
+ close(PID);
+ if(($pid2 > 0) && kill(0, $pid2)) {
+ # if $pid2 is valid, then make sure this pid is alive, as
+ # otherwise it is just likely to be the _previous_ pidfile or
+ # similar!
+ last;
+ }
+ # invalidate $pid2 if not actually alive
+ $pid2 = 0;
+ }
+ if (checkdied($child)) {
+ logmsg "startnew: child process has died, server might start up\n"
+ if($verbose);
+ # We can't just abort waiting for the server with a
+ # return (-1,-1);
+ # because the server might have forked and could still start
+ # up normally. Instead, just reduce the amount of time we remain
+ # waiting.
+ $count >>= 2;
+ }
+ sleep(1);
+ }
+
+ # Return two PIDs, the one for the child process we spawned and the one
+ # reported by the server itself (in case it forked again on its own).
+ # Both (potentially) need to be killed at the end of the test.
+ return ($child, $pid2);
+}
+
+
+#######################################################################
+# Check for a command in the PATH of the test server.
+#
+sub checkcmd {
+ my ($cmd)=@_;
+ my @paths=(split(":", $ENV{'PATH'}), "/usr/sbin", "/usr/local/sbin",
+ "/sbin", "/usr/bin", "/usr/local/bin",
+ "./libtest/.libs", "./libtest");
+ for(@paths) {
+ if( -x "$_/$cmd" && ! -d "$_/$cmd") {
+ # executable bit but not a directory!
+ return "$_/$cmd";
+ }
+ }
+}
+
+#######################################################################
+# Get the list of tests that the tests/data/Makefile.am knows about!
+#
+my $disttests;
+sub get_disttests {
+ my @dist = `cd data && make show`;
+ $disttests = join("", @dist);
+}
+
+#######################################################################
+# Check for a command in the PATH of the machine running curl.
+#
+sub checktestcmd {
+ my ($cmd)=@_;
+ return checkcmd($cmd);
+}
+
+#######################################################################
+# Run the application under test and return its return code
+#
+sub runclient {
+ my ($cmd)=@_;
+ return system($cmd);
+
+# This is one way to test curl on a remote machine
+# my $out = system("ssh $CLIENTIP cd \'$pwd\' \\; \'$cmd\'");
+# sleep 2; # time to allow the NFS server to be updated
+# return $out;
+}
+
+#######################################################################
+# Run the application under test and return its stdout
+#
+sub runclientoutput {
+ my ($cmd)=@_;
+ return `$cmd`;
+
+# This is one way to test curl on a remote machine
+# my @out = `ssh $CLIENTIP cd \'$pwd\' \\; \'$cmd\'`;
+# sleep 2; # time to allow the NFS server to be updated
+# return @out;
+ }
+
+#######################################################################
+# Memory allocation test and failure torture testing.
+#
+sub torture {
+ my $testcmd = shift;
+ my $gdbline = shift;
+
+ # remove memdump first to be sure we get a new nice and clean one
+ unlink($memdump);
+
+ # First get URL from test server, ignore the output/result
+ runclient($testcmd);
+
+ logmsg " CMD: $testcmd\n" if($verbose);
+
+ # memanalyze -v is our friend, get the number of allocations made
+ my $count=0;
+ my @out = `$memanalyze -v $memdump`;
+ for(@out) {
+ if(/^Allocations: (\d+)/) {
+ $count = $1;
+ last;
+ }
+ }
+ if(!$count) {
+ logmsg " found no allocs to make fail\n";
+ return 0;
+ }
+
+ logmsg " $count allocations to make fail\n";
+
+ for ( 1 .. $count ) {
+ my $limit = $_;
+ my $fail;
+ my $dumped_core;
+
+ if($tortalloc && ($tortalloc != $limit)) {
+ next;
+ }
+
+ if($verbose) {
+ my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
+ localtime(time());
+ my $now = sprintf("%02d:%02d:%02d ", $hour, $min, $sec);
+ logmsg "Fail alloc no: $limit at $now\r";
+ }
+
+ # make the memory allocation function number $limit return failure
+ $ENV{'CURL_MEMLIMIT'} = $limit;
+
+ # remove memdump first to be sure we get a new nice and clean one
+ unlink($memdump);
+
+ logmsg "*** Alloc number $limit is now set to fail ***\n" if($gdbthis);
+
+ my $ret = 0;
+ if($gdbthis) {
+ runclient($gdbline)
+ }
+ else {
+ $ret = runclient($testcmd);
+ }
+ #logmsg "$_ Returned " . $ret >> 8 . "\n";
+
+ # Now clear the variable again
+ delete $ENV{'CURL_MEMLIMIT'} if($ENV{'CURL_MEMLIMIT'});
+
+ if(-r "core") {
+ # there's core file present now!
+ logmsg " core dumped\n";
+ $dumped_core = 1;
+ $fail = 2;
+ }
+
+ # verify that it returns a proper error code, doesn't leak memory
+ # and doesn't core dump
+ if($ret & 255) {
+ logmsg " system() returned $ret\n";
+ $fail=1;
+ }
+ else {
+ my @memdata=`$memanalyze $memdump`;
+ my $leak=0;
+ for(@memdata) {
+ if($_ ne "") {
+ # well it could be other memory problems as well, but
+ # we call it leak for short here
+ $leak=1;
+ }
+ }
+ if($leak) {
+ logmsg "** MEMORY FAILURE\n";
+ logmsg @memdata;
+ logmsg `$memanalyze -l $memdump`;
+ $fail = 1;
+ }
+ }
+ if($fail) {
+ logmsg " Failed on alloc number $limit in test.\n",
+ " invoke with \"-t$limit\" to repeat this single case.\n";
+ stopservers($verbose);
+ return 1;
+ }
+ }
+
+ logmsg "torture OK\n";
+ return 0;
+}
+
+#######################################################################
+# Stop a test server along with pids which aren't in the %run hash yet.
+# This also stops all servers which are relative to the given one.
+#
+sub stopserver {
+ my ($server, $pidlist) = @_;
+ #
+ # kill sockfilter processes for pingpong relative server
+ #
+ if($server =~ /^(ftp|imap|pop3|smtp)s?(\d*)(-ipv6|)$/) {
+ my $proto = $1;
+ my $idnum = ($2 && ($2 > 1)) ? $2 : 1;
+ my $ipvnum = ($3 && ($3 =~ /6$/)) ? 6 : 4;
+ killsockfilters($proto, $ipvnum, $idnum, $verbose);
+ }
+ #
+ # All servers relative to the given one must be stopped also
+ #
+ my @killservers;
+ if($server =~ /^(ftp|http|imap|pop3|smtp)s(.*)$/) {
+ # given an ssl server, also kill non-ssl underlying one
+ push @killservers, "${1}${2}";
+ }
+ elsif($server =~ /^(ftp|http|imap|pop3|smtp)(.*)$/) {
+ # given a non-ssl server, also kill ssl piggybacking one
+ push @killservers, "${1}s${2}";
+ }
+ elsif($server =~ /^(socks)(.*)$/) {
+ # given an socks server, also kill ssh underlying one
+ push @killservers, "ssh${2}";
+ }
+ elsif($server =~ /^(ssh)(.*)$/) {
+ # given an ssh server, also kill socks piggybacking one
+ push @killservers, "socks${2}";
+ }
+ push @killservers, $server;
+ #
+ # kill given pids and server relative ones clearing them in %run hash
+ #
+ foreach my $server (@killservers) {
+ if($run{$server}) {
+ $pidlist .= "$run{$server} ";
+ $run{$server} = 0;
+ }
+ $runcert{$server} = 0 if($runcert{$server});
+ }
+ killpid($verbose, $pidlist);
+ #
+ # cleanup server pid files
+ #
+ foreach my $server (@killservers) {
+ my $pidfile = $serverpidfile{$server};
+ my $pid = processexists($pidfile);
+ if($pid > 0) {
+ logmsg "Warning: $server server unexpectedly alive\n";
+ killpid($verbose, $pid);
+ }
+ unlink($pidfile) if(-f $pidfile);
+ }
+}
+
+#######################################################################
+# Verify that the server that runs on $ip, $port is our server. This also
+# implies that we can speak with it, as there might be occasions when the
+# server runs fine but we cannot talk to it ("Failed to connect to ::1: Can't
+# assign requested address" #
+
+sub verifyhttp {
+ my ($proto, $ipvnum, $idnum, $ip, $port) = @_;
+ my $server = servername_id($proto, $ipvnum, $idnum);
+ my $pid = 0;
+ my $bonus="";
+
+ my $verifyout = "$LOGDIR/".
+ servername_canon($proto, $ipvnum, $idnum) .'_verify.out';
+ unlink($verifyout) if(-f $verifyout);
+
+ my $verifylog = "$LOGDIR/".
+ servername_canon($proto, $ipvnum, $idnum) .'_verify.log';
+ unlink($verifylog) if(-f $verifylog);
+
+ if($proto eq "gopher") {
+ # gopher is funny
+ $bonus="1/";
+ }
+
+ my $flags = "--max-time $server_response_maxtime ";
+ $flags .= "--output $verifyout ";
+ $flags .= "--silent ";
+ $flags .= "--verbose ";
+ $flags .= "--globoff ";
+ $flags .= "--insecure " if($proto eq 'https');
+ $flags .= "\"$proto://$ip:$port/${bonus}verifiedserver\"";
+
+ my $cmd = "$VCURL $flags 2>$verifylog";
+
+ # verify if our/any server is running on this port
+ logmsg "RUN: $cmd\n" if($verbose);
+ my $res = runclient($cmd);
+
+ $res >>= 8; # rotate the result
+ if($res & 128) {
+ logmsg "RUN: curl command died with a coredump\n";
+ return -1;
+ }
+
+ if($res && $verbose) {
+ logmsg "RUN: curl command returned $res\n";
+ if(open(FILE, "<$verifylog")) {
+ while(my $string = <FILE>) {
+ logmsg "RUN: $string" if($string !~ /^([ \t]*)$/);
+ }
+ close(FILE);
+ }
+ }
+
+ my $data;
+ if(open(FILE, "<$verifyout")) {
+ while(my $string = <FILE>) {
+ $data = $string;
+ last; # only want first line
+ }
+ close(FILE);
+ }
+
+ if($data && ($data =~ /WE ROOLZ: (\d+)/)) {
+ $pid = 0+$1;
+ }
+ elsif($res == 6) {
+ # curl: (6) Couldn't resolve host '::1'
+ logmsg "RUN: failed to resolve host ($proto://$ip:$port/verifiedserver)\n";
+ return -1;
+ }
+ elsif($data || ($res && ($res != 7))) {
+ logmsg "RUN: Unknown server on our $server port: $port ($res)\n";
+ return -1;
+ }
+ return $pid;
+}
+
+#######################################################################
+# Verify that the server that runs on $ip, $port is our server. This also
+# implies that we can speak with it, as there might be occasions when the
+# server runs fine but we cannot talk to it ("Failed to connect to ::1: Can't
+# assign requested address" #
+
+sub verifyftp {
+ my ($proto, $ipvnum, $idnum, $ip, $port) = @_;
+ my $server = servername_id($proto, $ipvnum, $idnum);
+ my $pid = 0;
+ my $time=time();
+ my $extra="";
+
+ my $verifylog = "$LOGDIR/".
+ servername_canon($proto, $ipvnum, $idnum) .'_verify.log';
+ unlink($verifylog) if(-f $verifylog);
+
+ if($proto eq "ftps") {
+ $extra .= "--insecure --ftp-ssl-control ";
+ }
+ elsif($proto eq "smtp") {
+ # SMTP is a bit different since it requires more options and it
+ # has _no_ output!
+ $extra .= "--mail-rcpt verifiedserver ";
+ $extra .= "--mail-from fake ";
+ $extra .= "--upload /dev/null ";
+ $extra .= "--stderr - "; # move stderr to parse the verbose stuff
+ }
+
+ my $flags = "--max-time $server_response_maxtime ";
+ $flags .= "--silent ";
+ $flags .= "--verbose ";
+ $flags .= "--globoff ";
+ $flags .= $extra;
+ $flags .= "\"$proto://$ip:$port/verifiedserver\"";
+
+ my $cmd = "$VCURL $flags 2>$verifylog";
+
+ # check if this is our server running on this port:
+ logmsg "RUN: $cmd\n" if($verbose);
+ my @data = runclientoutput($cmd);
+
+ my $res = $? >> 8; # rotate the result
+ if($res & 128) {
+ logmsg "RUN: curl command died with a coredump\n";
+ return -1;
+ }
+
+ foreach my $line (@data) {
+ if($line =~ /WE ROOLZ: (\d+)/) {
+ # this is our test server with a known pid!
+ $pid = 0+$1;
+ last;
+ }
+ }
+ if($pid <= 0 && @data && $data[0]) {
+ # this is not a known server
+ logmsg "RUN: Unknown server on our $server port: $port\n";
+ return 0;
+ }
+ # we can/should use the time it took to verify the FTP server as a measure
+ # on how fast/slow this host/FTP is.
+ my $took = int(0.5+time()-$time);
+
+ if($verbose) {
+ logmsg "RUN: Verifying our test $server server took $took seconds\n";
+ }
+ $ftpchecktime = $took>=1?$took:1; # make sure it never is below 1
+
+ return $pid;
+}
+
+#######################################################################
+# Verify that the server that runs on $ip, $port is our server. This also
+# implies that we can speak with it, as there might be occasions when the
+# server runs fine but we cannot talk to it ("Failed to connect to ::1: Can't
+# assign requested address" #
+
+sub verifyrtsp {
+ my ($proto, $ipvnum, $idnum, $ip, $port) = @_;
+ my $server = servername_id($proto, $ipvnum, $idnum);
+ my $pid = 0;
+
+ my $verifyout = "$LOGDIR/".
+ servername_canon($proto, $ipvnum, $idnum) .'_verify.out';
+ unlink($verifyout) if(-f $verifyout);
+
+ my $verifylog = "$LOGDIR/".
+ servername_canon($proto, $ipvnum, $idnum) .'_verify.log';
+ unlink($verifylog) if(-f $verifylog);
+
+ my $flags = "--max-time $server_response_maxtime ";
+ $flags .= "--output $verifyout ";
+ $flags .= "--silent ";
+ $flags .= "--verbose ";
+ $flags .= "--globoff ";
+ # currently verification is done using http
+ $flags .= "\"http://$ip:$port/verifiedserver\"";
+
+ my $cmd = "$VCURL $flags 2>$verifylog";
+
+ # verify if our/any server is running on this port
+ logmsg "RUN: $cmd\n" if($verbose);
+ my $res = runclient($cmd);
+
+ $res >>= 8; # rotate the result
+ if($res & 128) {
+ logmsg "RUN: curl command died with a coredump\n";
+ return -1;
+ }
+
+ if($res && $verbose) {
+ logmsg "RUN: curl command returned $res\n";
+ if(open(FILE, "<$verifylog")) {
+ while(my $string = <FILE>) {
+ logmsg "RUN: $string" if($string !~ /^([ \t]*)$/);
+ }
+ close(FILE);
+ }
+ }
+
+ my $data;
+ if(open(FILE, "<$verifyout")) {
+ while(my $string = <FILE>) {
+ $data = $string;
+ last; # only want first line
+ }
+ close(FILE);
+ }
+
+ if($data && ($data =~ /RTSP_SERVER WE ROOLZ: (\d+)/)) {
+ $pid = 0+$1;
+ }
+ elsif($res == 6) {
+ # curl: (6) Couldn't resolve host '::1'
+ logmsg "RUN: failed to resolve host ($proto://$ip:$port/verifiedserver)\n";
+ return -1;
+ }
+ elsif($data || ($res != 7)) {
+ logmsg "RUN: Unknown server on our $server port: $port\n";
+ return -1;
+ }
+ return $pid;
+}
+
+#######################################################################
+# Verify that the ssh server has written out its pidfile, recovering
+# the pid from the file and returning it if a process with that pid is
+# actually alive.
+
+sub verifyssh {
+ my ($proto, $ipvnum, $idnum, $ip, $port) = @_;
+ my $server = servername_id($proto, $ipvnum, $idnum);
+ my $pidfile = server_pidfilename($proto, $ipvnum, $idnum);
+ my $pid = 0;
+ if(open(FILE, "<$pidfile")) {
+ $pid=0+<FILE>;
+ close(FILE);
+ }
+ if($pid > 0) {
+ # if we have a pid it is actually our ssh server,
+ # since runsshserver() unlinks previous pidfile
+ if(!kill(0, $pid)) {
+ logmsg "RUN: SSH server has died after starting up\n";
+ checkdied($pid);
+ unlink($pidfile);
+ $pid = -1;
+ }
+ }
+ return $pid;
+}
+
+#######################################################################
+# Verify that we can connect to the sftp server, properly authenticate
+# with generated config and key files and run a simple remote pwd.
+
+sub verifysftp {
+ my ($proto, $ipvnum, $idnum, $ip, $port) = @_;
+ my $server = servername_id($proto, $ipvnum, $idnum);
+ my $verified = 0;
+ # Find out sftp client canonical file name
+ my $sftp = find_sftp();
+ if(!$sftp) {
+ logmsg "RUN: SFTP server cannot find $sftpexe\n";
+ return -1;
+ }
+ # Find out ssh client canonical file name
+ my $ssh = find_ssh();
+ if(!$ssh) {
+ logmsg "RUN: SFTP server cannot find $sshexe\n";
+ return -1;
+ }
+ # Connect to sftp server, authenticate and run a remote pwd
+ # command using our generated configuration and key files
+ my $cmd = "$sftp -b $sftpcmds -F $sftpconfig -S $ssh $ip > $sftplog 2>&1";
+ my $res = runclient($cmd);
+ # Search for pwd command response in log file
+ if(open(SFTPLOGFILE, "<$sftplog")) {
+ while(<SFTPLOGFILE>) {
+ if(/^Remote working directory: /) {
+ $verified = 1;
+ last;
+ }
+ }
+ close(SFTPLOGFILE);
+ }
+ return $verified;
+}
+
+
+#######################################################################
+# STUB for verifying socks
+
+sub verifysocks {
+ my ($proto, $ipvnum, $idnum, $ip, $port) = @_;
+ my $server = servername_id($proto, $ipvnum, $idnum);
+ my $pidfile = server_pidfilename($proto, $ipvnum, $idnum);
+ my $pid = 0;
+ if(open(FILE, "<$pidfile")) {
+ $pid=0+<FILE>;
+ close(FILE);
+ }
+ if($pid > 0) {
+ # if we have a pid it is actually our socks server,
+ # since runsocksserver() unlinks previous pidfile
+ if(!kill(0, $pid)) {
+ logmsg "RUN: SOCKS server has died after starting up\n";
+ checkdied($pid);
+ unlink($pidfile);
+ $pid = -1;
+ }
+ }
+ return $pid;
+}
+
+#######################################################################
+# Verify that the server that runs on $ip, $port is our server.
+# Retry over several seconds before giving up. The ssh server in
+# particular can take a long time to start if it needs to generate
+# keys on a slow or loaded host.
+#
+
+my %protofunc = ('http' => \&verifyhttp,
+ 'https' => \&verifyhttp,
+ 'rtsp' => \&verifyrtsp,
+ 'ftp' => \&verifyftp,
+ 'pop3' => \&verifyftp,
+ 'imap' => \&verifyftp,
+ 'smtp' => \&verifyftp,
+ 'ftps' => \&verifyftp,
+ 'tftp' => \&verifyftp,
+ 'ssh' => \&verifyssh,
+ 'socks' => \&verifysocks,
+ 'gopher' => \&verifyhttp);
+
+sub verifyserver {
+ my ($proto, $ipvnum, $idnum, $ip, $port) = @_;
+
+ my $count = 30; # try for this many seconds
+ my $pid;
+
+ while($count--) {
+ my $fun = $protofunc{$proto};
+
+ $pid = &$fun($proto, $ipvnum, $idnum, $ip, $port);
+
+ if($pid > 0) {
+ last;
+ }
+ elsif($pid < 0) {
+ # a real failure, stop trying and bail out
+ return 0;
+ }
+ sleep(1);
+ }
+ return $pid;
+}
+
+
+
+#######################################################################
+# start the http server
+#
+sub runhttpserver {
+ my ($proto, $verbose, $ipv6, $port) = @_;
+ my $ip = $HOSTIP;
+ my $ipvnum = 4;
+ my $idnum = 1;
+ my $server;
+ my $srvrname;
+ my $pidfile;
+ my $logfile;
+ my $flags = "";
+
+
+ if($ipv6) {
+ # if IPv6, use a different setup
+ $ipvnum = 6;
+ $ip = $HOST6IP;
+ }
+
+ $server = servername_id($proto, $ipvnum, $idnum);
+
+ $pidfile = $serverpidfile{$server};
+
+ # don't retry if the server doesn't work
+ if ($doesntrun{$pidfile}) {
+ return (0,0);
+ }
+
+ my $pid = processexists($pidfile);
+ if($pid > 0) {
+ stopserver($server, "$pid");
+ }
+ unlink($pidfile) if(-f $pidfile);
+
+ $srvrname = servername_str($proto, $ipvnum, $idnum);
+
+ $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
+
+ $flags .= "--fork " if($forkserver);
+ $flags .= "--gopher " if($proto eq "gopher");
+ $flags .= "--verbose " if($debugprotocol);
+ $flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
+ $flags .= "--id $idnum " if($idnum > 1);
+ $flags .= "--ipv$ipvnum --port $port --srcdir \"$srcdir\"";
+
+ my $cmd = "$perl $srcdir/httpserver.pl $flags";
+ my ($httppid, $pid2) = startnew($cmd, $pidfile, 15, 0);
+
+ if($httppid <= 0 || !kill(0, $httppid)) {
+ # it is NOT alive
+ logmsg "RUN: failed to start the $srvrname server\n";
+ stopserver($server, "$pid2");
+ displaylogs($testnumcheck);
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+
+ # Server is up. Verify that we can speak to it.
+ my $pid3 = verifyserver($proto, $ipvnum, $idnum, $ip, $port);
+ if(!$pid3) {
+ logmsg "RUN: $srvrname server failed verification\n";
+ # failed to talk to it properly. Kill the server and return failure
+ stopserver($server, "$httppid $pid2");
+ displaylogs($testnumcheck);
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+ $pid2 = $pid3;
+
+ if($verbose) {
+ logmsg "RUN: $srvrname server is now running PID $httppid\n";
+ }
+
+ sleep(1);
+
+ return ($httppid, $pid2);
+}
+
+#######################################################################
+# start the https server (or rather, tunnel)
+#
+sub runhttpsserver {
+ my ($verbose, $ipv6, $certfile) = @_;
+ my $proto = 'https';
+ my $ip = ($ipv6 && ($ipv6 =~ /6$/)) ? "$HOST6IP" : "$HOSTIP";
+ my $ipvnum = ($ipv6 && ($ipv6 =~ /6$/)) ? 6 : 4;
+ my $idnum = 1;
+ my $server;
+ my $srvrname;
+ my $pidfile;
+ my $logfile;
+ my $flags = "";
+
+ if(!$stunnel) {
+ return (0,0);
+ }
+
+ $server = servername_id($proto, $ipvnum, $idnum);
+
+ $pidfile = $serverpidfile{$server};
+
+ # don't retry if the server doesn't work
+ if ($doesntrun{$pidfile}) {
+ return (0,0);
+ }
+
+ my $pid = processexists($pidfile);
+ if($pid > 0) {
+ stopserver($server, "$pid");
+ }
+ unlink($pidfile) if(-f $pidfile);
+
+ $srvrname = servername_str($proto, $ipvnum, $idnum);
+
+ $certfile = 'stunnel.pem' unless($certfile);
+
+ $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
+
+ $flags .= "--verbose " if($debugprotocol);
+ $flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
+ $flags .= "--id $idnum " if($idnum > 1);
+ $flags .= "--ipv$ipvnum --proto $proto ";
+ $flags .= "--certfile \"$certfile\" " if($certfile ne 'stunnel.pem');
+ $flags .= "--stunnel \"$stunnel\" --srcdir \"$srcdir\" ";
+ $flags .= "--connect $HTTPPORT --accept $HTTPSPORT";
+
+ my $cmd = "$perl $srcdir/secureserver.pl $flags";
+ my ($httpspid, $pid2) = startnew($cmd, $pidfile, 15, 0);
+
+ if($httpspid <= 0 || !kill(0, $httpspid)) {
+ # it is NOT alive
+ logmsg "RUN: failed to start the $srvrname server\n";
+ stopserver($server, "$pid2");
+ displaylogs($testnumcheck);
+ $doesntrun{$pidfile} = 1;
+ return(0,0);
+ }
+
+ # Server is up. Verify that we can speak to it.
+ my $pid3 = verifyserver($proto, $ipvnum, $idnum, $ip, $HTTPSPORT);
+ if(!$pid3) {
+ logmsg "RUN: $srvrname server failed verification\n";
+ # failed to talk to it properly. Kill the server and return failure
+ stopserver($server, "$httpspid $pid2");
+ displaylogs($testnumcheck);
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+ # Here pid3 is actually the pid returned by the unsecure-http server.
+
+ $runcert{$server} = $certfile;
+
+ if($verbose) {
+ logmsg "RUN: $srvrname server is now running PID $httpspid\n";
+ }
+
+ sleep(1);
+
+ return ($httpspid, $pid2);
+}
+
+#######################################################################
+# start the pingpong server (FTP, POP3, IMAP, SMTP)
+#
+sub runpingpongserver {
+ my ($proto, $id, $verbose, $ipv6) = @_;
+ my $port;
+ my $ip = ($ipv6 && ($ipv6 =~ /6$/)) ? "$HOST6IP" : "$HOSTIP";
+ my $ipvnum = ($ipv6 && ($ipv6 =~ /6$/)) ? 6 : 4;
+ my $idnum = ($id && ($id =~ /^(\d+)$/) && ($id > 1)) ? $id : 1;
+ my $server;
+ my $srvrname;
+ my $pidfile;
+ my $logfile;
+ my $flags = "";
+
+ if($proto eq "ftp") {
+ $port = ($idnum>1)?$FTP2PORT:$FTPPORT;
+
+ if($ipvnum==6) {
+ # if IPv6, use a different setup
+ $port = $FTP6PORT;
+ }
+ }
+ elsif($proto eq "pop3") {
+ $port = ($ipvnum==6) ? $POP36PORT : $POP3PORT;
+ }
+ elsif($proto eq "imap") {
+ $port = ($ipvnum==6) ? $IMAP6PORT : $IMAPPORT;
+ }
+ elsif($proto eq "smtp") {
+ $port = ($ipvnum==6) ? $SMTP6PORT : $SMTPPORT;
+ }
+ else {
+ print STDERR "Unsupported protocol $proto!!\n";
+ return 0;
+ }
+
+ $server = servername_id($proto, $ipvnum, $idnum);
+
+ $pidfile = $serverpidfile{$server};
+
+ # don't retry if the server doesn't work
+ if ($doesntrun{$pidfile}) {
+ return (0,0);
+ }
+
+ my $pid = processexists($pidfile);
+ if($pid > 0) {
+ stopserver($server, "$pid");
+ }
+ unlink($pidfile) if(-f $pidfile);
+
+ $srvrname = servername_str($proto, $ipvnum, $idnum);
+
+ $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
+
+ $flags .= "--verbose " if($debugprotocol);
+ $flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
+ $flags .= "--srcdir \"$srcdir\" --proto $proto ";
+ $flags .= "--id $idnum " if($idnum > 1);
+ $flags .= "--ipv$ipvnum --port $port --addr \"$ip\"";
+
+ my $cmd = "$perl $srcdir/ftpserver.pl $flags";
+ my ($ftppid, $pid2) = startnew($cmd, $pidfile, 15, 0);
+
+ if($ftppid <= 0 || !kill(0, $ftppid)) {
+ # it is NOT alive
+ logmsg "RUN: failed to start the $srvrname server\n";
+ stopserver($server, "$pid2");
+ displaylogs($testnumcheck);
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+
+ # Server is up. Verify that we can speak to it.
+ my $pid3 = verifyserver($proto, $ipvnum, $idnum, $ip, $port);
+ if(!$pid3) {
+ logmsg "RUN: $srvrname server failed verification\n";
+ # failed to talk to it properly. Kill the server and return failure
+ stopserver($server, "$ftppid $pid2");
+ displaylogs($testnumcheck);
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+
+ $pid2 = $pid3;
+
+ if($verbose) {
+ logmsg "RUN: $srvrname server is now running PID $ftppid\n";
+ }
+
+ sleep(1);
+
+ return ($pid2, $ftppid);
+}
+
+#######################################################################
+# start the ftps server (or rather, tunnel)
+#
+sub runftpsserver {
+ my ($verbose, $ipv6, $certfile) = @_;
+ my $proto = 'ftps';
+ my $ip = ($ipv6 && ($ipv6 =~ /6$/)) ? "$HOST6IP" : "$HOSTIP";
+ my $ipvnum = ($ipv6 && ($ipv6 =~ /6$/)) ? 6 : 4;
+ my $idnum = 1;
+ my $server;
+ my $srvrname;
+ my $pidfile;
+ my $logfile;
+ my $flags = "";
+
+ if(!$stunnel) {
+ return (0,0);
+ }
+
+ $server = servername_id($proto, $ipvnum, $idnum);
+
+ $pidfile = $serverpidfile{$server};
+
+ # don't retry if the server doesn't work
+ if ($doesntrun{$pidfile}) {
+ return (0,0);
+ }
+
+ my $pid = processexists($pidfile);
+ if($pid > 0) {
+ stopserver($server, "$pid");
+ }
+ unlink($pidfile) if(-f $pidfile);
+
+ $srvrname = servername_str($proto, $ipvnum, $idnum);
+
+ $certfile = 'stunnel.pem' unless($certfile);
+
+ $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
+
+ $flags .= "--verbose " if($debugprotocol);
+ $flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
+ $flags .= "--id $idnum " if($idnum > 1);
+ $flags .= "--ipv$ipvnum --proto $proto ";
+ $flags .= "--certfile \"$certfile\" " if($certfile ne 'stunnel.pem');
+ $flags .= "--stunnel \"$stunnel\" --srcdir \"$srcdir\" ";
+ $flags .= "--connect $FTPPORT --accept $FTPSPORT";
+
+ my $cmd = "$perl $srcdir/secureserver.pl $flags";
+ my ($ftpspid, $pid2) = startnew($cmd, $pidfile, 15, 0);
+
+ if($ftpspid <= 0 || !kill(0, $ftpspid)) {
+ # it is NOT alive
+ logmsg "RUN: failed to start the $srvrname server\n";
+ stopserver($server, "$pid2");
+ displaylogs($testnumcheck);
+ $doesntrun{$pidfile} = 1;
+ return(0,0);
+ }
+
+ # Server is up. Verify that we can speak to it.
+ my $pid3 = verifyserver($proto, $ipvnum, $idnum, $ip, $FTPSPORT);
+ if(!$pid3) {
+ logmsg "RUN: $srvrname server failed verification\n";
+ # failed to talk to it properly. Kill the server and return failure
+ stopserver($server, "$ftpspid $pid2");
+ displaylogs($testnumcheck);
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+ # Here pid3 is actually the pid returned by the unsecure-ftp server.
+
+ $runcert{$server} = $certfile;
+
+ if($verbose) {
+ logmsg "RUN: $srvrname server is now running PID $ftpspid\n";
+ }
+
+ sleep(1);
+
+ return ($ftpspid, $pid2);
+}
+
+#######################################################################
+# start the tftp server
+#
+sub runtftpserver {
+ my ($id, $verbose, $ipv6) = @_;
+ my $port = $TFTPPORT;
+ my $ip = $HOSTIP;
+ my $proto = 'tftp';
+ my $ipvnum = 4;
+ my $idnum = ($id && ($id =~ /^(\d+)$/) && ($id > 1)) ? $id : 1;
+ my $server;
+ my $srvrname;
+ my $pidfile;
+ my $logfile;
+ my $flags = "";
+
+ if($ipv6) {
+ # if IPv6, use a different setup
+ $ipvnum = 6;
+ $port = $TFTP6PORT;
+ $ip = $HOST6IP;
+ }
+
+ $server = servername_id($proto, $ipvnum, $idnum);
+
+ $pidfile = $serverpidfile{$server};
+
+ # don't retry if the server doesn't work
+ if ($doesntrun{$pidfile}) {
+ return (0,0);
+ }
+
+ my $pid = processexists($pidfile);
+ if($pid > 0) {
+ stopserver($server, "$pid");
+ }
+ unlink($pidfile) if(-f $pidfile);
+
+ $srvrname = servername_str($proto, $ipvnum, $idnum);
+
+ $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
+
+ $flags .= "--verbose " if($debugprotocol);
+ $flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
+ $flags .= "--id $idnum " if($idnum > 1);
+ $flags .= "--ipv$ipvnum --port $port --srcdir \"$srcdir\"";
+
+ my $cmd = "$perl $srcdir/tftpserver.pl $flags";
+ my ($tftppid, $pid2) = startnew($cmd, $pidfile, 15, 0);
+
+ if($tftppid <= 0 || !kill(0, $tftppid)) {
+ # it is NOT alive
+ logmsg "RUN: failed to start the $srvrname server\n";
+ stopserver($server, "$pid2");
+ displaylogs($testnumcheck);
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+
+ # Server is up. Verify that we can speak to it.
+ my $pid3 = verifyserver($proto, $ipvnum, $idnum, $ip, $port);
+ if(!$pid3) {
+ logmsg "RUN: $srvrname server failed verification\n";
+ # failed to talk to it properly. Kill the server and return failure
+ stopserver($server, "$tftppid $pid2");
+ displaylogs($testnumcheck);
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+ $pid2 = $pid3;
+
+ if($verbose) {
+ logmsg "RUN: $srvrname server is now running PID $tftppid\n";
+ }
+
+ sleep(1);
+
+ return ($pid2, $tftppid);
+}
+
+
+#######################################################################
+# start the rtsp server
+#
+sub runrtspserver {
+ my ($verbose, $ipv6) = @_;
+ my $port = $RTSPPORT;
+ my $ip = $HOSTIP;
+ my $proto = 'rtsp';
+ my $ipvnum = 4;
+ my $idnum = 1;
+ my $server;
+ my $srvrname;
+ my $pidfile;
+ my $logfile;
+ my $flags = "";
+
+ if($ipv6) {
+ # if IPv6, use a different setup
+ $ipvnum = 6;
+ $port = $RTSP6PORT;
+ $ip = $HOST6IP;
+ }
+
+ $server = servername_id($proto, $ipvnum, $idnum);
+
+ $pidfile = $serverpidfile{$server};
+
+ # don't retry if the server doesn't work
+ if ($doesntrun{$pidfile}) {
+ return (0,0);
+ }
+
+ my $pid = processexists($pidfile);
+ if($pid > 0) {
+ stopserver($server, "$pid");
+ }
+ unlink($pidfile) if(-f $pidfile);
+
+ $srvrname = servername_str($proto, $ipvnum, $idnum);
+
+ $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
+
+ $flags .= "--verbose " if($debugprotocol);
+ $flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
+ $flags .= "--id $idnum " if($idnum > 1);
+ $flags .= "--ipv$ipvnum --port $port --srcdir \"$srcdir\"";
+
+ my $cmd = "$perl $srcdir/rtspserver.pl $flags";
+ my ($rtsppid, $pid2) = startnew($cmd, $pidfile, 15, 0);
+
+ if($rtsppid <= 0 || !kill(0, $rtsppid)) {
+ # it is NOT alive
+ logmsg "RUN: failed to start the $srvrname server\n";
+ stopserver($server, "$pid2");
+ displaylogs($testnumcheck);
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+
+ # Server is up. Verify that we can speak to it.
+ my $pid3 = verifyserver($proto, $ipvnum, $idnum, $ip, $port);
+ if(!$pid3) {
+ logmsg "RUN: $srvrname server failed verification\n";
+ # failed to talk to it properly. Kill the server and return failure
+ stopserver($server, "$rtsppid $pid2");
+ displaylogs($testnumcheck);
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+ $pid2 = $pid3;
+
+ if($verbose) {
+ logmsg "RUN: $srvrname server is now running PID $rtsppid\n";
+ }
+
+ sleep(1);
+
+ return ($rtsppid, $pid2);
+}
+
+
+#######################################################################
+# Start the ssh (scp/sftp) server
+#
+sub runsshserver {
+ my ($id, $verbose, $ipv6) = @_;
+ my $ip=$HOSTIP;
+ my $port = $SSHPORT;
+ my $socksport = $SOCKSPORT;
+ my $proto = 'ssh';
+ my $ipvnum = 4;
+ my $idnum = ($id && ($id =~ /^(\d+)$/) && ($id > 1)) ? $id : 1;
+ my $server;
+ my $srvrname;
+ my $pidfile;
+ my $logfile;
+ my $flags = "";
+
+ $server = servername_id($proto, $ipvnum, $idnum);
+
+ $pidfile = $serverpidfile{$server};
+
+ # don't retry if the server doesn't work
+ if ($doesntrun{$pidfile}) {
+ return (0,0);
+ }
+
+ my $pid = processexists($pidfile);
+ if($pid > 0) {
+ stopserver($server, "$pid");
+ }
+ unlink($pidfile) if(-f $pidfile);
+
+ $srvrname = servername_str($proto, $ipvnum, $idnum);
+
+ $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
+
+ $flags .= "--verbose " if($verbose);
+ $flags .= "--debugprotocol " if($debugprotocol);
+ $flags .= "--pidfile \"$pidfile\" ";
+ $flags .= "--id $idnum " if($idnum > 1);
+ $flags .= "--ipv$ipvnum --addr \"$ip\" ";
+ $flags .= "--sshport $port --socksport $socksport ";
+ $flags .= "--user \"$USER\"";
+
+ my $cmd = "$perl $srcdir/sshserver.pl $flags";
+ my ($sshpid, $pid2) = startnew($cmd, $pidfile, 60, 0);
+
+ # on loaded systems sshserver start up can take longer than the timeout
+ # passed to startnew, when this happens startnew completes without being
+ # able to read the pidfile and consequently returns a zero pid2 above.
+
+ if($sshpid <= 0 || !kill(0, $sshpid)) {
+ # it is NOT alive
+ logmsg "RUN: failed to start the $srvrname server\n";
+ stopserver($server, "$pid2");
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+
+ # ssh server verification allows some extra time for the server to start up
+ # and gives us the opportunity of recovering the pid from the pidfile, when
+ # this verification succeeds the recovered pid is assigned to pid2.
+
+ my $pid3 = verifyserver($proto, $ipvnum, $idnum, $ip, $port);
+ if(!$pid3) {
+ logmsg "RUN: $srvrname server failed verification\n";
+ # failed to fetch server pid. Kill the server and return failure
+ stopserver($server, "$sshpid $pid2");
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+ $pid2 = $pid3;
+
+ # once it is known that the ssh server is alive, sftp server verification
+ # is performed actually connecting to it, authenticating and performing a
+ # very simple remote command. This verification is tried only one time.
+
+ $sshdlog = server_logfilename($LOGDIR, 'ssh', $ipvnum, $idnum);
+ $sftplog = server_logfilename($LOGDIR, 'sftp', $ipvnum, $idnum);
+
+ if(verifysftp('sftp', $ipvnum, $idnum, $ip, $port) < 1) {
+ logmsg "RUN: SFTP server failed verification\n";
+ # failed to talk to it properly. Kill the server and return failure
+ display_sftplog();
+ display_sftpconfig();
+ display_sshdlog();
+ display_sshdconfig();
+ stopserver($server, "$sshpid $pid2");
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+
+ if($verbose) {
+ logmsg "RUN: $srvrname server is now running PID $pid2\n";
+ }
+
+ return ($pid2, $sshpid);
+}
+
+#######################################################################
+# Start the socks server
+#
+sub runsocksserver {
+ my ($id, $verbose, $ipv6) = @_;
+ my $ip=$HOSTIP;
+ my $port = $SOCKSPORT;
+ my $proto = 'socks';
+ my $ipvnum = 4;
+ my $idnum = ($id && ($id =~ /^(\d+)$/) && ($id > 1)) ? $id : 1;
+ my $server;
+ my $srvrname;
+ my $pidfile;
+ my $logfile;
+ my $flags = "";
+
+ $server = servername_id($proto, $ipvnum, $idnum);
+
+ $pidfile = $serverpidfile{$server};
+
+ # don't retry if the server doesn't work
+ if ($doesntrun{$pidfile}) {
+ return (0,0);
+ }
+
+ my $pid = processexists($pidfile);
+ if($pid > 0) {
+ stopserver($server, "$pid");
+ }
+ unlink($pidfile) if(-f $pidfile);
+
+ $srvrname = servername_str($proto, $ipvnum, $idnum);
+
+ $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
+
+ # The ssh server must be already running
+ if(!$run{'ssh'}) {
+ logmsg "RUN: SOCKS server cannot find running SSH server\n";
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+
+ # Find out ssh daemon canonical file name
+ my $sshd = find_sshd();
+ if(!$sshd) {
+ logmsg "RUN: SOCKS server cannot find $sshdexe\n";
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+
+ # Find out ssh daemon version info
+ ($sshdid, $sshdvernum, $sshdverstr, $sshderror) = sshversioninfo($sshd);
+ if(!$sshdid) {
+ # Not an OpenSSH or SunSSH ssh daemon
+ logmsg "$sshderror\n" if($verbose);
+ logmsg "SCP, SFTP and SOCKS tests require OpenSSH 2.9.9 or later\n";
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+ logmsg "ssh server found $sshd is $sshdverstr\n" if($verbose);
+
+ # Find out ssh client canonical file name
+ my $ssh = find_ssh();
+ if(!$ssh) {
+ logmsg "RUN: SOCKS server cannot find $sshexe\n";
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+
+ # Find out ssh client version info
+ my ($sshid, $sshvernum, $sshverstr, $ssherror) = sshversioninfo($ssh);
+ if(!$sshid) {
+ # Not an OpenSSH or SunSSH ssh client
+ logmsg "$ssherror\n" if($verbose);
+ logmsg "SCP, SFTP and SOCKS tests require OpenSSH 2.9.9 or later\n";
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+
+ # Verify minimum ssh client version
+ if((($sshid =~ /OpenSSH/) && ($sshvernum < 299)) ||
+ (($sshid =~ /SunSSH/) && ($sshvernum < 100))) {
+ logmsg "ssh client found $ssh is $sshverstr\n";
+ logmsg "SCP, SFTP and SOCKS tests require OpenSSH 2.9.9 or later\n";
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+ logmsg "ssh client found $ssh is $sshverstr\n" if($verbose);
+
+ # Verify if ssh client and ssh daemon versions match
+ if(($sshdid ne $sshid) || ($sshdvernum != $sshvernum)) {
+ # Our test harness might work with slightly mismatched versions
+ logmsg "Warning: version mismatch: sshd $sshdverstr - ssh $sshverstr\n"
+ if($verbose);
+ }
+
+ # Config file options for ssh client are previously set from sshserver.pl
+ if(! -e $sshconfig) {
+ logmsg "RUN: SOCKS server cannot find $sshconfig\n";
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+
+ $sshlog = server_logfilename($LOGDIR, 'socks', $ipvnum, $idnum);
+
+ # start our socks server
+ my $cmd="$ssh -N -F $sshconfig $ip > $sshlog 2>&1";
+ my ($sshpid, $pid2) = startnew($cmd, $pidfile, 30, 1);
+
+ if($sshpid <= 0 || !kill(0, $sshpid)) {
+ # it is NOT alive
+ logmsg "RUN: failed to start the $srvrname server\n";
+ display_sshlog();
+ display_sshconfig();
+ display_sshdlog();
+ display_sshdconfig();
+ stopserver($server, "$pid2");
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+
+ # Ugly hack but ssh doesn't support pid files
+ my $pid3 = verifyserver($proto, $ipvnum, $idnum, $ip, $port);
+ if(!$pid3) {
+ logmsg "RUN: $srvrname server failed verification\n";
+ # failed to talk to it properly. Kill the server and return failure
+ stopserver($server, "$sshpid $pid2");
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+ $pid2 = $pid3;
+
+ if($verbose) {
+ logmsg "RUN: $srvrname server is now running PID $pid2\n";
+ }
+
+ return ($pid2, $sshpid);
+}
+
+#######################################################################
+# Remove all files in the specified directory
+#
+sub cleardir {
+ my $dir = $_[0];
+ my $count;
+ my $file;
+
+ # Get all files
+ opendir(DIR, $dir) ||
+ return 0; # can't open dir
+ while($file = readdir(DIR)) {
+ if($file !~ /^\./) {
+ unlink("$dir/$file");
+ $count++;
+ }
+ }
+ closedir DIR;
+ return $count;
+}
+
+#######################################################################
+# filter out the specified pattern from the given input file and store the
+# results in the given output file
+#
+sub filteroff {
+ my $infile=$_[0];
+ my $filter=$_[1];
+ my $ofile=$_[2];
+
+ open(IN, "<$infile")
+ || return 1;
+
+ open(OUT, ">$ofile")
+ || return 1;
+
+ # logmsg "FILTER: off $filter from $infile to $ofile\n";
+
+ while(<IN>) {
+ $_ =~ s/$filter//;
+ print OUT $_;
+ }
+ close(IN);
+ close(OUT);
+ return 0;
+}
+
+#######################################################################
+# compare test results with the expected output, we might filter off
+# some pattern that is allowed to differ, output test results
+#
+
+sub compare {
+ # filter off patterns _before_ this comparison!
+ my ($subject, $firstref, $secondref)=@_;
+
+ my $result = compareparts($firstref, $secondref);
+
+ if($result) {
+ if(!$short) {
+ logmsg "\n $subject FAILED:\n";
+ logmsg showdiff($LOGDIR, $firstref, $secondref);
+ }
+ else {
+ logmsg "FAILED\n";
+ }
+ }
+ return $result;
+}
+
+#######################################################################
+# display information about curl and the host the test suite runs on
+#
+sub checksystem {
+
+ unlink($memdump); # remove this if there was one left
+
+ my $feat;
+ my $curl;
+ my $libcurl;
+ my $versretval;
+ my $versnoexec;
+ my @version=();
+
+ my $curlverout="$LOGDIR/curlverout.log";
+ my $curlvererr="$LOGDIR/curlvererr.log";
+ my $versioncmd="$CURL --version 1>$curlverout 2>$curlvererr";
+
+ unlink($curlverout);
+ unlink($curlvererr);
+
+ $versretval = runclient($versioncmd);
+ $versnoexec = $!;
+
+ open(VERSOUT, "<$curlverout");
+ @version = <VERSOUT>;
+ close(VERSOUT);
+
+ for(@version) {
+ chomp;
+
+ if($_ =~ /^curl/) {
+ $curl = $_;
+ $curl =~ s/^(.*)(libcurl.*)/$1/g;
+
+ $libcurl = $2;
+ if($curl =~ /mingw32/) {
+ # This is a windows minw32 build, we need to translate the
+ # given path to the "actual" windows path.
+
+ my @m = `mount`;
+ my $matchlen;
+ my $bestmatch;
+ my $mount;
+
+# example mount output:
+# C:\DOCUME~1\Temp on /tmp type user (binmode,noumount)
+# c:\ActiveState\perl on /perl type user (binmode)
+# C:\msys\1.0\bin on /usr/bin type user (binmode,cygexec,noumount)
+# C:\msys\1.0\bin on /bin type user (binmode,cygexec,noumount)
+
+ foreach $mount (@m) {
+ if( $mount =~ /(.*) on ([^ ]*) type /) {
+ my ($mingw, $real)=($2, $1);
+ if($pwd =~ /^$mingw/) {
+ # the path we got from pwd starts with the path
+ # we found on this line in the mount output
+
+ my $len = length($real);
+ if($len > $matchlen) {
+ # we remember the match that is the longest
+ $matchlen = $len;
+ $bestmatch = $real;
+ }
+ }
+ }
+ }
+ if(!$matchlen) {
+ logmsg "Serious error, can't find our \"real\" path\n";
+ }
+ else {
+ # now prepend the prefix from the mount command to build
+ # our "actual path"
+ $pwd = "$bestmatch$pwd";
+ }
+ $pwd =~ s#\\#/#g;
+ }
+ elsif ($curl =~ /win32/) {
+ # Native Windows builds don't understand the
+ # output of cygwin's pwd. It will be
+ # something like /cygdrive/c/<some path>.
+ #
+ # Use the cygpath utility to convert the
+ # working directory to a Windows friendly
+ # path. The -m option converts to use drive
+ # letter:, but it uses / instead \. Forward
+ # slashes (/) are easier for us. We don't
+ # have to escape them to get them to curl
+ # through a shell.
+ chomp($pwd = `cygpath -m $pwd`);
+ }
+ elsif ($libcurl =~ /openssl/i) {
+ $has_openssl=1;
+ $ssllib="OpenSSL";
+ }
+ elsif ($libcurl =~ /gnutls/i) {
+ $has_gnutls=1;
+ $ssllib="GnuTLS";
+ }
+ elsif ($libcurl =~ /nss/i) {
+ $has_nss=1;
+ $ssllib="NSS";
+ }
+ elsif ($libcurl =~ /yassl/i) {
+ $has_yassl=1;
+ $has_openssl=1;
+ $ssllib="yassl";
+ }
+ elsif ($libcurl =~ /polarssl/i) {
+ $has_polarssl=1;
+ $has_openssl=1;
+ $ssllib="polarssl";
+ }
+ }
+ elsif($_ =~ /^Protocols: (.*)/i) {
+ # these are the protocols compiled in to this libcurl
+ @protocols = split(' ', $1);
+
+ # Generate a "proto-ipv6" version of each protocol to match the
+ # IPv6 <server> name. This works even if IPv6 support isn't
+ # compiled in because the <features> test will fail.
+ push @protocols, map($_ . "-ipv6", @protocols);
+
+ # 'none' is used in test cases to mean no server
+ push @protocols, ('none');
+ }
+ elsif($_ =~ /^Features: (.*)/i) {
+ $feat = $1;
+ if($feat =~ /TrackMemory/i) {
+ # curl was built with --enable-curldebug (memory tracking)
+ $curl_debug = 1;
+ }
+ if($feat =~ /debug/i) {
+ # curl was built with --enable-debug
+ $debug_build = 1;
+ # set the NETRC debug env
+ $ENV{'CURL_DEBUG_NETRC'} = "$LOGDIR/netrc";
+ }
+ if($feat =~ /SSL/i) {
+ # ssl enabled
+ $ssl_version=1;
+ }
+ if($feat =~ /Largefile/i) {
+ # large file support
+ $large_file=1;
+ }
+ if($feat =~ /IDN/i) {
+ # IDN support
+ $has_idn=1;
+ }
+ if($feat =~ /IPv6/i) {
+ $has_ipv6 = 1;
+ }
+ if($feat =~ /libz/i) {
+ $has_libz = 1;
+ }
+ if($feat =~ /NTLM/i) {
+ # NTLM enabled
+ $has_ntlm=1;
+ }
+ if($feat =~ /CharConv/i) {
+ # CharConv enabled
+ $has_charconv=1;
+ }
+ }
+ }
+ if(!$curl) {
+ logmsg "unable to get curl's version, further details are:\n";
+ logmsg "issued command: \n";
+ logmsg "$versioncmd \n";
+ if ($versretval == -1) {
+ logmsg "command failed with: \n";
+ logmsg "$versnoexec \n";
+ }
+ elsif ($versretval & 127) {
+ logmsg sprintf("command died with signal %d, and %s coredump.\n",
+ ($versretval & 127), ($versretval & 128)?"a":"no");
+ }
+ else {
+ logmsg sprintf("command exited with value %d \n", $versretval >> 8);
+ }
+ logmsg "contents of $curlverout: \n";
+ displaylogcontent("$curlverout");
+ logmsg "contents of $curlvererr: \n";
+ displaylogcontent("$curlvererr");
+ die "couldn't get curl's version";
+ }
+
+ if(-r "../lib/curl_config.h") {
+ open(CONF, "<../lib/curl_config.h");
+ while(<CONF>) {
+ if($_ =~ /^\#define HAVE_GETRLIMIT/) {
+ $has_getrlimit = 1;
+ }
+ }
+ close(CONF);
+ }
+
+ if($has_ipv6) {
+ # client has ipv6 support
+
+ # check if the HTTP server has it!
+ my @sws = `server/sws --version`;
+ if($sws[0] =~ /IPv6/) {
+ # HTTP server has ipv6 support!
+ $http_ipv6 = 1;
+ $gopher_ipv6 = 1;
+ }
+
+ # check if the FTP server has it!
+ @sws = `server/sockfilt --version`;
+ if($sws[0] =~ /IPv6/) {
+ # FTP server has ipv6 support!
+ $ftp_ipv6 = 1;
+ }
+ }
+
+ if(!$curl_debug && $torture) {
+ die "can't run torture tests since curl was not built with curldebug";
+ }
+
+ $has_shared = `sh $CURLCONFIG --built-shared`;
+ chomp $has_shared;
+
+ # curl doesn't list cryptographic support separately, so assume it's
+ # always available
+ $has_crypto=1;
+
+ my $hostname=join(' ', runclientoutput("hostname"));
+ my $hosttype=join(' ', runclientoutput("uname -a"));
+
+ logmsg ("********* System characteristics ******** \n",
+ "* $curl\n",
+ "* $libcurl\n",
+ "* Features: $feat\n",
+ "* Host: $hostname",
+ "* System: $hosttype");
+
+ logmsg sprintf("* Server SSL: %8s", $stunnel?"ON ":"OFF");
+ logmsg sprintf(" libcurl SSL: %s\n", $ssl_version?"ON ":"OFF");
+ logmsg sprintf("* debug build: %8s", $debug_build?"ON ":"OFF");
+ logmsg sprintf(" track memory: %s\n", $curl_debug?"ON ":"OFF");
+ logmsg sprintf("* valgrind: %8s", $valgrind?"ON ":"OFF");
+ logmsg sprintf(" HTTP IPv6 %s\n", $http_ipv6?"ON ":"OFF");
+ logmsg sprintf("* FTP IPv6 %8s", $ftp_ipv6?"ON ":"OFF");
+ logmsg sprintf(" Libtool lib: %s\n", $libtool?"ON ":"OFF");
+ logmsg sprintf("* Shared build: %s\n", $has_shared);
+ if($ssl_version) {
+ logmsg sprintf("* SSL library: %13s\n", $ssllib);
+ }
+
+ logmsg "* Ports:\n";
+
+ logmsg sprintf("* HTTP/%d ", $HTTPPORT);
+ logmsg sprintf("FTP/%d ", $FTPPORT);
+ logmsg sprintf("FTP2/%d ", $FTP2PORT);
+ logmsg sprintf("RTSP/%d ", $RTSPPORT);
+ if($stunnel) {
+ logmsg sprintf("FTPS/%d ", $FTPSPORT);
+ logmsg sprintf("HTTPS/%d ", $HTTPSPORT);
+ }
+ logmsg sprintf("\n* TFTP/%d ", $TFTPPORT);
+ if($http_ipv6) {
+ logmsg sprintf("HTTP-IPv6/%d ", $HTTP6PORT);
+ logmsg sprintf("RTSP-IPv6/%d ", $RTSP6PORT);
+ }
+ if($ftp_ipv6) {
+ logmsg sprintf("FTP-IPv6/%d ", $FTP6PORT);
+ }
+ if($tftp_ipv6) {
+ logmsg sprintf("TFTP-IPv6/%d ", $TFTP6PORT);
+ }
+ logmsg sprintf("\n* GOPHER/%d ", $GOPHERPORT);
+ if($gopher_ipv6) {
+ logmsg sprintf("GOPHER-IPv6/%d", $GOPHERPORT);
+ }
+ logmsg sprintf("\n* SSH/%d ", $SSHPORT);
+ logmsg sprintf("SOCKS/%d ", $SOCKSPORT);
+ logmsg sprintf("POP3/%d ", $POP3PORT);
+ logmsg sprintf("IMAP/%d ", $IMAPPORT);
+ logmsg sprintf("SMTP/%d\n", $SMTPPORT);
+ if($ftp_ipv6) {
+ logmsg sprintf("* POP3-IPv6/%d ", $POP36PORT);
+ logmsg sprintf("IMAP-IPv6/%d ", $IMAP6PORT);
+ logmsg sprintf("SMTP-IPv6/%d\n", $SMTP6PORT);
+ }
+
+ $has_textaware = ($^O eq 'MSWin32') || ($^O eq 'msys');
+
+ logmsg "***************************************** \n";
+}
+
+#######################################################################
+# substitute the variable stuff into either a joined up file or
+# a command, in either case passed by reference
+#
+sub subVariables {
+ my ($thing) = @_;
+ $$thing =~ s/%HOSTIP/$HOSTIP/g;
+ $$thing =~ s/%HTTPPORT/$HTTPPORT/g;
+ $$thing =~ s/%HOST6IP/$HOST6IP/g;
+ $$thing =~ s/%HTTP6PORT/$HTTP6PORT/g;
+ $$thing =~ s/%HTTPSPORT/$HTTPSPORT/g;
+ $$thing =~ s/%FTPPORT/$FTPPORT/g;
+ $$thing =~ s/%FTP6PORT/$FTP6PORT/g;
+ $$thing =~ s/%FTP2PORT/$FTP2PORT/g;
+ $$thing =~ s/%FTPSPORT/$FTPSPORT/g;
+ $$thing =~ s/%SRCDIR/$srcdir/g;
+ $$thing =~ s/%PWD/$pwd/g;
+ $$thing =~ s/%TFTPPORT/$TFTPPORT/g;
+ $$thing =~ s/%TFTP6PORT/$TFTP6PORT/g;
+ $$thing =~ s/%SSHPORT/$SSHPORT/g;
+ $$thing =~ s/%SOCKSPORT/$SOCKSPORT/g;
+ $$thing =~ s/%POP3PORT/$POP3PORT/g;
+ $$thing =~ s/%POP36PORT/$POP36PORT/g;
+ $$thing =~ s/%IMAPPORT/$IMAPPORT/g;
+ $$thing =~ s/%IMAP6PORT/$IMAP6PORT/g;
+ $$thing =~ s/%SMTPPORT/$SMTPPORT/g;
+ $$thing =~ s/%SMTP6PORT/$SMTP6PORT/g;
+ $$thing =~ s/%CURL/$CURL/g;
+ $$thing =~ s/%USER/$USER/g;
+ $$thing =~ s/%CLIENTIP/$CLIENTIP/g;
+ $$thing =~ s/%CLIENT6IP/$CLIENT6IP/g;
+ $$thing =~ s/%RTSPPORT/$RTSPPORT/g;
+ $$thing =~ s/%RTSP6PORT/$RTSP6PORT/g;
+ $$thing =~ s/%GOPHERPORT/$GOPHERPORT/g;
+ $$thing =~ s/%GOPHER6PORT/$GOPHER6PORT/g;
+
+ # The purpose of FTPTIME2 and FTPTIME3 is to provide times that can be
+ # used for time-out tests and that whould work on most hosts as these
+ # adjust for the startup/check time for this particular host. We needed
+ # to do this to make the test suite run better on very slow hosts.
+
+ my $ftp2 = $ftpchecktime * 2;
+ my $ftp3 = $ftpchecktime * 3;
+
+ $$thing =~ s/%FTPTIME2/$ftp2/g;
+ $$thing =~ s/%FTPTIME3/$ftp3/g;
+}
+
+sub fixarray {
+ my @in = @_;
+
+ for(@in) {
+ subVariables \$_;
+ }
+ return @in;
+}
+
+#######################################################################
+# Provide time stamps for single test skipped events
+#
+sub timestampskippedevents {
+ my $testnum = $_[0];
+
+ return if((not defined($testnum)) || ($testnum < 1));
+
+ if($timestats) {
+
+ if($timevrfyend{$testnum}) {
+ return;
+ }
+ elsif($timesrvrlog{$testnum}) {
+ $timevrfyend{$testnum} = $timesrvrlog{$testnum};
+ return;
+ }
+ elsif($timetoolend{$testnum}) {
+ $timevrfyend{$testnum} = $timetoolend{$testnum};
+ $timesrvrlog{$testnum} = $timetoolend{$testnum};
+ }
+ elsif($timetoolini{$testnum}) {
+ $timevrfyend{$testnum} = $timetoolini{$testnum};
+ $timesrvrlog{$testnum} = $timetoolini{$testnum};
+ $timetoolend{$testnum} = $timetoolini{$testnum};
+ }
+ elsif($timesrvrend{$testnum}) {
+ $timevrfyend{$testnum} = $timesrvrend{$testnum};
+ $timesrvrlog{$testnum} = $timesrvrend{$testnum};
+ $timetoolend{$testnum} = $timesrvrend{$testnum};
+ $timetoolini{$testnum} = $timesrvrend{$testnum};
+ }
+ elsif($timesrvrini{$testnum}) {
+ $timevrfyend{$testnum} = $timesrvrini{$testnum};
+ $timesrvrlog{$testnum} = $timesrvrini{$testnum};
+ $timetoolend{$testnum} = $timesrvrini{$testnum};
+ $timetoolini{$testnum} = $timesrvrini{$testnum};
+ $timesrvrend{$testnum} = $timesrvrini{$testnum};
+ }
+ elsif($timeprepini{$testnum}) {
+ $timevrfyend{$testnum} = $timeprepini{$testnum};
+ $timesrvrlog{$testnum} = $timeprepini{$testnum};
+ $timetoolend{$testnum} = $timeprepini{$testnum};
+ $timetoolini{$testnum} = $timeprepini{$testnum};
+ $timesrvrend{$testnum} = $timeprepini{$testnum};
+ $timesrvrini{$testnum} = $timeprepini{$testnum};
+ }
+ }
+}
+
+#######################################################################
+# Run a single specified test case
+#
+sub singletest {
+ my ($testnum, $count, $total)=@_;
+
+ my @what;
+ my $why;
+ my %feature;
+ my $cmd;
+ my $disablevalgrind;
+
+ # copy test number to a global scope var, this allows
+ # testnum checking when starting test harness servers.
+ $testnumcheck = $testnum;
+
+ # timestamp test preparation start
+ $timeprepini{$testnum} = Time::HiRes::time() if($timestats);
+
+ if($disttests !~ /test$testnum\W/ ) {
+ logmsg "Warning: test$testnum not present in tests/data/Makefile.am\n";
+ }
+
+ # load the test case file definition
+ if(loadtest("${TESTDIR}/test${testnum}")) {
+ if($verbose) {
+ # this is not a test
+ logmsg "RUN: $testnum doesn't look like a test case\n";
+ }
+ $why = "no test";
+ }
+ else {
+ @what = getpart("client", "features");
+ }
+
+ for(@what) {
+ my $f = $_;
+ $f =~ s/\s//g;
+
+ $feature{$f}=$f; # we require this feature
+
+ if($f eq "SSL") {
+ if($ssl_version) {
+ next;
+ }
+ }
+ elsif($f eq "OpenSSL") {
+ if($has_openssl) {
+ next;
+ }
+ }
+ elsif($f eq "GnuTLS") {
+ if($has_gnutls) {
+ next;
+ }
+ }
+ elsif($f eq "NSS") {
+ if($has_nss) {
+ next;
+ }
+ }
+ elsif($f eq "netrc_debug") {
+ if($debug_build) {
+ next;
+ }
+ }
+ elsif($f eq "large_file") {
+ if($large_file) {
+ next;
+ }
+ }
+ elsif($f eq "idn") {
+ if($has_idn) {
+ next;
+ }
+ }
+ elsif($f eq "ipv6") {
+ if($has_ipv6) {
+ next;
+ }
+ }
+ elsif($f eq "libz") {
+ if($has_libz) {
+ next;
+ }
+ }
+ elsif($f eq "NTLM") {
+ if($has_ntlm) {
+ next;
+ }
+ }
+ elsif($f eq "getrlimit") {
+ if($has_getrlimit) {
+ next;
+ }
+ }
+ elsif($f eq "crypto") {
+ if($has_crypto) {
+ next;
+ }
+ }
+ elsif($f eq "socks") {
+ next;
+ }
+ # See if this "feature" is in the list of supported protocols
+ elsif (grep /^$f$/, @protocols) {
+ next;
+ }
+
+ $why = "curl lacks $f support";
+ last;
+ }
+
+ if(!$why) {
+ my @keywords = getpart("info", "keywords");
+ my $match;
+ my $k;
+ for $k (@keywords) {
+ chomp $k;
+ if ($disabled_keywords{$k}) {
+ $why = "disabled by keyword";
+ } elsif ($enabled_keywords{$k}) {
+ $match = 1;
+ }
+ }
+
+ if(!$why && !$match && %enabled_keywords) {
+ $why = "disabled by missing keyword";
+ }
+ }
+
+ # test definition may instruct to (un)set environment vars
+ # this is done this early, so that the precheck can use environment
+ # variables and still bail out fine on errors
+
+ # restore environment variables that were modified in a previous run
+ foreach my $var (keys %oldenv) {
+ if($oldenv{$var} eq 'notset') {
+ delete $ENV{$var} if($ENV{$var});
+ }
+ else {
+ $ENV{$var} = $oldenv{$var};
+ }
+ delete $oldenv{$var};
+ }
+
+ # timestamp required servers verification start
+ $timesrvrini{$testnum} = Time::HiRes::time() if($timestats);
+
+ if(!$why) {
+ $why = serverfortest($testnum);
+ }
+
+ # timestamp required servers verification end
+ $timesrvrend{$testnum} = Time::HiRes::time() if($timestats);
+
+ my @setenv = getpart("client", "setenv");
+ if(@setenv) {
+ foreach my $s (@setenv) {
+ chomp $s;
+ subVariables \$s;
+ if($s =~ /([^=]*)=(.*)/) {
+ my ($var, $content) = ($1, $2);
+ # remember current setting, to restore it once test runs
+ $oldenv{$var} = ($ENV{$var})?"$ENV{$var}":'notset';
+ # set new value
+ if(!$content) {
+ delete $ENV{$var} if($ENV{$var});
+ }
+ else {
+ if(($var =~ /^LD_PRELOAD/) &&
+ ($debug_build || ($has_shared ne "yes"))) {
+ # print "Skipping LD_PRELOAD due to no release shared build\n";
+ next;
+ }
+ $ENV{$var} = "$content";
+ }
+ }
+ }
+ }
+
+ if(!$why) {
+ # TODO:
+ # Add a precheck cache. If a precheck command was already invoked
+ # exactly like this, then use the previous result to speed up
+ # successive test invokes!
+
+ my @precheck = getpart("client", "precheck");
+ if(@precheck) {
+ $cmd = $precheck[0];
+ chomp $cmd;
+ subVariables \$cmd;
+ if($cmd) {
+ my @p = split(/ /, $cmd);
+ if($p[0] !~ /\//) {
+ # the first word, the command, does not contain a slash so
+ # we will scan the "improved" PATH to find the command to
+ # be able to run it
+ my $fullp = checktestcmd($p[0]);
+
+ if($fullp) {
+ $p[0] = $fullp;
+ }
+ $cmd = join(" ", @p);
+ }
+
+ my @o = `$cmd 2>/dev/null`;
+ if($o[0]) {
+ $why = $o[0];
+ chomp $why;
+ } elsif($?) {
+ $why = "precheck command error";
+ }
+ logmsg "prechecked $cmd\n" if($verbose);
+ }
+ }
+ }
+
+ if($why && !$listonly) {
+ # there's a problem, count it as "skipped"
+ $skipped++;
+ $skipped{$why}++;
+ $teststat[$testnum]=$why; # store reason for this test case
+
+ if(!$short) {
+ printf "test %03d SKIPPED: $why\n", $testnum;
+ }
+
+ timestampskippedevents($testnum);
+ return -1;
+ }
+ logmsg sprintf("test %03d...", $testnum);
+
+ # extract the reply data
+ my @reply = getpart("reply", "data");
+ my @replycheck = getpart("reply", "datacheck");
+
+ if (@replycheck) {
+ # we use this file instead to check the final output against
+
+ my %hash = getpartattr("reply", "datacheck");
+ if($hash{'nonewline'}) {
+ # Yes, we must cut off the final newline from the final line
+ # of the datacheck
+ chomp($replycheck[$#replycheck]);
+ }
+
+ @reply=@replycheck;
+ }
+
+ # this is the valid protocol blurb curl should generate
+ my @protocol= fixarray ( getpart("verify", "protocol") );
+
+ # redirected stdout/stderr to these files
+ $STDOUT="$LOGDIR/stdout$testnum";
+ $STDERR="$LOGDIR/stderr$testnum";
+
+ # if this section exists, we verify that the stdout contained this:
+ my @validstdout = fixarray ( getpart("verify", "stdout") );
+
+ # if this section exists, we verify upload
+ my @upload = getpart("verify", "upload");
+
+ # if this section exists, it might be FTP server instructions:
+ my @ftpservercmd = getpart("reply", "servercmd");
+
+ my $CURLOUT="$LOGDIR/curl$testnum.out"; # curl output if not stdout
+
+ # name of the test
+ my @testname= getpart("client", "name");
+
+ if(!$short) {
+ my $name = $testname[0];
+ $name =~ s/\n//g;
+ logmsg "[$name]\n";
+ }
+
+ if($listonly) {
+ timestampskippedevents($testnum);
+ return 0; # look successful
+ }
+
+ my @codepieces = getpart("client", "tool");
+
+ my $tool="";
+ if(@codepieces) {
+ $tool = $codepieces[0];
+ chomp $tool;
+ }
+
+ # remove server output logfiles
+ unlink($SERVERIN);
+ unlink($SERVER2IN);
+
+ if(@ftpservercmd) {
+ # write the instructions to file
+ writearray($FTPDCMD, \@ftpservercmd);
+ }
+
+ # get the command line options to use
+ my @blaha;
+ ($cmd, @blaha)= getpart("client", "command");
+
+ if($cmd) {
+ # make some nice replace operations
+ $cmd =~ s/\n//g; # no newlines please
+ # substitute variables in the command line
+ subVariables \$cmd;
+ }
+ if($curl_debug) {
+ unlink($memdump);
+ }
+
+ # create a (possibly-empty) file before starting the test
+ my @inputfile=getpart("client", "file");
+ my %fileattr = getpartattr("client", "file");
+ my $filename=$fileattr{'name'};
+ if(@inputfile || $filename) {
+ if(!$filename) {
+ logmsg "ERROR: section client=>file has no name attribute\n";
+ timestampskippedevents($testnum);
+ return -1;
+ }
+ my $fileContent = join('', @inputfile);
+ subVariables \$fileContent;
+# logmsg "DEBUG: writing file " . $filename . "\n";
+ open(OUTFILE, ">$filename");
+ binmode OUTFILE; # for crapage systems, use binary
+ print OUTFILE $fileContent;
+ close(OUTFILE);
+ }
+
+ my %cmdhash = getpartattr("client", "command");
+
+ my $out="";
+
+ if((!$cmdhash{'option'}) || ($cmdhash{'option'} !~ /no-output/)) {
+ #We may slap on --output!
+ if (!@validstdout) {
+ $out=" --output $CURLOUT ";
+ }
+ }
+
+ my $serverlogslocktimeout = $defserverlogslocktimeout;
+ if($cmdhash{'timeout'}) {
+ # test is allowed to override default server logs lock timeout
+ if($cmdhash{'timeout'} =~ /(\d+)/) {
+ $serverlogslocktimeout = $1 if($1 >= 0);
+ }
+ }
+
+ my $postcommanddelay = $defpostcommanddelay;
+ if($cmdhash{'delay'}) {
+ # test is allowed to specify a delay after command is executed
+ if($cmdhash{'delay'} =~ /(\d+)/) {
+ $postcommanddelay = $1 if($1 > 0);
+ }
+ }
+
+ my $CMDLINE;
+ my $cmdargs;
+ my $cmdtype = $cmdhash{'type'} || "default";
+ if($cmdtype eq "perl") {
+ # run the command line prepended with "perl"
+ $cmdargs ="$cmd";
+ $CMDLINE = "perl ";
+ $tool=$CMDLINE;
+ $disablevalgrind=1;
+ }
+ elsif(!$tool) {
+ # run curl, add --verbose for debug information output
+ $cmdargs ="$out --include --verbose --trace-time $cmd";
+ }
+ else {
+ $cmdargs = " $cmd"; # $cmd is the command line for the test file
+ $CURLOUT = $STDOUT; # sends received data to stdout
+
+ $CMDLINE="$LIBDIR/$tool";
+ if(! -f $CMDLINE) {
+ print "The tool set in the test case for this: '$tool' does not exist\n";
+ timestampskippedevents($testnum);
+ return -1;
+ }
+ $DBGCURL=$CMDLINE;
+ }
+
+ my @stdintest = getpart("client", "stdin");
+
+ if(@stdintest) {
+ my $stdinfile="$LOGDIR/stdin-for-$testnum";
+ writearray($stdinfile, \@stdintest);
+
+ $cmdargs .= " <$stdinfile";
+ }
+
+ if(!$tool) {
+ $CMDLINE="$CURL";
+ }
+
+ my $usevalgrind;
+ if($valgrind && !$disablevalgrind) {
+ my @valgrindoption = getpart("verify", "valgrind");
+ if((!@valgrindoption) || ($valgrindoption[0] !~ /disable/)) {
+ $usevalgrind = 1;
+ my $valgrindcmd = "$valgrind ";
+ $valgrindcmd .= "$valgrind_tool " if($valgrind_tool);
+ $valgrindcmd .= "--leak-check=yes ";
+ $valgrindcmd .= "--num-callers=16 ";
+ $valgrindcmd .= "${valgrind_logfile}=$LOGDIR/valgrind$testnum";
+ $CMDLINE = "$valgrindcmd $CMDLINE";
+ }
+ }
+
+ $CMDLINE .= "$cmdargs >$STDOUT 2>$STDERR";
+
+ if($verbose) {
+ logmsg "$CMDLINE\n";
+ }
+
+ print CMDLOG "$CMDLINE\n";
+
+ unlink("core");
+
+ my $dumped_core;
+ my $cmdres;
+
+ # Apr 2007: precommand isn't being used and could be removed
+ my @precommand= getpart("client", "precommand");
+ if($precommand[0]) {
+ # this is pure perl to eval!
+ my $code = join("", @precommand);
+ eval $code;
+ if($@) {
+ logmsg "perl: $code\n";
+ logmsg "precommand: $@";
+ stopservers($verbose);
+ timestampskippedevents($testnum);
+ return -1;
+ }
+ }
+
+ if($gdbthis) {
+ my $gdbinit = "$TESTDIR/gdbinit$testnum";
+ open(GDBCMD, ">$LOGDIR/gdbcmd");
+ print GDBCMD "set args $cmdargs\n";
+ print GDBCMD "show args\n";
+ print GDBCMD "source $gdbinit\n" if -e $gdbinit;
+ close(GDBCMD);
+ }
+
+ # timestamp starting of test command
+ $timetoolini{$testnum} = Time::HiRes::time() if($timestats);
+
+ # run the command line we built
+ if ($torture) {
+ $cmdres = torture($CMDLINE,
+ "libtool --mode=execute gdb --directory libtest $DBGCURL -x $LOGDIR/gdbcmd");
+ }
+ elsif($gdbthis) {
+ runclient("libtool --mode=execute gdb --directory libtest $DBGCURL -x $LOGDIR/gdbcmd");
+ $cmdres=0; # makes it always continue after a debugged run
+ }
+ else {
+ $cmdres = runclient("$CMDLINE");
+ my $signal_num = $cmdres & 127;
+ $dumped_core = $cmdres & 128;
+
+ if(!$anyway && ($signal_num || $dumped_core)) {
+ $cmdres = 1000;
+ }
+ else {
+ $cmdres >>= 8;
+ $cmdres = (2000 + $signal_num) if($signal_num && !$cmdres);
+ }
+ }
+
+ # timestamp finishing of test command
+ $timetoolend{$testnum} = Time::HiRes::time() if($timestats);
+
+ if(!$dumped_core) {
+ if(-r "core") {
+ # there's core file present now!
+ $dumped_core = 1;
+ }
+ }
+
+ if($dumped_core) {
+ logmsg "core dumped\n";
+ if(0 && $gdb) {
+ logmsg "running gdb for post-mortem analysis:\n";
+ open(GDBCMD, ">$LOGDIR/gdbcmd2");
+ print GDBCMD "bt\n";
+ close(GDBCMD);
+ runclient("libtool --mode=execute gdb --directory libtest -x $LOGDIR/gdbcmd2 -batch $DBGCURL core ");
+ # unlink("$LOGDIR/gdbcmd2");
+ }
+ }
+
+ # If a server logs advisor read lock file exists, it is an indication
+ # that the server has not yet finished writing out all its log files,
+ # including server request log files used for protocol verification.
+ # So, if the lock file exists the script waits here a certain amount
+ # of time until the server removes it, or the given time expires.
+
+ if($serverlogslocktimeout) {
+ my $lockretry = $serverlogslocktimeout * 20;
+ while((-f $SERVERLOGS_LOCK) && $lockretry--) {
+ select(undef, undef, undef, 0.05);
+ }
+ if(($lockretry < 0) &&
+ ($serverlogslocktimeout >= $defserverlogslocktimeout)) {
+ logmsg "Warning: server logs lock timeout ",
+ "($serverlogslocktimeout seconds) expired\n";
+ }
+ }
+
+ # Test harness ssh server does not have this synchronization mechanism,
+ # this implies that some ssh server based tests might need a small delay
+ # once that the client command has run to avoid false test failures.
+
+ sleep($postcommanddelay) if($postcommanddelay);
+
+ # timestamp removal of server logs advisor read lock
+ $timesrvrlog{$testnum} = Time::HiRes::time() if($timestats);
+
+ # test definition might instruct to stop some servers
+ # stop also all servers relative to the given one
+
+ my @killtestservers = getpart("client", "killserver");
+ if(@killtestservers) {
+ #
+ # All servers relative to the given one must be stopped also
+ #
+ my @killservers;
+ foreach my $server (@killtestservers) {
+ chomp $server;
+ if($server =~ /^(ftp|http|imap|pop3|smtp)s(.*)$/) {
+ # given an ssl server, also kill non-ssl underlying one
+ push @killservers, "${1}${2}";
+ }
+ elsif($server =~ /^(ftp|http|imap|pop3|smtp)(.*)$/) {
+ # given a non-ssl server, also kill ssl piggybacking one
+ push @killservers, "${1}s${2}";
+ }
+ elsif($server =~ /^(socks)(.*)$/) {
+ # given an socks server, also kill ssh underlying one
+ push @killservers, "ssh${2}";
+ }
+ elsif($server =~ /^(ssh)(.*)$/) {
+ # given an ssh server, also kill socks piggybacking one
+ push @killservers, "socks${2}";
+ }
+ push @killservers, $server;
+ }
+ #
+ # kill sockfilter processes for pingpong relative servers
+ #
+ foreach my $server (@killservers) {
+ if($server =~ /^(ftp|imap|pop3|smtp)s?(\d*)(-ipv6|)$/) {
+ my $proto = $1;
+ my $idnum = ($2 && ($2 > 1)) ? $2 : 1;
+ my $ipvnum = ($3 && ($3 =~ /6$/)) ? 6 : 4;
+ killsockfilters($proto, $ipvnum, $idnum, $verbose);
+ }
+ }
+ #
+ # kill server relative pids clearing them in %run hash
+ #
+ my $pidlist;
+ foreach my $server (@killservers) {
+ if($run{$server}) {
+ $pidlist .= "$run{$server} ";
+ $run{$server} = 0;
+ }
+ $runcert{$server} = 0 if($runcert{$server});
+ }
+ killpid($verbose, $pidlist);
+ #
+ # cleanup server pid files
+ #
+ foreach my $server (@killservers) {
+ my $pidfile = $serverpidfile{$server};
+ my $pid = processexists($pidfile);
+ if($pid > 0) {
+ logmsg "Warning: $server server unexpectedly alive\n";
+ killpid($verbose, $pid);
+ }
+ unlink($pidfile) if(-f $pidfile);
+ }
+ }
+
+ # remove the test server commands file after each test
+ unlink($FTPDCMD);
+
+ # run the postcheck command
+ my @postcheck= getpart("client", "postcheck");
+ if(@postcheck) {
+ $cmd = $postcheck[0];
+ chomp $cmd;
+ subVariables \$cmd;
+ if($cmd) {
+ logmsg "postcheck $cmd\n" if($verbose);
+ my $rc = runclient("$cmd");
+ # Must run the postcheck command in torture mode in order
+ # to clean up, but the result can't be relied upon.
+ if($rc != 0 && !$torture) {
+ logmsg " postcheck FAILED\n";
+ # timestamp test result verification end
+ $timevrfyend{$testnum} = Time::HiRes::time() if($timestats);
+ return 1;
+ }
+ }
+ }
+
+ # restore environment variables that were modified
+ if(%oldenv) {
+ foreach my $var (keys %oldenv) {
+ if($oldenv{$var} eq 'notset') {
+ delete $ENV{$var} if($ENV{$var});
+ }
+ else {
+ $ENV{$var} = "$oldenv{$var}";
+ }
+ }
+ }
+
+ # Skip all the verification on torture tests
+ if ($torture) {
+ if(!$cmdres && !$keepoutfiles) {
+ cleardir($LOGDIR);
+ }
+ # timestamp test result verification end
+ $timevrfyend{$testnum} = Time::HiRes::time() if($timestats);
+ return $cmdres;
+ }
+
+ my @err = getpart("verify", "errorcode");
+ my $errorcode = $err[0] || "0";
+ my $ok="";
+ my $res;
+ if (@validstdout) {
+ # verify redirected stdout
+ my @actual = loadarray($STDOUT);
+
+ # variable-replace in the stdout we have from the test case file
+ @validstdout = fixarray(@validstdout);
+
+ # get all attributes
+ my %hash = getpartattr("verify", "stdout");
+
+ # get the mode attribute
+ my $filemode=$hash{'mode'};
+ if($filemode && ($filemode eq "text") && $has_textaware) {
+ # text mode when running on windows: fix line endings
+ map s/\r\n/\n/g, @actual;
+ }
+
+ if($hash{'nonewline'}) {
+ # Yes, we must cut off the final newline from the final line
+ # of the protocol data
+ chomp($validstdout[$#validstdout]);
+ }
+
+ $res = compare("stdout", \@actual, \@validstdout);
+ if($res) {
+ # timestamp test result verification end
+ $timevrfyend{$testnum} = Time::HiRes::time() if($timestats);
+ return 1;
+ }
+ $ok .= "s";
+ }
+ else {
+ $ok .= "-"; # stdout not checked
+ }
+
+ my %replyattr = getpartattr("reply", "data");
+ if(!$replyattr{'nocheck'} && (@reply || $replyattr{'sendzero'})) {
+ # verify the received data
+ my @out = loadarray($CURLOUT);
+ my %hash = getpartattr("reply", "data");
+ # get the mode attribute
+ my $filemode=$hash{'mode'};
+ if($filemode && ($filemode eq "text") && $has_textaware) {
+ # text mode when running on windows: fix line endings
+ map s/\r\n/\n/g, @out;
+ }
+
+ $res = compare("data", \@out, \@reply);
+ if ($res) {
+ # timestamp test result verification end
+ $timevrfyend{$testnum} = Time::HiRes::time() if($timestats);
+ return 1;
+ }
+ $ok .= "d";
+ }
+ else {
+ $ok .= "-"; # data not checked
+ }
+
+ if(@upload) {
+ # verify uploaded data
+ my @out = loadarray("$LOGDIR/upload.$testnum");
+ $res = compare("upload", \@out, \@upload);
+ if ($res) {
+ # timestamp test result verification end
+ $timevrfyend{$testnum} = Time::HiRes::time() if($timestats);
+ return 1;
+ }
+ $ok .= "u";
+ }
+ else {
+ $ok .= "-"; # upload not checked
+ }
+
+ if(@protocol) {
+ # Verify the sent request
+ my @out = loadarray($SERVERIN);
+
+ # what to cut off from the live protocol sent by curl
+ my @strip = getpart("verify", "strip");
+
+ my @protstrip=@protocol;
+
+ # check if there's any attributes on the verify/protocol section
+ my %hash = getpartattr("verify", "protocol");
+
+ if($hash{'nonewline'}) {
+ # Yes, we must cut off the final newline from the final line
+ # of the protocol data
+ chomp($protstrip[$#protstrip]);
+ }
+
+ for(@strip) {
+ # strip off all lines that match the patterns from both arrays
+ chomp $_;
+ @out = striparray( $_, \@out);
+ @protstrip= striparray( $_, \@protstrip);
+ }
+
+ # what parts to cut off from the protocol
+ my @strippart = getpart("verify", "strippart");
+ my $strip;
+ for $strip (@strippart) {
+ chomp $strip;
+ for(@out) {
+ eval $strip;
+ }
+ }
+
+ $res = compare("protocol", \@out, \@protstrip);
+ if($res) {
+ # timestamp test result verification end
+ $timevrfyend{$testnum} = Time::HiRes::time() if($timestats);
+ return 1;
+ }
+
+ $ok .= "p";
+
+ }
+ else {
+ $ok .= "-"; # protocol not checked
+ }
+
+ my @outfile=getpart("verify", "file");
+ if(@outfile) {
+ # we're supposed to verify a dynamically generated file!
+ my %hash = getpartattr("verify", "file");
+
+ my $filename=$hash{'name'};
+ if(!$filename) {
+ logmsg "ERROR: section verify=>file has no name attribute\n";
+ stopservers($verbose);
+ # timestamp test result verification end
+ $timevrfyend{$testnum} = Time::HiRes::time() if($timestats);
+ return -1;
+ }
+ my @generated=loadarray($filename);
+
+ # what parts to cut off from the file
+ my @stripfile = getpart("verify", "stripfile");
+
+ my $filemode=$hash{'mode'};
+ if($filemode && ($filemode eq "text") && $has_textaware) {
+ # text mode when running on windows means adding an extra
+ # strip expression
+ push @stripfile, "s/\r\n/\n/";
+ }
+
+ my $strip;
+ for $strip (@stripfile) {
+ chomp $strip;
+ for(@generated) {
+ eval $strip;
+ }
+ }
+
+ @outfile = fixarray(@outfile);
+
+ $res = compare("output", \@generated, \@outfile);
+ if($res) {
+ # timestamp test result verification end
+ $timevrfyend{$testnum} = Time::HiRes::time() if($timestats);
+ return 1;
+ }
+
+ $ok .= "o";
+ }
+ else {
+ $ok .= "-"; # output not checked
+ }
+
+ # accept multiple comma-separated error codes
+ my @splerr = split(/ *, */, $errorcode);
+ my $errok;
+ foreach my $e (@splerr) {
+ if($e == $cmdres) {
+ # a fine error code
+ $errok = 1;
+ last;
+ }
+ }
+
+ if($errok) {
+ $ok .= "e";
+ }
+ else {
+ if(!$short) {
+ printf("\n%s returned $cmdres, %d was expected\n",
+ (!$tool)?"curl":$tool, $errorcode);
+ }
+ logmsg " exit FAILED\n";
+ # timestamp test result verification end
+ $timevrfyend{$testnum} = Time::HiRes::time() if($timestats);
+ return 1;
+ }
+
+ if($curl_debug) {
+ if(! -f $memdump) {
+ logmsg "\n** ALERT! memory debugging with no output file?\n"
+ if(!$cmdtype eq "perl");
+ }
+ else {
+ my @memdata=`$memanalyze $memdump`;
+ my $leak=0;
+ for(@memdata) {
+ if($_ ne "") {
+ # well it could be other memory problems as well, but
+ # we call it leak for short here
+ $leak=1;
+ }
+ }
+ if($leak) {
+ logmsg "\n** MEMORY FAILURE\n";
+ logmsg @memdata;
+ # timestamp test result verification end
+ $timevrfyend{$testnum} = Time::HiRes::time() if($timestats);
+ return 1;
+ }
+ else {
+ $ok .= "m";
+ }
+ }
+ }
+ else {
+ $ok .= "-"; # memory not checked
+ }
+
+ if($valgrind) {
+ if($usevalgrind) {
+ unless(opendir(DIR, "$LOGDIR")) {
+ logmsg "ERROR: unable to read $LOGDIR\n";
+ # timestamp test result verification end
+ $timevrfyend{$testnum} = Time::HiRes::time() if($timestats);
+ return 1;
+ }
+ my @files = readdir(DIR);
+ closedir(DIR);
+ my $vgfile;
+ foreach my $file (@files) {
+ if($file =~ /^valgrind$testnum(\..*|)$/) {
+ $vgfile = $file;
+ last;
+ }
+ }
+ if(!$vgfile) {
+ logmsg "ERROR: valgrind log file missing for test $testnum\n";
+ # timestamp test result verification end
+ $timevrfyend{$testnum} = Time::HiRes::time() if($timestats);
+ return 1;
+ }
+ my @e = valgrindparse($srcdir, $feature{'SSL'}, "$LOGDIR/$vgfile");
+ if(@e && $e[0]) {
+ logmsg " valgrind ERROR ";
+ logmsg @e;
+ # timestamp test result verification end
+ $timevrfyend{$testnum} = Time::HiRes::time() if($timestats);
+ return 1;
+ }
+ $ok .= "v";
+ }
+ else {
+ if(!$short && !$disablevalgrind) {
+ logmsg " valgrind SKIPPED\n";
+ }
+ $ok .= "-"; # skipped
+ }
+ }
+ else {
+ $ok .= "-"; # valgrind not checked
+ }
+
+ logmsg "$ok " if(!$short);
+
+ my $sofar= time()-$start;
+ my $esttotal = $sofar/$count * $total;
+ my $estleft = $esttotal - $sofar;
+ my $left=sprintf("remaining: %02d:%02d",
+ $estleft/60,
+ $estleft%60);
+ printf "OK (%-3d out of %-3d, %s)\n", $count, $total, $left;
+
+ # the test succeeded, remove all log files
+ if(!$keepoutfiles) {
+ cleardir($LOGDIR);
+ }
+
+ # timestamp test result verification end
+ $timevrfyend{$testnum} = Time::HiRes::time() if($timestats);
+
+ return 0;
+}
+
+#######################################################################
+# Stop all running test servers
+sub stopservers {
+ my $verbose = $_[0];
+ #
+ # kill sockfilter processes for all pingpong servers
+ #
+ killallsockfilters($verbose);
+ #
+ # kill all server pids from %run hash clearing them
+ #
+ my $pidlist;
+ foreach my $server (keys %run) {
+ if($run{$server}) {
+ if($verbose) {
+ my $prev = 0;
+ my $pids = $run{$server};
+ foreach my $pid (split(' ', $pids)) {
+ if($pid != $prev) {
+ logmsg sprintf("* kill pid for %s => %d\n",
+ $server, $pid);
+ $prev = $pid;
+ }
+ }
+ }
+ $pidlist .= "$run{$server} ";
+ $run{$server} = 0;
+ }
+ $runcert{$server} = 0 if($runcert{$server});
+ }
+ killpid($verbose, $pidlist);
+ #
+ # cleanup all server pid files
+ #
+ foreach my $server (keys %serverpidfile) {
+ my $pidfile = $serverpidfile{$server};
+ my $pid = processexists($pidfile);
+ if($pid > 0) {
+ logmsg "Warning: $server server unexpectedly alive\n";
+ killpid($verbose, $pid);
+ }
+ unlink($pidfile) if(-f $pidfile);
+ }
+}
+
+#######################################################################
+# startservers() starts all the named servers
+#
+# Returns: string with error reason or blank for success
+
+sub startservers {
+ my @what = @_;
+ my ($pid, $pid2);
+ for(@what) {
+ my (@whatlist) = split(/\s+/,$_);
+ my $what = lc($whatlist[0]);
+ $what =~ s/[^a-z0-9-]//g;
+
+ my $certfile;
+ if($what =~ /^(ftp|http|imap|pop3|smtp)s(.*)$/) {
+ $certfile = ($whatlist[1]) ? $whatlist[1] : 'stunnel.pem';
+ }
+
+ if(($what eq "pop3") ||
+ ($what eq "ftp") ||
+ ($what eq "imap") ||
+ ($what eq "smtp")) {
+ if(!$run{$what}) {
+ ($pid, $pid2) = runpingpongserver($what, "", $verbose);
+ if($pid <= 0) {
+ return "failed starting ". uc($what) ." server";
+ }
+ printf ("* pid $what => %d %d\n", $pid, $pid2) if($verbose);
+ $run{$what}="$pid $pid2";
+ }
+ }
+ elsif($what eq "ftp2") {
+ if(!$run{'ftp2'}) {
+ ($pid, $pid2) = runpingpongserver("ftp", "2", $verbose);
+ if($pid <= 0) {
+ return "failed starting FTP2 server";
+ }
+ printf ("* pid ftp2 => %d %d\n", $pid, $pid2) if($verbose);
+ $run{'ftp2'}="$pid $pid2";
+ }
+ }
+ elsif($what eq "ftp-ipv6") {
+ if(!$run{'ftp-ipv6'}) {
+ ($pid, $pid2) = runpingpongserver("ftp", "", $verbose, "ipv6");
+ if($pid <= 0) {
+ return "failed starting FTP-IPv6 server";
+ }
+ logmsg sprintf("* pid ftp-ipv6 => %d %d\n", $pid,
+ $pid2) if($verbose);
+ $run{'ftp-ipv6'}="$pid $pid2";
+ }
+ }
+ elsif($what eq "gopher") {
+ if(!$run{'gopher'}) {
+ ($pid, $pid2) = runhttpserver("gopher", $verbose, 0,
+ $GOPHERPORT);
+ if($pid <= 0) {
+ return "failed starting GOPHER server";
+ }
+ printf ("* pid gopher => %d %d\n", $pid, $pid2) if($verbose);
+ $run{'gopher'}="$pid $pid2";
+ }
+ }
+ elsif($what eq "gopher-ipv6") {
+ if(!$run{'gopher-ipv6'}) {
+ ($pid, $pid2) = runhttpserver("gopher", $verbose, "ipv6",
+ $GOPHER6PORT);
+ if($pid <= 0) {
+ return "failed starting GOPHER-IPv6 server";
+ }
+ logmsg sprintf("* pid gopher-ipv6 => %d %d\n", $pid,
+ $pid2) if($verbose);
+ $run{'gopher-ipv6'}="$pid $pid2";
+ }
+ }
+ elsif($what eq "http") {
+ if(!$run{'http'}) {
+ ($pid, $pid2) = runhttpserver("http", $verbose, 0,
+ $HTTPPORT);
+ if($pid <= 0) {
+ return "failed starting HTTP server";
+ }
+ printf ("* pid http => %d %d\n", $pid, $pid2) if($verbose);
+ $run{'http'}="$pid $pid2";
+ }
+ }
+ elsif($what eq "http-ipv6") {
+ if(!$run{'http-ipv6'}) {
+ ($pid, $pid2) = runhttpserver("http", $verbose, "IPv6",
+ $HTTP6PORT);
+ if($pid <= 0) {
+ return "failed starting HTTP-IPv6 server";
+ }
+ logmsg sprintf("* pid http-ipv6 => %d %d\n", $pid, $pid2)
+ if($verbose);
+ $run{'http-ipv6'}="$pid $pid2";
+ }
+ }
+ elsif($what eq "rtsp") {
+ if(!$run{'rtsp'}) {
+ ($pid, $pid2) = runrtspserver($verbose);
+ if($pid <= 0) {
+ return "failed starting RTSP server";
+ }
+ printf ("* pid rtsp => %d %d\n", $pid, $pid2) if($verbose);
+ $run{'rtsp'}="$pid $pid2";
+ }
+ }
+ elsif($what eq "rtsp-ipv6") {
+ if(!$run{'rtsp-ipv6'}) {
+ ($pid, $pid2) = runrtspserver($verbose, "IPv6");
+ if($pid <= 0) {
+ return "failed starting RTSP-IPv6 server";
+ }
+ logmsg sprintf("* pid rtsp-ipv6 => %d %d\n", $pid, $pid2)
+ if($verbose);
+ $run{'rtsp-ipv6'}="$pid $pid2";
+ }
+ }
+
+ elsif($what eq "ftps") {
+ if(!$stunnel) {
+ # we can't run ftps tests without stunnel
+ return "no stunnel";
+ }
+ if(!$ssl_version) {
+ # we can't run ftps tests if libcurl is SSL-less
+ return "curl lacks SSL support";
+ }
+ if($runcert{'ftps'} && ($runcert{'ftps'} ne $certfile)) {
+ # stop server when running and using a different cert
+ stopserver('ftps');
+ }
+ if(!$run{'ftp'}) {
+ ($pid, $pid2) = runpingpongserver("ftp", "", $verbose);
+ if($pid <= 0) {
+ return "failed starting FTP server";
+ }
+ printf ("* pid ftp => %d %d\n", $pid, $pid2) if($verbose);
+ $run{'ftp'}="$pid $pid2";
+ }
+ if(!$run{'ftps'}) {
+ ($pid, $pid2) = runftpsserver($verbose, "", $certfile);
+ if($pid <= 0) {
+ return "failed starting FTPS server (stunnel)";
+ }
+ logmsg sprintf("* pid ftps => %d %d\n", $pid, $pid2)
+ if($verbose);
+ $run{'ftps'}="$pid $pid2";
+ }
+ }
+ elsif($what eq "file") {
+ # we support it but have no server!
+ }
+ elsif($what eq "https") {
+ if(!$stunnel) {
+ # we can't run ftps tests without stunnel
+ return "no stunnel";
+ }
+ if(!$ssl_version) {
+ # we can't run ftps tests if libcurl is SSL-less
+ return "curl lacks SSL support";
+ }
+ if($runcert{'https'} && ($runcert{'https'} ne $certfile)) {
+ # stop server when running and using a different cert
+ stopserver('https');
+ }
+ if(!$run{'http'}) {
+ ($pid, $pid2) = runhttpserver("http", $verbose, 0,
+ $HTTPPORT);
+ if($pid <= 0) {
+ return "failed starting HTTP server";
+ }
+ printf ("* pid http => %d %d\n", $pid, $pid2) if($verbose);
+ $run{'http'}="$pid $pid2";
+ }
+ if(!$run{'https'}) {
+ ($pid, $pid2) = runhttpsserver($verbose, "", $certfile);
+ if($pid <= 0) {
+ return "failed starting HTTPS server (stunnel)";
+ }
+ logmsg sprintf("* pid https => %d %d\n", $pid, $pid2)
+ if($verbose);
+ $run{'https'}="$pid $pid2";
+ }
+ }
+ elsif($what eq "tftp") {
+ if(!$run{'tftp'}) {
+ ($pid, $pid2) = runtftpserver("", $verbose);
+ if($pid <= 0) {
+ return "failed starting TFTP server";
+ }
+ printf ("* pid tftp => %d %d\n", $pid, $pid2) if($verbose);
+ $run{'tftp'}="$pid $pid2";
+ }
+ }
+ elsif($what eq "tftp-ipv6") {
+ if(!$run{'tftp-ipv6'}) {
+ ($pid, $pid2) = runtftpserver("", $verbose, "IPv6");
+ if($pid <= 0) {
+ return "failed starting TFTP-IPv6 server";
+ }
+ printf("* pid tftp-ipv6 => %d %d\n", $pid, $pid2) if($verbose);
+ $run{'tftp-ipv6'}="$pid $pid2";
+ }
+ }
+ elsif($what eq "sftp" || $what eq "scp" || $what eq "socks4" || $what eq "socks5" ) {
+ if(!$run{'ssh'}) {
+ ($pid, $pid2) = runsshserver("", $verbose);
+ if($pid <= 0) {
+ return "failed starting SSH server";
+ }
+ printf ("* pid ssh => %d %d\n", $pid, $pid2) if($verbose);
+ $run{'ssh'}="$pid $pid2";
+ }
+ if($what eq "socks4" || $what eq "socks5") {
+ if(!$run{'socks'}) {
+ ($pid, $pid2) = runsocksserver("", $verbose);
+ if($pid <= 0) {
+ return "failed starting socks server";
+ }
+ printf ("* pid socks => %d %d\n", $pid, $pid2) if($verbose);
+ $run{'socks'}="$pid $pid2";
+ }
+ }
+ if($what eq "socks5") {
+ if(!$sshdid) {
+ # Not an OpenSSH or SunSSH ssh daemon
+ logmsg "Not OpenSSH or SunSSH; socks5 tests need at least OpenSSH 3.7\n";
+ return "failed starting socks5 server";
+ }
+ elsif(($sshdid =~ /OpenSSH/) && ($sshdvernum < 370)) {
+ # Need OpenSSH 3.7 for socks5 - http://www.openssh.com/txt/release-3.7
+ logmsg "$sshdverstr insufficient; socks5 tests need at least OpenSSH 3.7\n";
+ return "failed starting socks5 server";
+ }
+ elsif(($sshdid =~ /SunSSH/) && ($sshdvernum < 100)) {
+ # Need SunSSH 1.0 for socks5
+ logmsg "$sshdverstr insufficient; socks5 tests need at least SunSSH 1.0\n";
+ return "failed starting socks5 server";
+ }
+ }
+ }
+ elsif($what eq "none") {
+ logmsg "* starts no server\n" if ($verbose);
+ }
+ else {
+ warn "we don't support a server for $what";
+ return "no server for $what";
+ }
+ }
+ return 0;
+}
+
+##############################################################################
+# This function makes sure the right set of server is running for the
+# specified test case. This is a useful design when we run single tests as not
+# all servers need to run then!
+#
+# Returns: a string, blank if everything is fine or a reason why it failed
+#
+
+sub serverfortest {
+ my ($testnum)=@_;
+
+ my @what = getpart("client", "server");
+
+ if(!$what[0]) {
+ warn "Test case $testnum has no server(s) specified";
+ return "no server specified";
+ }
+
+ for (@what) {
+ my $proto = lc($_);
+ chomp $proto;
+ $proto =~ s/\s.*//g; # take first word
+ if (! grep /^$proto$/, @protocols) {
+ if (substr($proto,0,5) ne "socks") {
+ return "curl lacks $proto support";
+ }
+ }
+ }
+
+ return &startservers(@what);
+}
+
+#######################################################################
+# runtimestats displays test-suite run time statistics
+#
+sub runtimestats {
+ my $lasttest = $_[0];
+
+ return if(not $timestats);
+
+ logmsg "\nTest suite total running time breakdown per task...\n\n";
+
+ my @timesrvr;
+ my @timeprep;
+ my @timetool;
+ my @timelock;
+ my @timevrfy;
+ my @timetest;
+ my $timesrvrtot = 0.0;
+ my $timepreptot = 0.0;
+ my $timetooltot = 0.0;
+ my $timelocktot = 0.0;
+ my $timevrfytot = 0.0;
+ my $timetesttot = 0.0;
+ my $counter;
+
+ for my $testnum (1 .. $lasttest) {
+ if($timesrvrini{$testnum}) {
+ $timesrvrtot += $timesrvrend{$testnum} - $timesrvrini{$testnum};
+ $timepreptot +=
+ (($timetoolini{$testnum} - $timeprepini{$testnum}) -
+ ($timesrvrend{$testnum} - $timesrvrini{$testnum}));
+ $timetooltot += $timetoolend{$testnum} - $timetoolini{$testnum};
+ $timelocktot += $timesrvrlog{$testnum} - $timetoolend{$testnum};
+ $timevrfytot += $timevrfyend{$testnum} - $timesrvrlog{$testnum};
+ $timetesttot += $timevrfyend{$testnum} - $timeprepini{$testnum};
+ push @timesrvr, sprintf("%06.3f %04d",
+ $timesrvrend{$testnum} - $timesrvrini{$testnum}, $testnum);
+ push @timeprep, sprintf("%06.3f %04d",
+ ($timetoolini{$testnum} - $timeprepini{$testnum}) -
+ ($timesrvrend{$testnum} - $timesrvrini{$testnum}), $testnum);
+ push @timetool, sprintf("%06.3f %04d",
+ $timetoolend{$testnum} - $timetoolini{$testnum}, $testnum);
+ push @timelock, sprintf("%06.3f %04d",
+ $timesrvrlog{$testnum} - $timetoolend{$testnum}, $testnum);
+ push @timevrfy, sprintf("%06.3f %04d",
+ $timevrfyend{$testnum} - $timesrvrlog{$testnum}, $testnum);
+ push @timetest, sprintf("%06.3f %04d",
+ $timevrfyend{$testnum} - $timeprepini{$testnum}, $testnum);
+ }
+ }
+
+ {
+ no warnings 'numeric';
+ @timesrvr = sort { $b <=> $a } @timesrvr;
+ @timeprep = sort { $b <=> $a } @timeprep;
+ @timetool = sort { $b <=> $a } @timetool;
+ @timelock = sort { $b <=> $a } @timelock;
+ @timevrfy = sort { $b <=> $a } @timevrfy;
+ @timetest = sort { $b <=> $a } @timetest;
+ }
+
+ logmsg "Spent ". sprintf("%08.3f ", $timesrvrtot) .
+ "seconds starting and verifying test harness servers.\n";
+ logmsg "Spent ". sprintf("%08.3f ", $timepreptot) .
+ "seconds reading definitions and doing test preparations.\n";
+ logmsg "Spent ". sprintf("%08.3f ", $timetooltot) .
+ "seconds actually running test tools.\n";
+ logmsg "Spent ". sprintf("%08.3f ", $timelocktot) .
+ "seconds awaiting server logs lock removal.\n";
+ logmsg "Spent ". sprintf("%08.3f ", $timevrfytot) .
+ "seconds verifying test results.\n";
+ logmsg "Spent ". sprintf("%08.3f ", $timetesttot) .
+ "seconds doing all of the above.\n";
+
+ $counter = 25;
+ logmsg "\nTest server starting and verification time per test ".
+ sprintf("(%s)...\n\n", (not $fullstats)?"top $counter":"full");
+ logmsg "-time- test\n";
+ logmsg "------ ----\n";
+ foreach my $txt (@timesrvr) {
+ last if((not $fullstats) && (not $counter--));
+ logmsg "$txt\n";
+ }
+
+ $counter = 10;
+ logmsg "\nTest definition reading and preparation time per test ".
+ sprintf("(%s)...\n\n", (not $fullstats)?"top $counter":"full");
+ logmsg "-time- test\n";
+ logmsg "------ ----\n";
+ foreach my $txt (@timeprep) {
+ last if((not $fullstats) && (not $counter--));
+ logmsg "$txt\n";
+ }
+
+ $counter = 25;
+ logmsg "\nTest tool execution time per test ".
+ sprintf("(%s)...\n\n", (not $fullstats)?"top $counter":"full");
+ logmsg "-time- test\n";
+ logmsg "------ ----\n";
+ foreach my $txt (@timetool) {
+ last if((not $fullstats) && (not $counter--));
+ logmsg "$txt\n";
+ }
+
+ $counter = 15;
+ logmsg "\nTest server logs lock removal time per test ".
+ sprintf("(%s)...\n\n", (not $fullstats)?"top $counter":"full");
+ logmsg "-time- test\n";
+ logmsg "------ ----\n";
+ foreach my $txt (@timelock) {
+ last if((not $fullstats) && (not $counter--));
+ logmsg "$txt\n";
+ }
+
+ $counter = 10;
+ logmsg "\nTest results verification time per test ".
+ sprintf("(%s)...\n\n", (not $fullstats)?"top $counter":"full");
+ logmsg "-time- test\n";
+ logmsg "------ ----\n";
+ foreach my $txt (@timevrfy) {
+ last if((not $fullstats) && (not $counter--));
+ logmsg "$txt\n";
+ }
+
+ $counter = 50;
+ logmsg "\nTotal time per test ".
+ sprintf("(%s)...\n\n", (not $fullstats)?"top $counter":"full");
+ logmsg "-time- test\n";
+ logmsg "------ ----\n";
+ foreach my $txt (@timetest) {
+ last if((not $fullstats) && (not $counter--));
+ logmsg "$txt\n";
+ }
+
+ logmsg "\n";
+}
+
+#######################################################################
+# Check options to this test program
+#
+
+my $number=0;
+my $fromnum=-1;
+my @testthis;
+my %disabled;
+while(@ARGV) {
+ if ($ARGV[0] eq "-v") {
+ # verbose output
+ $verbose=1;
+ }
+ elsif($ARGV[0] =~ /^-b(.*)/) {
+ my $portno=$1;
+ if($portno =~ s/(\d+)$//) {
+ $base = int $1;
+ }
+ }
+ elsif ($ARGV[0] eq "-c") {
+ # use this path to curl instead of default
+ $DBGCURL=$CURL=$ARGV[1];
+ shift @ARGV;
+ }
+ elsif ($ARGV[0] eq "-d") {
+ # have the servers display protocol output
+ $debugprotocol=1;
+ }
+ elsif ($ARGV[0] eq "-f") {
+ # run fork-servers, which makes the server fork for all new
+ # connections This is NOT what you wanna do without knowing exactly
+ # why and for what
+ $forkserver=1;
+ }
+ elsif ($ARGV[0] eq "-g") {
+ # run this test with gdb
+ $gdbthis=1;
+ }
+ elsif($ARGV[0] eq "-s") {
+ # short output
+ $short=1;
+ }
+ elsif($ARGV[0] eq "-n") {
+ # no valgrind
+ undef $valgrind;
+ }
+ elsif($ARGV[0] =~ /^-t(.*)/) {
+ # torture
+ $torture=1;
+ my $xtra = $1;
+
+ if($xtra =~ s/(\d+)$//) {
+ $tortalloc = $1;
+ }
+ # we undef valgrind to make this fly in comparison
+ undef $valgrind;
+ }
+ elsif($ARGV[0] eq "-a") {
+ # continue anyway, even if a test fail
+ $anyway=1;
+ }
+ elsif($ARGV[0] eq "-p") {
+ $postmortem=1;
+ }
+ elsif($ARGV[0] eq "-l") {
+ # lists the test case names only
+ $listonly=1;
+ }
+ elsif($ARGV[0] eq "-k") {
+ # keep stdout and stderr files after tests
+ $keepoutfiles=1;
+ }
+ elsif($ARGV[0] eq "-r") {
+ # run time statistics needs Time::HiRes
+ if($Time::HiRes::VERSION) {
+ keys(%timeprepini) = 1000;
+ keys(%timesrvrini) = 1000;
+ keys(%timesrvrend) = 1000;
+ keys(%timetoolini) = 1000;
+ keys(%timetoolend) = 1000;
+ keys(%timesrvrlog) = 1000;
+ keys(%timevrfyend) = 1000;
+ $timestats=1;
+ $fullstats=0;
+ }
+ }
+ elsif($ARGV[0] eq "-rf") {
+ # run time statistics needs Time::HiRes
+ if($Time::HiRes::VERSION) {
+ keys(%timeprepini) = 1000;
+ keys(%timesrvrini) = 1000;
+ keys(%timesrvrend) = 1000;
+ keys(%timetoolini) = 1000;
+ keys(%timetoolend) = 1000;
+ keys(%timesrvrlog) = 1000;
+ keys(%timevrfyend) = 1000;
+ $timestats=1;
+ $fullstats=1;
+ }
+ }
+ elsif(($ARGV[0] eq "-h") || ($ARGV[0] eq "--help")) {
+ # show help text
+ print <<EOHELP
+Usage: runtests.pl [options] [test selection(s)]
+ -a continue even if a test fails
+ -bN use base port number N for test servers (default $base)
+ -c path use this curl executable
+ -d display server debug info
+ -g run the test case with gdb
+ -h this help text
+ -k keep stdout and stderr files present after tests
+ -l list all test case names/descriptions
+ -n no valgrind
+ -p print log file contents when a test fails
+ -r run time statistics
+ -rf full run time statistics
+ -s short output
+ -t[N] torture (simulate memory alloc failures); N means fail Nth alloc
+ -v verbose output
+ [num] like "5 6 9" or " 5 to 22 " to run those tests only
+ [!num] like "!5 !6 !9" to disable those tests
+ [keyword] like "IPv6" to select only tests containing the key word
+ [!keyword] like "!cookies" to disable any tests containing the key word
+EOHELP
+ ;
+ exit;
+ }
+ elsif($ARGV[0] =~ /^(\d+)/) {
+ $number = $1;
+ if($fromnum >= 0) {
+ for($fromnum .. $number) {
+ push @testthis, $_;
+ }
+ $fromnum = -1;
+ }
+ else {
+ push @testthis, $1;
+ }
+ }
+ elsif($ARGV[0] =~ /^to$/i) {
+ $fromnum = $number+1;
+ }
+ elsif($ARGV[0] =~ /^!(\d+)/) {
+ $fromnum = -1;
+ $disabled{$1}=$1;
+ }
+ elsif($ARGV[0] =~ /^!(.+)/) {
+ $disabled_keywords{$1}=$1;
+ }
+ elsif($ARGV[0] =~ /^([-[{a-zA-Z].*)/) {
+ $enabled_keywords{$1}=$1;
+ }
+ else {
+ print "Unknown option: $ARGV[0]\n";
+ exit;
+ }
+ shift @ARGV;
+}
+
+if(@testthis && ($testthis[0] ne "")) {
+ $TESTCASES=join(" ", @testthis);
+}
+
+if($valgrind) {
+ # we have found valgrind on the host, use it
+
+ # verify that we can invoke it fine
+ my $code = runclient("valgrind >/dev/null 2>&1");
+
+ if(($code>>8) != 1) {
+ #logmsg "Valgrind failure, disable it\n";
+ undef $valgrind;
+ } else {
+
+ # since valgrind 2.1.x, '--tool' option is mandatory
+ # use it, if it is supported by the version installed on the system
+ runclient("valgrind --help 2>&1 | grep -- --tool > /dev/null 2>&1");
+ if (($? >> 8)==0) {
+ $valgrind_tool="--tool=memcheck";
+ }
+ open(C, "<$CURL");
+ my $l = <C>;
+ if($l =~ /^\#\!/) {
+ # A shell script. This is typically when built with libtool,
+ $valgrind="../libtool --mode=execute $valgrind";
+ }
+ close(C);
+
+ # valgrind 3 renamed the --logfile option to --log-file!!!
+ my $ver=join(' ', runclientoutput("valgrind --version"));
+ # cut off all but digits and dots
+ $ver =~ s/[^0-9.]//g;
+
+ if($ver =~ /^(\d+)/) {
+ $ver = $1;
+ if($ver >= 3) {
+ $valgrind_logfile="--log-file";
+ }
+ }
+ }
+}
+
+if ($gdbthis) {
+ # open the executable curl and read the first 4 bytes of it
+ open(CHECK, "<$CURL");
+ my $c;
+ sysread CHECK, $c, 4;
+ close(CHECK);
+ if($c eq "#! /") {
+ # A shell script. This is typically when built with libtool,
+ $libtool = 1;
+ $gdb = "libtool --mode=execute gdb";
+ }
+}
+
+$HTTPPORT = $base++; # HTTP server port
+$HTTPSPORT = $base++; # HTTPS server port
+$FTPPORT = $base++; # FTP server port
+$FTPSPORT = $base++; # FTPS server port
+$HTTP6PORT = $base++; # HTTP IPv6 server port (different IP protocol
+ # but we follow the same port scheme anyway)
+$FTP2PORT = $base++; # FTP server 2 port
+$FTP6PORT = $base++; # FTP IPv6 port
+$TFTPPORT = $base++; # TFTP (UDP) port
+$TFTP6PORT = $base++; # TFTP IPv6 (UDP) port
+$SSHPORT = $base++; # SSH (SCP/SFTP) port
+$SOCKSPORT = $base++; # SOCKS port
+$POP3PORT = $base++;
+$POP36PORT = $base++;
+$IMAPPORT = $base++;
+$IMAP6PORT = $base++;
+$SMTPPORT = $base++;
+$SMTP6PORT = $base++;
+$RTSPPORT = $base++;
+$RTSP6PORT = $base++;
+$GOPHERPORT =$base++;
+$GOPHER6PORT=$base++;
+
+#######################################################################
+# clear and create logging directory:
+#
+
+cleardir($LOGDIR);
+mkdir($LOGDIR, 0777);
+
+#######################################################################
+# initialize some variables
+#
+
+get_disttests();
+init_serverpidfile_hash();
+
+#######################################################################
+# Output curl version and host info being tested
+#
+
+if(!$listonly) {
+ checksystem();
+}
+
+#######################################################################
+# If 'all' tests are requested, find out all test numbers
+#
+
+if ( $TESTCASES eq "all") {
+ # Get all commands and find out their test numbers
+ opendir(DIR, $TESTDIR) || die "can't opendir $TESTDIR: $!";
+ my @cmds = grep { /^test([0-9]+)$/ && -f "$TESTDIR/$_" } readdir(DIR);
+ closedir(DIR);
+
+ open(D, "<$TESTDIR/DISABLED");
+ while(<D>) {
+ if(/^ *\#/) {
+ # allow comments
+ next;
+ }
+ if($_ =~ /(\d+)/) {
+ $disabled{$1}=$1; # disable this test number
+ }
+ }
+ close(D);
+
+ $TESTCASES=""; # start with no test cases
+
+ # cut off everything but the digits
+ for(@cmds) {
+ $_ =~ s/[a-z\/\.]*//g;
+ }
+ # sort the numbers from low to high
+ foreach my $n (sort { $a <=> $b } @cmds) {
+ if($disabled{$n}) {
+ # skip disabled test cases
+ my $why = "configured as DISABLED";
+ $skipped++;
+ $skipped{$why}++;
+ $teststat[$n]=$why; # store reason for this test case
+ next;
+ }
+ $TESTCASES .= " $n";
+ }
+}
+
+#######################################################################
+# Start the command line log
+#
+open(CMDLOG, ">$CURLLOG") ||
+ logmsg "can't log command lines to $CURLLOG\n";
+
+#######################################################################
+
+# Display the contents of the given file. Line endings are canonicalized
+# and excessively long files are elided
+sub displaylogcontent {
+ my ($file)=@_;
+ if(open(SINGLE, "<$file")) {
+ my $linecount = 0;
+ my $truncate;
+ my @tail;
+ while(my $string = <SINGLE>) {
+ $string =~ s/\r\n/\n/g;
+ $string =~ s/[\r\f\032]/\n/g;
+ $string .= "\n" unless ($string =~ /\n$/);
+ $string =~ tr/\n//;
+ for my $line (split("\n", $string)) {
+ $line =~ s/\s*\!$//;
+ if ($truncate) {
+ push @tail, " $line\n";
+ } else {
+ logmsg " $line\n";
+ }
+ $linecount++;
+ $truncate = $linecount > 1000;
+ }
+ }
+ if(@tail) {
+ my $tailshow = 200;
+ my $tailskip = 0;
+ my $tailtotal = scalar @tail;
+ if($tailtotal > $tailshow) {
+ $tailskip = $tailtotal - $tailshow;
+ logmsg "=== File too long: $tailskip lines omitted here\n";
+ }
+ for($tailskip .. $tailtotal-1) {
+ logmsg "$tail[$_]";
+ }
+ }
+ close(SINGLE);
+ }
+}
+
+sub displaylogs {
+ my ($testnum)=@_;
+ opendir(DIR, "$LOGDIR") ||
+ die "can't open dir: $!";
+ my @logs = readdir(DIR);
+ closedir(DIR);
+
+ logmsg "== Contents of files in the $LOGDIR/ dir after test $testnum\n";
+ foreach my $log (sort @logs) {
+ if($log =~ /\.(\.|)$/) {
+ next; # skip "." and ".."
+ }
+ if($log =~ /^\.nfs/) {
+ next; # skip ".nfs"
+ }
+ if(($log eq "memdump") || ($log eq "core")) {
+ next; # skip "memdump" and "core"
+ }
+ if((-d "$LOGDIR/$log") || (! -s "$LOGDIR/$log")) {
+ next; # skip directory and empty files
+ }
+ if(($log =~ /^stdout\d+/) && ($log !~ /^stdout$testnum/)) {
+ next; # skip stdoutNnn of other tests
+ }
+ if(($log =~ /^stderr\d+/) && ($log !~ /^stderr$testnum/)) {
+ next; # skip stderrNnn of other tests
+ }
+ if(($log =~ /^upload\d+/) && ($log !~ /^upload$testnum/)) {
+ next; # skip uploadNnn of other tests
+ }
+ if(($log =~ /^curl\d+\.out/) && ($log !~ /^curl$testnum\.out/)) {
+ next; # skip curlNnn.out of other tests
+ }
+ if(($log =~ /^test\d+\.txt/) && ($log !~ /^test$testnum\.txt/)) {
+ next; # skip testNnn.txt of other tests
+ }
+ if(($log =~ /^file\d+\.txt/) && ($log !~ /^file$testnum\.txt/)) {
+ next; # skip fileNnn.txt of other tests
+ }
+ if(($log =~ /^valgrind\d+/) && ($log !~ /^valgrind$testnum(\..*|)$/)) {
+ next; # skip valgrindNnn of other tests
+ }
+ logmsg "=== Start of file $log\n";
+ displaylogcontent("$LOGDIR/$log");
+ logmsg "=== End of file $log\n";
+ }
+}
+
+#######################################################################
+# The main test-loop
+#
+
+my $failed;
+my $testnum;
+my $ok=0;
+my $total=0;
+my $lasttest=0;
+my @at = split(" ", $TESTCASES);
+my $count=0;
+
+$start = time();
+
+foreach $testnum (@at) {
+
+ $lasttest = $testnum if($testnum > $lasttest);
+ $count++;
+
+ my $error = singletest($testnum, $count, scalar(@at));
+ if($error < 0) {
+ # not a test we can run
+ next;
+ }
+
+ $total++; # number of tests we've run
+
+ if($error>0) {
+ $failed.= "$testnum ";
+ if($postmortem) {
+ # display all files in log/ in a nice way
+ displaylogs($testnum);
+ }
+ if(!$anyway) {
+ # a test failed, abort
+ logmsg "\n - abort tests\n";
+ last;
+ }
+ }
+ elsif(!$error) {
+ $ok++; # successful test counter
+ }
+
+ # loop for next test
+}
+
+my $sofar = time() - $start;
+
+#######################################################################
+# Close command log
+#
+close(CMDLOG);
+
+# Tests done, stop the servers
+stopservers($verbose);
+
+my $all = $total + $skipped;
+
+runtimestats($lasttest);
+
+if($total) {
+ logmsg sprintf("TESTDONE: $ok tests out of $total reported OK: %d%%\n",
+ $ok/$total*100);
+
+ if($ok != $total) {
+ logmsg "TESTFAIL: These test cases failed: $failed\n";
+ }
+}
+else {
+ logmsg "TESTFAIL: No tests were performed\n";
+}
+
+if($all) {
+ logmsg "TESTDONE: $all tests were considered during ".
+ sprintf("%.0f", $sofar) ." seconds.\n";
+}
+
+if($skipped) {
+ my $s=0;
+ logmsg "TESTINFO: $skipped tests were skipped due to these restraints:\n";
+
+ for(keys %skipped) {
+ my $r = $_;
+ printf "TESTINFO: \"%s\" %d times (", $r, $skipped{$_};
+
+ # now show all test case numbers that had this reason for being
+ # skipped
+ my $c=0;
+ for(0 .. scalar @teststat) {
+ my $t = $_;
+ if($teststat[$_] && ($teststat[$_] eq $r)) {
+ logmsg ", " if($c);
+ logmsg $_;
+ $c++;
+ }
+ }
+ logmsg ")\n";
+ }
+}
+
+if($total && ($ok != $total)) {
+ exit 1;
+}
diff --git a/tests/runtests.pl.orig b/tests/runtests.pl.orig
new file mode 100755
index 000000000..2eb65fd9e
--- /dev/null
+++ b/tests/runtests.pl.orig
@@ -0,0 +1,4138 @@
+#!/usr/bin/env perl
+#***************************************************************************
+# _ _ ____ _
+# Project ___| | | | _ \| |
+# / __| | | | |_) | |
+# | (__| |_| | _ <| |___
+# \___|\___/|_| \_\_____|
+#
+# Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+#
+# This software is licensed as described in the file COPYING, which
+# you should have received as part of this distribution. The terms
+# are also available at http://curl.haxx.se/docs/copyright.html.
+#
+# You may opt to use, copy, modify, merge, publish, distribute and/or sell
+# copies of the Software, and permit persons to whom the Software is
+# furnished to do so, under the terms of the COPYING file.
+#
+# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+# KIND, either express or implied.
+#
+###########################################################################
+
+# Experimental hooks are available to run tests remotely on machines that
+# are able to run curl but are unable to run the test harness.
+# The following sections need to be modified:
+#
+# $HOSTIP, $HOST6IP - Set to the address of the host running the test suite
+# $CLIENTIP, $CLIENT6IP - Set to the address of the host running curl
+# runclient, runclientoutput - Modify to copy all the files in the log/
+# directory to the system running curl, run the given command remotely
+# and save the return code or returned stdout (respectively), then
+# copy all the files from the remote system's log/ directory back to
+# the host running the test suite. This can be done a few ways, such
+# as using scp & ssh, rsync & telnet, or using a NFS shared directory
+# and ssh.
+#
+# 'make && make test' needs to be done on both machines before making the
+# above changes and running runtests.pl manually. In the shared NFS case,
+# the contents of the tests/server/ directory must be from the host
+# running the test suite, while the rest must be from the host running curl.
+#
+# Note that even with these changes a number of tests will still fail (mainly
+# to do with cookies, those that set environment variables, or those that
+# do more than touch the file system in a <precheck> or <postcheck>
+# section). These can be added to the $TESTCASES line below,
+# e.g. $TESTCASES="!8 !31 !63 !cookies..."
+#
+# Finally, to properly support -g and -n, checktestcmd needs to change
+# to check the remote system's PATH, and the places in the code where
+# the curl binary is read directly to determine its type also need to be
+# fixed. As long as the -g option is never given, and the -n is always
+# given, this won't be a problem.
+
+
+# These should be the only variables that might be needed to get edited:
+
+BEGIN {
+ @INC=(@INC, $ENV{'srcdir'}, ".");
+ # run time statistics needs Time::HiRes
+ eval {
+ no warnings "all";
+ require Time::HiRes;
+ import Time::HiRes qw( time );
+ }
+}
+
+use strict;
+use warnings;
+use Cwd;
+
+# Subs imported from serverhelp module
+use serverhelp qw(
+ serverfactors
+ servername_id
+ servername_str
+ servername_canon
+ server_pidfilename
+ server_logfilename
+ );
+
+# Variables and subs imported from sshhelp module
+use sshhelp qw(
+ $sshdexe
+ $sshexe
+ $sftpexe
+ $sshconfig
+ $sftpconfig
+ $sshdlog
+ $sshlog
+ $sftplog
+ $sftpcmds
+ display_sshdconfig
+ display_sshconfig
+ display_sftpconfig
+ display_sshdlog
+ display_sshlog
+ display_sftplog
+ exe_ext
+ find_sshd
+ find_ssh
+ find_sftp
+ sshversioninfo
+ );
+
+require "getpart.pm"; # array functions
+require "valgrind.pm"; # valgrind report parser
+require "ftp.pm";
+
+my $HOSTIP="127.0.0.1"; # address on which the test server listens
+my $HOST6IP="[::1]"; # address on which the test server listens
+my $CLIENTIP="127.0.0.1"; # address which curl uses for incoming connections
+my $CLIENT6IP="[::1]"; # address which curl uses for incoming connections
+
+my $base = 8990; # base port number
+
+my $HTTPPORT; # HTTP server port
+my $HTTP6PORT; # HTTP IPv6 server port
+my $HTTPSPORT; # HTTPS server port
+my $FTPPORT; # FTP server port
+my $FTP2PORT; # FTP server 2 port
+my $FTPSPORT; # FTPS server port
+my $FTP6PORT; # FTP IPv6 server port
+my $TFTPPORT; # TFTP
+my $TFTP6PORT; # TFTP
+my $SSHPORT; # SCP/SFTP
+my $SOCKSPORT; # SOCKS4/5 port
+my $POP3PORT; # POP3
+my $POP36PORT; # POP3 IPv6 server port
+my $IMAPPORT; # IMAP
+my $IMAP6PORT; # IMAP IPv6 server port
+my $SMTPPORT; # SMTP
+my $SMTP6PORT; # SMTP IPv6 server port
+my $RTSPPORT; # RTSP
+my $RTSP6PORT; # RTSP IPv6 server port
+my $GOPHERPORT; # Gopher
+my $GOPHER6PORT; # Gopher IPv6 server port
+
+my $srcdir = $ENV{'srcdir'} || '.';
+my $CURL="../src/curl".exe_ext(); # what curl executable to run on the tests
+my $VCURL=$CURL; # what curl binary to use to verify the servers with
+ # VCURL is handy to set to the system one when the one you
+ # just built hangs or crashes and thus prevent verification
+my $DBGCURL=$CURL; #"../src/.libs/curl"; # alternative for debugging
+my $LOGDIR="log";
+my $TESTDIR="$srcdir/data";
+my $LIBDIR="./libtest";
+my $SERVERIN="$LOGDIR/server.input"; # what curl sent the server
+my $SERVER2IN="$LOGDIR/server2.input"; # what curl sent the second server
+my $CURLLOG="$LOGDIR/curl.log"; # all command lines run
+my $FTPDCMD="$LOGDIR/ftpserver.cmd"; # copy ftp server instructions here
+my $SERVERLOGS_LOCK="$LOGDIR/serverlogs.lock"; # server logs advisor read lock
+my $CURLCONFIG="../curl-config"; # curl-config from current build
+
+# Normally, all test cases should be run, but at times it is handy to
+# simply run a particular one:
+my $TESTCASES="all";
+
+# To run specific test cases, set them like:
+# $TESTCASES="1 2 3 7 8";
+
+#######################################################################
+# No variables below this point should need to be modified
+#
+
+# invoke perl like this:
+my $perl="perl -I$srcdir";
+my $server_response_maxtime=13;
+
+my $debug_build=0; # curl built with --enable-debug
+my $curl_debug=0; # curl built with --enable-curldebug (memory tracking)
+my $libtool;
+
+# name of the file that the memory debugging creates:
+my $memdump="$LOGDIR/memdump";
+
+# the path to the script that analyzes the memory debug output file:
+my $memanalyze="$perl $srcdir/memanalyze.pl";
+
+my $pwd = getcwd(); # current working directory
+
+my $start;
+my $forkserver=0;
+my $ftpchecktime=1; # time it took to verify our test FTP server
+
+my $stunnel = checkcmd("stunnel4") || checkcmd("stunnel");
+my $valgrind = checktestcmd("valgrind");
+my $valgrind_logfile="--logfile";
+my $valgrind_tool;
+my $gdb = checktestcmd("gdb");
+
+my $ssl_version; # set if libcurl is built with SSL support
+my $large_file; # set if libcurl is built with large file support
+my $has_idn; # set if libcurl is built with IDN support
+my $http_ipv6; # set if HTTP server has IPv6 support
+my $ftp_ipv6; # set if FTP server has IPv6 support
+my $tftp_ipv6; # set if TFTP server has IPv6 support
+my $gopher_ipv6; # set if Gopher server has IPv6 support
+my $has_ipv6; # set if libcurl is built with IPv6 support
+my $has_libz; # set if libcurl is built with libz support
+my $has_getrlimit; # set if system has getrlimit()
+my $has_ntlm; # set if libcurl is built with NTLM support
+my $has_charconv;# set if libcurl is built with CharConv support
+
+my $has_openssl; # built with a lib using an OpenSSL-like API
+my $has_gnutls; # built with GnuTLS
+my $has_nss; # built with NSS
+my $has_yassl; # built with yassl
+my $has_polarssl;# built with polarssl
+
+my $has_shared; # built shared
+
+my $ssllib; # name of the lib we use (for human presentation)
+my $has_crypto; # set if libcurl is built with cryptographic support
+my $has_textaware; # set if running on a system that has a text mode concept
+ # on files. Windows for example
+my @protocols; # array of supported protocols
+
+my $skipped=0; # number of tests skipped; reported in main loop
+my %skipped; # skipped{reason}=counter, reasons for skip
+my @teststat; # teststat[testnum]=reason, reasons for skip
+my %disabled_keywords; # key words of tests to skip
+my %enabled_keywords; # key words of tests to run
+
+my $sshdid; # for socks server, ssh daemon version id
+my $sshdvernum; # for socks server, ssh daemon version number
+my $sshdverstr; # for socks server, ssh daemon version string
+my $sshderror; # for socks server, ssh daemon version error
+
+my $defserverlogslocktimeout = 20; # timeout to await server logs lock removal
+my $defpostcommanddelay = 0; # delay between command and postcheck sections
+
+my $timestats; # time stamping and stats generation
+my $fullstats; # show time stats for every single test
+my %timeprepini; # timestamp for each test preparation start
+my %timesrvrini; # timestamp for each test required servers verification start
+my %timesrvrend; # timestamp for each test required servers verification end
+my %timetoolini; # timestamp for each test command run starting
+my %timetoolend; # timestamp for each test command run stopping
+my %timesrvrlog; # timestamp for each test server logs lock removal
+my %timevrfyend; # timestamp for each test result verification end
+
+my $testnumcheck; # test number, set in singletest sub.
+my %oldenv;
+
+#######################################################################
+# variables the command line options may set
+#
+
+my $short;
+my $verbose;
+my $debugprotocol;
+my $anyway;
+my $gdbthis; # run test case with gdb debugger
+my $keepoutfiles; # keep stdout and stderr files after tests
+my $listonly; # only list the tests
+my $postmortem; # display detailed info about failed tests
+
+my %run; # running server
+my %doesntrun; # servers that don't work, identified by pidfile
+my %serverpidfile;# all server pid file names, identified by server id
+my %runcert; # cert file currently in use by an ssl running server
+
+# torture test variables
+my $torture;
+my $tortnum;
+my $tortalloc;
+
+#######################################################################
+# logmsg is our general message logging subroutine.
+#
+sub logmsg {
+ for(@_) {
+ print "$_";
+ }
+}
+
+# get the name of the current user
+my $USER = $ENV{USER}; # Linux
+if (!$USER) {
+ $USER = $ENV{USERNAME}; # Windows
+ if (!$USER) {
+ $USER = $ENV{LOGNAME}; # Some UNIX (I think)
+ }
+}
+
+# enable memory debugging if curl is compiled with it
+$ENV{'CURL_MEMDEBUG'} = $memdump;
+$ENV{'HOME'}=$pwd;
+
+sub catch_zap {
+ my $signame = shift;
+ logmsg "runtests.pl received SIG$signame, exiting\n";
+ stopservers($verbose);
+ die "Somebody sent me a SIG$signame";
+}
+$SIG{INT} = \&catch_zap;
+$SIG{TERM} = \&catch_zap;
+
+##########################################################################
+# Clear all possible '*_proxy' environment variables for various protocols
+# to prevent them to interfere with our testing!
+
+my $protocol;
+foreach $protocol (('ftp', 'http', 'ftps', 'https', 'no')) {
+ my $proxy = "${protocol}_proxy";
+ # clear lowercase version
+ delete $ENV{$proxy} if($ENV{$proxy});
+ # clear uppercase version
+ delete $ENV{uc($proxy)} if($ENV{uc($proxy)});
+}
+
+# make sure we don't get affected by other variables that control our
+# behaviour
+
+delete $ENV{'SSL_CERT_DIR'} if($ENV{'SSL_CERT_DIR'});
+delete $ENV{'SSL_CERT_PATH'} if($ENV{'SSL_CERT_PATH'});
+delete $ENV{'CURL_CA_BUNDLE'} if($ENV{'CURL_CA_BUNDLE'});
+
+#######################################################################
+# Load serverpidfile hash with pidfile names for all possible servers.
+#
+sub init_serverpidfile_hash {
+ for my $proto (('ftp', 'http', 'imap', 'pop3', 'smtp')) {
+ for my $ssl (('', 's')) {
+ for my $ipvnum ((4, 6)) {
+ for my $idnum ((1, 2)) {
+ my $serv = servername_id("$proto$ssl", $ipvnum, $idnum);
+ my $pidf = server_pidfilename("$proto$ssl", $ipvnum, $idnum);
+ $serverpidfile{$serv} = $pidf;
+ }
+ }
+ }
+ }
+ for my $proto (('tftp', 'sftp', 'socks', 'ssh', 'rtsp', 'gopher')) {
+ for my $ipvnum ((4, 6)) {
+ for my $idnum ((1, 2)) {
+ my $serv = servername_id($proto, $ipvnum, $idnum);
+ my $pidf = server_pidfilename($proto, $ipvnum, $idnum);
+ $serverpidfile{$serv} = $pidf;
+ }
+ }
+ }
+}
+
+#######################################################################
+# Check if a given child process has just died. Reaps it if so.
+#
+sub checkdied {
+ use POSIX ":sys_wait_h";
+ my $pid = $_[0];
+ if(not defined $pid || $pid <= 0) {
+ return 0;
+ }
+ my $rc = waitpid($pid, &WNOHANG);
+ return ($rc == $pid)?1:0;
+}
+
+#######################################################################
+# Start a new thread/process and run the given command line in there.
+# Return the pids (yes plural) of the new child process to the parent.
+#
+sub startnew {
+ my ($cmd, $pidfile, $timeout, $fake)=@_;
+
+ logmsg "startnew: $cmd\n" if ($verbose);
+
+ my $child = fork();
+ my $pid2 = 0;
+
+ if(not defined $child) {
+ logmsg "startnew: fork() failure detected\n";
+ return (-1,-1);
+ }
+
+ if(0 == $child) {
+ # Here we are the child. Run the given command.
+
+ # Put an "exec" in front of the command so that the child process
+ # keeps this child's process ID.
+ exec("exec $cmd") || die "Can't exec() $cmd: $!";
+
+ # exec() should never return back here to this process. We protect
+ # ourselves by calling die() just in case something goes really bad.
+ die "error: exec() has returned";
+ }
+
+ # Ugly hack but ssh client doesn't support pid files
+ if ($fake) {
+ if(open(OUT, ">$pidfile")) {
+ print OUT $child . "\n";
+ close(OUT);
+ logmsg "startnew: $pidfile faked with pid=$child\n" if($verbose);
+ }
+ else {
+ logmsg "startnew: failed to write fake $pidfile with pid=$child\n";
+ }
+ # could/should do a while connect fails sleep a bit and loop
+ sleep $timeout;
+ if (checkdied($child)) {
+ logmsg "startnew: child process has failed to start\n" if($verbose);
+ return (-1,-1);
+ }
+ }
+
+ my $count = $timeout;
+ while($count--) {
+ if(-f $pidfile && -s $pidfile && open(PID, "<$pidfile")) {
+ $pid2 = 0 + <PID>;
+ close(PID);
+ if(($pid2 > 0) && kill(0, $pid2)) {
+ # if $pid2 is valid, then make sure this pid is alive, as
+ # otherwise it is just likely to be the _previous_ pidfile or
+ # similar!
+ last;
+ }
+ # invalidate $pid2 if not actually alive
+ $pid2 = 0;
+ }
+ if (checkdied($child)) {
+ logmsg "startnew: child process has died, server might start up\n"
+ if($verbose);
+ # We can't just abort waiting for the server with a
+ # return (-1,-1);
+ # because the server might have forked and could still start
+ # up normally. Instead, just reduce the amount of time we remain
+ # waiting.
+ $count >>= 2;
+ }
+ sleep(1);
+ }
+
+ # Return two PIDs, the one for the child process we spawned and the one
+ # reported by the server itself (in case it forked again on its own).
+ # Both (potentially) need to be killed at the end of the test.
+ return ($child, $pid2);
+}
+
+
+#######################################################################
+# Check for a command in the PATH of the test server.
+#
+sub checkcmd {
+ my ($cmd)=@_;
+ my @paths=(split(":", $ENV{'PATH'}), "/usr/sbin", "/usr/local/sbin",
+ "/sbin", "/usr/bin", "/usr/local/bin",
+ "./libtest/.libs", "./libtest");
+ for(@paths) {
+ if( -x "$_/$cmd" && ! -d "$_/$cmd") {
+ # executable bit but not a directory!
+ return "$_/$cmd";
+ }
+ }
+}
+
+#######################################################################
+# Get the list of tests that the tests/data/Makefile.am knows about!
+#
+my $disttests;
+sub get_disttests {
+ my @dist = `cd data && make show`;
+ $disttests = join("", @dist);
+}
+
+#######################################################################
+# Check for a command in the PATH of the machine running curl.
+#
+sub checktestcmd {
+ my ($cmd)=@_;
+ return checkcmd($cmd);
+}
+
+#######################################################################
+# Run the application under test and return its return code
+#
+sub runclient {
+ my ($cmd)=@_;
+ return system($cmd);
+
+# This is one way to test curl on a remote machine
+# my $out = system("ssh $CLIENTIP cd \'$pwd\' \\; \'$cmd\'");
+# sleep 2; # time to allow the NFS server to be updated
+# return $out;
+}
+
+#######################################################################
+# Run the application under test and return its stdout
+#
+sub runclientoutput {
+ my ($cmd)=@_;
+ return `$cmd`;
+
+# This is one way to test curl on a remote machine
+# my @out = `ssh $CLIENTIP cd \'$pwd\' \\; \'$cmd\'`;
+# sleep 2; # time to allow the NFS server to be updated
+# return @out;
+ }
+
+#######################################################################
+# Memory allocation test and failure torture testing.
+#
+sub torture {
+ my $testcmd = shift;
+ my $gdbline = shift;
+
+ # remove memdump first to be sure we get a new nice and clean one
+ unlink($memdump);
+
+ # First get URL from test server, ignore the output/result
+ runclient($testcmd);
+
+ logmsg " CMD: $testcmd\n" if($verbose);
+
+ # memanalyze -v is our friend, get the number of allocations made
+ my $count=0;
+ my @out = `$memanalyze -v $memdump`;
+ for(@out) {
+ if(/^Allocations: (\d+)/) {
+ $count = $1;
+ last;
+ }
+ }
+ if(!$count) {
+ logmsg " found no allocs to make fail\n";
+ return 0;
+ }
+
+ logmsg " $count allocations to make fail\n";
+
+ for ( 1 .. $count ) {
+ my $limit = $_;
+ my $fail;
+ my $dumped_core;
+
+ if($tortalloc && ($tortalloc != $limit)) {
+ next;
+ }
+
+ if($verbose) {
+ my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
+ localtime(time());
+ my $now = sprintf("%02d:%02d:%02d ", $hour, $min, $sec);
+ logmsg "Fail alloc no: $limit at $now\r";
+ }
+
+ # make the memory allocation function number $limit return failure
+ $ENV{'CURL_MEMLIMIT'} = $limit;
+
+ # remove memdump first to be sure we get a new nice and clean one
+ unlink($memdump);
+
+ logmsg "*** Alloc number $limit is now set to fail ***\n" if($gdbthis);
+
+ my $ret = 0;
+ if($gdbthis) {
+ runclient($gdbline)
+ }
+ else {
+ $ret = runclient($testcmd);
+ }
+ #logmsg "$_ Returned " . $ret >> 8 . "\n";
+
+ # Now clear the variable again
+ delete $ENV{'CURL_MEMLIMIT'} if($ENV{'CURL_MEMLIMIT'});
+
+ if(-r "core") {
+ # there's core file present now!
+ logmsg " core dumped\n";
+ $dumped_core = 1;
+ $fail = 2;
+ }
+
+ # verify that it returns a proper error code, doesn't leak memory
+ # and doesn't core dump
+ if($ret & 255) {
+ logmsg " system() returned $ret\n";
+ $fail=1;
+ }
+ else {
+ my @memdata=`$memanalyze $memdump`;
+ my $leak=0;
+ for(@memdata) {
+ if($_ ne "") {
+ # well it could be other memory problems as well, but
+ # we call it leak for short here
+ $leak=1;
+ }
+ }
+ if($leak) {
+ logmsg "** MEMORY FAILURE\n";
+ logmsg @memdata;
+ logmsg `$memanalyze -l $memdump`;
+ $fail = 1;
+ }
+ }
+ if($fail) {
+ logmsg " Failed on alloc number $limit in test.\n",
+ " invoke with \"-t$limit\" to repeat this single case.\n";
+ stopservers($verbose);
+ return 1;
+ }
+ }
+
+ logmsg "torture OK\n";
+ return 0;
+}
+
+#######################################################################
+# Stop a test server along with pids which aren't in the %run hash yet.
+# This also stops all servers which are relative to the given one.
+#
+sub stopserver {
+ my ($server, $pidlist) = @_;
+ #
+ # kill sockfilter processes for pingpong relative server
+ #
+ if($server =~ /^(ftp|imap|pop3|smtp)s?(\d*)(-ipv6|)$/) {
+ my $proto = $1;
+ my $idnum = ($2 && ($2 > 1)) ? $2 : 1;
+ my $ipvnum = ($3 && ($3 =~ /6$/)) ? 6 : 4;
+ killsockfilters($proto, $ipvnum, $idnum, $verbose);
+ }
+ #
+ # All servers relative to the given one must be stopped also
+ #
+ my @killservers;
+ if($server =~ /^(ftp|http|imap|pop3|smtp)s(.*)$/) {
+ # given an ssl server, also kill non-ssl underlying one
+ push @killservers, "${1}${2}";
+ }
+ elsif($server =~ /^(ftp|http|imap|pop3|smtp)(.*)$/) {
+ # given a non-ssl server, also kill ssl piggybacking one
+ push @killservers, "${1}s${2}";
+ }
+ elsif($server =~ /^(socks)(.*)$/) {
+ # given an socks server, also kill ssh underlying one
+ push @killservers, "ssh${2}";
+ }
+ elsif($server =~ /^(ssh)(.*)$/) {
+ # given an ssh server, also kill socks piggybacking one
+ push @killservers, "socks${2}";
+ }
+ push @killservers, $server;
+ #
+ # kill given pids and server relative ones clearing them in %run hash
+ #
+ foreach my $server (@killservers) {
+ if($run{$server}) {
+ $pidlist .= "$run{$server} ";
+ $run{$server} = 0;
+ }
+ $runcert{$server} = 0 if($runcert{$server});
+ }
+ killpid($verbose, $pidlist);
+ #
+ # cleanup server pid files
+ #
+ foreach my $server (@killservers) {
+ my $pidfile = $serverpidfile{$server};
+ my $pid = processexists($pidfile);
+ if($pid > 0) {
+ logmsg "Warning: $server server unexpectedly alive\n";
+ killpid($verbose, $pid);
+ }
+ unlink($pidfile) if(-f $pidfile);
+ }
+}
+
+#######################################################################
+# Verify that the server that runs on $ip, $port is our server. This also
+# implies that we can speak with it, as there might be occasions when the
+# server runs fine but we cannot talk to it ("Failed to connect to ::1: Can't
+# assign requested address" #
+
+sub verifyhttp {
+ my ($proto, $ipvnum, $idnum, $ip, $port) = @_;
+ my $server = servername_id($proto, $ipvnum, $idnum);
+ my $pid = 0;
+ my $bonus="";
+
+ my $verifyout = "$LOGDIR/".
+ servername_canon($proto, $ipvnum, $idnum) .'_verify.out';
+ unlink($verifyout) if(-f $verifyout);
+
+ my $verifylog = "$LOGDIR/".
+ servername_canon($proto, $ipvnum, $idnum) .'_verify.log';
+ unlink($verifylog) if(-f $verifylog);
+
+ if($proto eq "gopher") {
+ # gopher is funny
+ $bonus="1/";
+ }
+
+ my $flags = "--max-time $server_response_maxtime ";
+ $flags .= "--output $verifyout ";
+ $flags .= "--silent ";
+ $flags .= "--verbose ";
+ $flags .= "--globoff ";
+ $flags .= "--insecure " if($proto eq 'https');
+ $flags .= "\"$proto://$ip:$port/${bonus}verifiedserver\"";
+
+ my $cmd = "$VCURL $flags 2>$verifylog";
+
+ # verify if our/any server is running on this port
+ logmsg "RUN: $cmd\n" if($verbose);
+ my $res = runclient($cmd);
+
+ $res >>= 8; # rotate the result
+ if($res & 128) {
+ logmsg "RUN: curl command died with a coredump\n";
+ return -1;
+ }
+
+ if($res && $verbose) {
+ logmsg "RUN: curl command returned $res\n";
+ if(open(FILE, "<$verifylog")) {
+ while(my $string = <FILE>) {
+ logmsg "RUN: $string" if($string !~ /^([ \t]*)$/);
+ }
+ close(FILE);
+ }
+ }
+
+ my $data;
+ if(open(FILE, "<$verifyout")) {
+ while(my $string = <FILE>) {
+ $data = $string;
+ last; # only want first line
+ }
+ close(FILE);
+ }
+
+ if($data && ($data =~ /WE ROOLZ: (\d+)/)) {
+ $pid = 0+$1;
+ }
+ elsif($res == 6) {
+ # curl: (6) Couldn't resolve host '::1'
+ logmsg "RUN: failed to resolve host ($proto://$ip:$port/verifiedserver)\n";
+ return -1;
+ }
+ elsif($data || ($res && ($res != 7))) {
+ logmsg "RUN: Unknown server on our $server port: $port ($res)\n";
+ return -1;
+ }
+ return $pid;
+}
+
+#######################################################################
+# Verify that the server that runs on $ip, $port is our server. This also
+# implies that we can speak with it, as there might be occasions when the
+# server runs fine but we cannot talk to it ("Failed to connect to ::1: Can't
+# assign requested address" #
+
+sub verifyftp {
+ my ($proto, $ipvnum, $idnum, $ip, $port) = @_;
+ my $server = servername_id($proto, $ipvnum, $idnum);
+ my $pid = 0;
+ my $time=time();
+ my $extra="";
+
+ my $verifylog = "$LOGDIR/".
+ servername_canon($proto, $ipvnum, $idnum) .'_verify.log';
+ unlink($verifylog) if(-f $verifylog);
+
+ if($proto eq "ftps") {
+ $extra .= "--insecure --ftp-ssl-control ";
+ }
+ elsif($proto eq "smtp") {
+ # SMTP is a bit different since it requires more options and it
+ # has _no_ output!
+ $extra .= "--mail-rcpt verifiedserver ";
+ $extra .= "--mail-from fake ";
+ $extra .= "--upload /dev/null ";
+ $extra .= "--stderr - "; # move stderr to parse the verbose stuff
+ }
+
+ my $flags = "--max-time $server_response_maxtime ";
+ $flags .= "--silent ";
+ $flags .= "--verbose ";
+ $flags .= "--globoff ";
+ $flags .= $extra;
+ $flags .= "\"$proto://$ip:$port/verifiedserver\"";
+
+ my $cmd = "$VCURL $flags 2>$verifylog";
+
+ # check if this is our server running on this port:
+ logmsg "RUN: $cmd\n" if($verbose);
+ my @data = runclientoutput($cmd);
+
+ my $res = $? >> 8; # rotate the result
+ if($res & 128) {
+ logmsg "RUN: curl command died with a coredump\n";
+ return -1;
+ }
+
+ foreach my $line (@data) {
+ if($line =~ /WE ROOLZ: (\d+)/) {
+ # this is our test server with a known pid!
+ $pid = 0+$1;
+ last;
+ }
+ }
+ if($pid <= 0 && @data && $data[0]) {
+ # this is not a known server
+ logmsg "RUN: Unknown server on our $server port: $port\n";
+ return 0;
+ }
+ # we can/should use the time it took to verify the FTP server as a measure
+ # on how fast/slow this host/FTP is.
+ my $took = int(0.5+time()-$time);
+
+ if($verbose) {
+ logmsg "RUN: Verifying our test $server server took $took seconds\n";
+ }
+ $ftpchecktime = $took>=1?$took:1; # make sure it never is below 1
+
+ return $pid;
+}
+
+#######################################################################
+# Verify that the server that runs on $ip, $port is our server. This also
+# implies that we can speak with it, as there might be occasions when the
+# server runs fine but we cannot talk to it ("Failed to connect to ::1: Can't
+# assign requested address" #
+
+sub verifyrtsp {
+ my ($proto, $ipvnum, $idnum, $ip, $port) = @_;
+ my $server = servername_id($proto, $ipvnum, $idnum);
+ my $pid = 0;
+
+ my $verifyout = "$LOGDIR/".
+ servername_canon($proto, $ipvnum, $idnum) .'_verify.out';
+ unlink($verifyout) if(-f $verifyout);
+
+ my $verifylog = "$LOGDIR/".
+ servername_canon($proto, $ipvnum, $idnum) .'_verify.log';
+ unlink($verifylog) if(-f $verifylog);
+
+ my $flags = "--max-time $server_response_maxtime ";
+ $flags .= "--output $verifyout ";
+ $flags .= "--silent ";
+ $flags .= "--verbose ";
+ $flags .= "--globoff ";
+ # currently verification is done using http
+ $flags .= "\"http://$ip:$port/verifiedserver\"";
+
+ my $cmd = "$VCURL $flags 2>$verifylog";
+
+ # verify if our/any server is running on this port
+ logmsg "RUN: $cmd\n" if($verbose);
+ my $res = runclient($cmd);
+
+ $res >>= 8; # rotate the result
+ if($res & 128) {
+ logmsg "RUN: curl command died with a coredump\n";
+ return -1;
+ }
+
+ if($res && $verbose) {
+ logmsg "RUN: curl command returned $res\n";
+ if(open(FILE, "<$verifylog")) {
+ while(my $string = <FILE>) {
+ logmsg "RUN: $string" if($string !~ /^([ \t]*)$/);
+ }
+ close(FILE);
+ }
+ }
+
+ my $data;
+ if(open(FILE, "<$verifyout")) {
+ while(my $string = <FILE>) {
+ $data = $string;
+ last; # only want first line
+ }
+ close(FILE);
+ }
+
+ if($data && ($data =~ /RTSP_SERVER WE ROOLZ: (\d+)/)) {
+ $pid = 0+$1;
+ }
+ elsif($res == 6) {
+ # curl: (6) Couldn't resolve host '::1'
+ logmsg "RUN: failed to resolve host ($proto://$ip:$port/verifiedserver)\n";
+ return -1;
+ }
+ elsif($data || ($res != 7)) {
+ logmsg "RUN: Unknown server on our $server port: $port\n";
+ return -1;
+ }
+ return $pid;
+}
+
+#######################################################################
+# Verify that the ssh server has written out its pidfile, recovering
+# the pid from the file and returning it if a process with that pid is
+# actually alive.
+
+sub verifyssh {
+ my ($proto, $ipvnum, $idnum, $ip, $port) = @_;
+ my $server = servername_id($proto, $ipvnum, $idnum);
+ my $pidfile = server_pidfilename($proto, $ipvnum, $idnum);
+ my $pid = 0;
+ if(open(FILE, "<$pidfile")) {
+ $pid=0+<FILE>;
+ close(FILE);
+ }
+ if($pid > 0) {
+ # if we have a pid it is actually our ssh server,
+ # since runsshserver() unlinks previous pidfile
+ if(!kill(0, $pid)) {
+ logmsg "RUN: SSH server has died after starting up\n";
+ checkdied($pid);
+ unlink($pidfile);
+ $pid = -1;
+ }
+ }
+ return $pid;
+}
+
+#######################################################################
+# Verify that we can connect to the sftp server, properly authenticate
+# with generated config and key files and run a simple remote pwd.
+
+sub verifysftp {
+ my ($proto, $ipvnum, $idnum, $ip, $port) = @_;
+ my $server = servername_id($proto, $ipvnum, $idnum);
+ my $verified = 0;
+ # Find out sftp client canonical file name
+ my $sftp = find_sftp();
+ if(!$sftp) {
+ logmsg "RUN: SFTP server cannot find $sftpexe\n";
+ return -1;
+ }
+ # Find out ssh client canonical file name
+ my $ssh = find_ssh();
+ if(!$ssh) {
+ logmsg "RUN: SFTP server cannot find $sshexe\n";
+ return -1;
+ }
+ # Connect to sftp server, authenticate and run a remote pwd
+ # command using our generated configuration and key files
+ my $cmd = "$sftp -b $sftpcmds -F $sftpconfig -S $ssh $ip > $sftplog 2>&1";
+ my $res = runclient($cmd);
+ # Search for pwd command response in log file
+ if(open(SFTPLOGFILE, "<$sftplog")) {
+ while(<SFTPLOGFILE>) {
+ if(/^Remote working directory: /) {
+ $verified = 1;
+ last;
+ }
+ }
+ close(SFTPLOGFILE);
+ }
+ return $verified;
+}
+
+
+#######################################################################
+# STUB for verifying socks
+
+sub verifysocks {
+ my ($proto, $ipvnum, $idnum, $ip, $port) = @_;
+ my $server = servername_id($proto, $ipvnum, $idnum);
+ my $pidfile = server_pidfilename($proto, $ipvnum, $idnum);
+ my $pid = 0;
+ if(open(FILE, "<$pidfile")) {
+ $pid=0+<FILE>;
+ close(FILE);
+ }
+ if($pid > 0) {
+ # if we have a pid it is actually our socks server,
+ # since runsocksserver() unlinks previous pidfile
+ if(!kill(0, $pid)) {
+ logmsg "RUN: SOCKS server has died after starting up\n";
+ checkdied($pid);
+ unlink($pidfile);
+ $pid = -1;
+ }
+ }
+ return $pid;
+}
+
+#######################################################################
+# Verify that the server that runs on $ip, $port is our server.
+# Retry over several seconds before giving up. The ssh server in
+# particular can take a long time to start if it needs to generate
+# keys on a slow or loaded host.
+#
+
+my %protofunc = ('http' => \&verifyhttp,
+ 'https' => \&verifyhttp,
+ 'rtsp' => \&verifyrtsp,
+ 'ftp' => \&verifyftp,
+ 'pop3' => \&verifyftp,
+ 'imap' => \&verifyftp,
+ 'smtp' => \&verifyftp,
+ 'ftps' => \&verifyftp,
+ 'tftp' => \&verifyftp,
+ 'ssh' => \&verifyssh,
+ 'socks' => \&verifysocks,
+ 'gopher' => \&verifyhttp);
+
+sub verifyserver {
+ my ($proto, $ipvnum, $idnum, $ip, $port) = @_;
+
+ my $count = 30; # try for this many seconds
+ my $pid;
+
+ while($count--) {
+ my $fun = $protofunc{$proto};
+
+ $pid = &$fun($proto, $ipvnum, $idnum, $ip, $port);
+
+ if($pid > 0) {
+ last;
+ }
+ elsif($pid < 0) {
+ # a real failure, stop trying and bail out
+ return 0;
+ }
+ sleep(1);
+ }
+ return $pid;
+}
+
+
+
+#######################################################################
+# start the http server
+#
+sub runhttpserver {
+ my ($proto, $verbose, $ipv6, $port) = @_;
+ my $ip = $HOSTIP;
+ my $ipvnum = 4;
+ my $idnum = 1;
+ my $server;
+ my $srvrname;
+ my $pidfile;
+ my $logfile;
+ my $flags = "";
+
+
+ if($ipv6) {
+ # if IPv6, use a different setup
+ $ipvnum = 6;
+ $ip = $HOST6IP;
+ }
+
+ $server = servername_id($proto, $ipvnum, $idnum);
+
+ $pidfile = $serverpidfile{$server};
+
+ # don't retry if the server doesn't work
+ if ($doesntrun{$pidfile}) {
+ return (0,0);
+ }
+
+ my $pid = processexists($pidfile);
+ if($pid > 0) {
+ stopserver($server, "$pid");
+ }
+ unlink($pidfile) if(-f $pidfile);
+
+ $srvrname = servername_str($proto, $ipvnum, $idnum);
+
+ $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
+
+ $flags .= "--fork " if($forkserver);
+ $flags .= "--gopher " if($proto eq "gopher");
+ $flags .= "--verbose " if($debugprotocol);
+ $flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
+ $flags .= "--id $idnum " if($idnum > 1);
+ $flags .= "--ipv$ipvnum --port $port --srcdir \"$srcdir\"";
+
+ my $cmd = "$perl $srcdir/httpserver.pl $flags";
+ my ($httppid, $pid2) = startnew($cmd, $pidfile, 15, 0);
+
+ if($httppid <= 0 || !kill(0, $httppid)) {
+ # it is NOT alive
+ logmsg "RUN: failed to start the $srvrname server\n";
+ stopserver($server, "$pid2");
+ displaylogs($testnumcheck);
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+
+ # Server is up. Verify that we can speak to it.
+ my $pid3 = verifyserver($proto, $ipvnum, $idnum, $ip, $port);
+ if(!$pid3) {
+ logmsg "RUN: $srvrname server failed verification\n";
+ # failed to talk to it properly. Kill the server and return failure
+ stopserver($server, "$httppid $pid2");
+ displaylogs($testnumcheck);
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+ $pid2 = $pid3;
+
+ if($verbose) {
+ logmsg "RUN: $srvrname server is now running PID $httppid\n";
+ }
+
+ sleep(1);
+
+ return ($httppid, $pid2);
+}
+
+#######################################################################
+# start the https server (or rather, tunnel)
+#
+sub runhttpsserver {
+ my ($verbose, $ipv6, $certfile) = @_;
+ my $proto = 'https';
+ my $ip = ($ipv6 && ($ipv6 =~ /6$/)) ? "$HOST6IP" : "$HOSTIP";
+ my $ipvnum = ($ipv6 && ($ipv6 =~ /6$/)) ? 6 : 4;
+ my $idnum = 1;
+ my $server;
+ my $srvrname;
+ my $pidfile;
+ my $logfile;
+ my $flags = "";
+
+ if(!$stunnel) {
+ return (0,0);
+ }
+
+ $server = servername_id($proto, $ipvnum, $idnum);
+
+ $pidfile = $serverpidfile{$server};
+
+ # don't retry if the server doesn't work
+ if ($doesntrun{$pidfile}) {
+ return (0,0);
+ }
+
+ my $pid = processexists($pidfile);
+ if($pid > 0) {
+ stopserver($server, "$pid");
+ }
+ unlink($pidfile) if(-f $pidfile);
+
+ $srvrname = servername_str($proto, $ipvnum, $idnum);
+
+ $certfile = 'stunnel.pem' unless($certfile);
+
+ $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
+
+ $flags .= "--verbose " if($debugprotocol);
+ $flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
+ $flags .= "--id $idnum " if($idnum > 1);
+ $flags .= "--ipv$ipvnum --proto $proto ";
+ $flags .= "--certfile \"$certfile\" " if($certfile ne 'stunnel.pem');
+ $flags .= "--stunnel \"$stunnel\" --srcdir \"$srcdir\" ";
+ $flags .= "--connect $HTTPPORT --accept $HTTPSPORT";
+
+ my $cmd = "$perl $srcdir/secureserver.pl $flags";
+ my ($httpspid, $pid2) = startnew($cmd, $pidfile, 15, 0);
+
+ if($httpspid <= 0 || !kill(0, $httpspid)) {
+ # it is NOT alive
+ logmsg "RUN: failed to start the $srvrname server\n";
+ stopserver($server, "$pid2");
+ displaylogs($testnumcheck);
+ $doesntrun{$pidfile} = 1;
+ return(0,0);
+ }
+
+ # Server is up. Verify that we can speak to it.
+ my $pid3 = verifyserver($proto, $ipvnum, $idnum, $ip, $HTTPSPORT);
+ if(!$pid3) {
+ logmsg "RUN: $srvrname server failed verification\n";
+ # failed to talk to it properly. Kill the server and return failure
+ stopserver($server, "$httpspid $pid2");
+ displaylogs($testnumcheck);
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+ # Here pid3 is actually the pid returned by the unsecure-http server.
+
+ $runcert{$server} = $certfile;
+
+ if($verbose) {
+ logmsg "RUN: $srvrname server is now running PID $httpspid\n";
+ }
+
+ sleep(1);
+
+ return ($httpspid, $pid2);
+}
+
+#######################################################################
+# start the pingpong server (FTP, POP3, IMAP, SMTP)
+#
+sub runpingpongserver {
+ my ($proto, $id, $verbose, $ipv6) = @_;
+ my $port;
+ my $ip = ($ipv6 && ($ipv6 =~ /6$/)) ? "$HOST6IP" : "$HOSTIP";
+ my $ipvnum = ($ipv6 && ($ipv6 =~ /6$/)) ? 6 : 4;
+ my $idnum = ($id && ($id =~ /^(\d+)$/) && ($id > 1)) ? $id : 1;
+ my $server;
+ my $srvrname;
+ my $pidfile;
+ my $logfile;
+ my $flags = "";
+
+ if($proto eq "ftp") {
+ $port = ($idnum>1)?$FTP2PORT:$FTPPORT;
+
+ if($ipvnum==6) {
+ # if IPv6, use a different setup
+ $port = $FTP6PORT;
+ }
+ }
+ elsif($proto eq "pop3") {
+ $port = ($ipvnum==6) ? $POP36PORT : $POP3PORT;
+ }
+ elsif($proto eq "imap") {
+ $port = ($ipvnum==6) ? $IMAP6PORT : $IMAPPORT;
+ }
+ elsif($proto eq "smtp") {
+ $port = ($ipvnum==6) ? $SMTP6PORT : $SMTPPORT;
+ }
+ else {
+ print STDERR "Unsupported protocol $proto!!\n";
+ return 0;
+ }
+
+ $server = servername_id($proto, $ipvnum, $idnum);
+
+ $pidfile = $serverpidfile{$server};
+
+ # don't retry if the server doesn't work
+ if ($doesntrun{$pidfile}) {
+ return (0,0);
+ }
+
+ my $pid = processexists($pidfile);
+ if($pid > 0) {
+ stopserver($server, "$pid");
+ }
+ unlink($pidfile) if(-f $pidfile);
+
+ $srvrname = servername_str($proto, $ipvnum, $idnum);
+
+ $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
+
+ $flags .= "--verbose " if($debugprotocol);
+ $flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
+ $flags .= "--srcdir \"$srcdir\" --proto $proto ";
+ $flags .= "--id $idnum " if($idnum > 1);
+ $flags .= "--ipv$ipvnum --port $port --addr \"$ip\"";
+
+ my $cmd = "$perl $srcdir/ftpserver.pl $flags";
+ my ($ftppid, $pid2) = startnew($cmd, $pidfile, 15, 0);
+
+ if($ftppid <= 0 || !kill(0, $ftppid)) {
+ # it is NOT alive
+ logmsg "RUN: failed to start the $srvrname server\n";
+ stopserver($server, "$pid2");
+ displaylogs($testnumcheck);
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+
+ # Server is up. Verify that we can speak to it.
+ my $pid3 = verifyserver($proto, $ipvnum, $idnum, $ip, $port);
+ if(!$pid3) {
+ logmsg "RUN: $srvrname server failed verification\n";
+ # failed to talk to it properly. Kill the server and return failure
+ stopserver($server, "$ftppid $pid2");
+ displaylogs($testnumcheck);
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+
+ $pid2 = $pid3;
+
+ if($verbose) {
+ logmsg "RUN: $srvrname server is now running PID $ftppid\n";
+ }
+
+ sleep(1);
+
+ return ($pid2, $ftppid);
+}
+
+#######################################################################
+# start the ftps server (or rather, tunnel)
+#
+sub runftpsserver {
+ my ($verbose, $ipv6, $certfile) = @_;
+ my $proto = 'ftps';
+ my $ip = ($ipv6 && ($ipv6 =~ /6$/)) ? "$HOST6IP" : "$HOSTIP";
+ my $ipvnum = ($ipv6 && ($ipv6 =~ /6$/)) ? 6 : 4;
+ my $idnum = 1;
+ my $server;
+ my $srvrname;
+ my $pidfile;
+ my $logfile;
+ my $flags = "";
+
+ if(!$stunnel) {
+ return (0,0);
+ }
+
+ $server = servername_id($proto, $ipvnum, $idnum);
+
+ $pidfile = $serverpidfile{$server};
+
+ # don't retry if the server doesn't work
+ if ($doesntrun{$pidfile}) {
+ return (0,0);
+ }
+
+ my $pid = processexists($pidfile);
+ if($pid > 0) {
+ stopserver($server, "$pid");
+ }
+ unlink($pidfile) if(-f $pidfile);
+
+ $srvrname = servername_str($proto, $ipvnum, $idnum);
+
+ $certfile = 'stunnel.pem' unless($certfile);
+
+ $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
+
+ $flags .= "--verbose " if($debugprotocol);
+ $flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
+ $flags .= "--id $idnum " if($idnum > 1);
+ $flags .= "--ipv$ipvnum --proto $proto ";
+ $flags .= "--certfile \"$certfile\" " if($certfile ne 'stunnel.pem');
+ $flags .= "--stunnel \"$stunnel\" --srcdir \"$srcdir\" ";
+ $flags .= "--connect $FTPPORT --accept $FTPSPORT";
+
+ my $cmd = "$perl $srcdir/secureserver.pl $flags";
+ my ($ftpspid, $pid2) = startnew($cmd, $pidfile, 15, 0);
+
+ if($ftpspid <= 0 || !kill(0, $ftpspid)) {
+ # it is NOT alive
+ logmsg "RUN: failed to start the $srvrname server\n";
+ stopserver($server, "$pid2");
+ displaylogs($testnumcheck);
+ $doesntrun{$pidfile} = 1;
+ return(0,0);
+ }
+
+ # Server is up. Verify that we can speak to it.
+ my $pid3 = verifyserver($proto, $ipvnum, $idnum, $ip, $FTPSPORT);
+ if(!$pid3) {
+ logmsg "RUN: $srvrname server failed verification\n";
+ # failed to talk to it properly. Kill the server and return failure
+ stopserver($server, "$ftpspid $pid2");
+ displaylogs($testnumcheck);
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+ # Here pid3 is actually the pid returned by the unsecure-ftp server.
+
+ $runcert{$server} = $certfile;
+
+ if($verbose) {
+ logmsg "RUN: $srvrname server is now running PID $ftpspid\n";
+ }
+
+ sleep(1);
+
+ return ($ftpspid, $pid2);
+}
+
+#######################################################################
+# start the tftp server
+#
+sub runtftpserver {
+ my ($id, $verbose, $ipv6) = @_;
+ my $port = $TFTPPORT;
+ my $ip = $HOSTIP;
+ my $proto = 'tftp';
+ my $ipvnum = 4;
+ my $idnum = ($id && ($id =~ /^(\d+)$/) && ($id > 1)) ? $id : 1;
+ my $server;
+ my $srvrname;
+ my $pidfile;
+ my $logfile;
+ my $flags = "";
+
+ if($ipv6) {
+ # if IPv6, use a different setup
+ $ipvnum = 6;
+ $port = $TFTP6PORT;
+ $ip = $HOST6IP;
+ }
+
+ $server = servername_id($proto, $ipvnum, $idnum);
+
+ $pidfile = $serverpidfile{$server};
+
+ # don't retry if the server doesn't work
+ if ($doesntrun{$pidfile}) {
+ return (0,0);
+ }
+
+ my $pid = processexists($pidfile);
+ if($pid > 0) {
+ stopserver($server, "$pid");
+ }
+ unlink($pidfile) if(-f $pidfile);
+
+ $srvrname = servername_str($proto, $ipvnum, $idnum);
+
+ $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
+
+ $flags .= "--verbose " if($debugprotocol);
+ $flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
+ $flags .= "--id $idnum " if($idnum > 1);
+ $flags .= "--ipv$ipvnum --port $port --srcdir \"$srcdir\"";
+
+ my $cmd = "$perl $srcdir/tftpserver.pl $flags";
+ my ($tftppid, $pid2) = startnew($cmd, $pidfile, 15, 0);
+
+ if($tftppid <= 0 || !kill(0, $tftppid)) {
+ # it is NOT alive
+ logmsg "RUN: failed to start the $srvrname server\n";
+ stopserver($server, "$pid2");
+ displaylogs($testnumcheck);
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+
+ # Server is up. Verify that we can speak to it.
+ my $pid3 = verifyserver($proto, $ipvnum, $idnum, $ip, $port);
+ if(!$pid3) {
+ logmsg "RUN: $srvrname server failed verification\n";
+ # failed to talk to it properly. Kill the server and return failure
+ stopserver($server, "$tftppid $pid2");
+ displaylogs($testnumcheck);
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+ $pid2 = $pid3;
+
+ if($verbose) {
+ logmsg "RUN: $srvrname server is now running PID $tftppid\n";
+ }
+
+ sleep(1);
+
+ return ($pid2, $tftppid);
+}
+
+
+#######################################################################
+# start the rtsp server
+#
+sub runrtspserver {
+ my ($verbose, $ipv6) = @_;
+ my $port = $RTSPPORT;
+ my $ip = $HOSTIP;
+ my $proto = 'rtsp';
+ my $ipvnum = 4;
+ my $idnum = 1;
+ my $server;
+ my $srvrname;
+ my $pidfile;
+ my $logfile;
+ my $flags = "";
+
+ if($ipv6) {
+ # if IPv6, use a different setup
+ $ipvnum = 6;
+ $port = $RTSP6PORT;
+ $ip = $HOST6IP;
+ }
+
+ $server = servername_id($proto, $ipvnum, $idnum);
+
+ $pidfile = $serverpidfile{$server};
+
+ # don't retry if the server doesn't work
+ if ($doesntrun{$pidfile}) {
+ return (0,0);
+ }
+
+ my $pid = processexists($pidfile);
+ if($pid > 0) {
+ stopserver($server, "$pid");
+ }
+ unlink($pidfile) if(-f $pidfile);
+
+ $srvrname = servername_str($proto, $ipvnum, $idnum);
+
+ $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
+
+ $flags .= "--verbose " if($debugprotocol);
+ $flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
+ $flags .= "--id $idnum " if($idnum > 1);
+ $flags .= "--ipv$ipvnum --port $port --srcdir \"$srcdir\"";
+
+ my $cmd = "$perl $srcdir/rtspserver.pl $flags";
+ my ($rtsppid, $pid2) = startnew($cmd, $pidfile, 15, 0);
+
+ if($rtsppid <= 0 || !kill(0, $rtsppid)) {
+ # it is NOT alive
+ logmsg "RUN: failed to start the $srvrname server\n";
+ stopserver($server, "$pid2");
+ displaylogs($testnumcheck);
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+
+ # Server is up. Verify that we can speak to it.
+ my $pid3 = verifyserver($proto, $ipvnum, $idnum, $ip, $port);
+ if(!$pid3) {
+ logmsg "RUN: $srvrname server failed verification\n";
+ # failed to talk to it properly. Kill the server and return failure
+ stopserver($server, "$rtsppid $pid2");
+ displaylogs($testnumcheck);
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+ $pid2 = $pid3;
+
+ if($verbose) {
+ logmsg "RUN: $srvrname server is now running PID $rtsppid\n";
+ }
+
+ sleep(1);
+
+ return ($rtsppid, $pid2);
+}
+
+
+#######################################################################
+# Start the ssh (scp/sftp) server
+#
+sub runsshserver {
+ my ($id, $verbose, $ipv6) = @_;
+ my $ip=$HOSTIP;
+ my $port = $SSHPORT;
+ my $socksport = $SOCKSPORT;
+ my $proto = 'ssh';
+ my $ipvnum = 4;
+ my $idnum = ($id && ($id =~ /^(\d+)$/) && ($id > 1)) ? $id : 1;
+ my $server;
+ my $srvrname;
+ my $pidfile;
+ my $logfile;
+ my $flags = "";
+
+ $server = servername_id($proto, $ipvnum, $idnum);
+
+ $pidfile = $serverpidfile{$server};
+
+ # don't retry if the server doesn't work
+ if ($doesntrun{$pidfile}) {
+ return (0,0);
+ }
+
+ my $pid = processexists($pidfile);
+ if($pid > 0) {
+ stopserver($server, "$pid");
+ }
+ unlink($pidfile) if(-f $pidfile);
+
+ $srvrname = servername_str($proto, $ipvnum, $idnum);
+
+ $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
+
+ $flags .= "--verbose " if($verbose);
+ $flags .= "--debugprotocol " if($debugprotocol);
+ $flags .= "--pidfile \"$pidfile\" ";
+ $flags .= "--id $idnum " if($idnum > 1);
+ $flags .= "--ipv$ipvnum --addr \"$ip\" ";
+ $flags .= "--sshport $port --socksport $socksport ";
+ $flags .= "--user \"$USER\"";
+
+ my $cmd = "$perl $srcdir/sshserver.pl $flags";
+ my ($sshpid, $pid2) = startnew($cmd, $pidfile, 60, 0);
+
+ # on loaded systems sshserver start up can take longer than the timeout
+ # passed to startnew, when this happens startnew completes without being
+ # able to read the pidfile and consequently returns a zero pid2 above.
+
+ if($sshpid <= 0 || !kill(0, $sshpid)) {
+ # it is NOT alive
+ logmsg "RUN: failed to start the $srvrname server\n";
+ stopserver($server, "$pid2");
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+
+ # ssh server verification allows some extra time for the server to start up
+ # and gives us the opportunity of recovering the pid from the pidfile, when
+ # this verification succeeds the recovered pid is assigned to pid2.
+
+ my $pid3 = verifyserver($proto, $ipvnum, $idnum, $ip, $port);
+ if(!$pid3) {
+ logmsg "RUN: $srvrname server failed verification\n";
+ # failed to fetch server pid. Kill the server and return failure
+ stopserver($server, "$sshpid $pid2");
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+ $pid2 = $pid3;
+
+ # once it is known that the ssh server is alive, sftp server verification
+ # is performed actually connecting to it, authenticating and performing a
+ # very simple remote command. This verification is tried only one time.
+
+ $sshdlog = server_logfilename($LOGDIR, 'ssh', $ipvnum, $idnum);
+ $sftplog = server_logfilename($LOGDIR, 'sftp', $ipvnum, $idnum);
+
+ if(verifysftp('sftp', $ipvnum, $idnum, $ip, $port) < 1) {
+ logmsg "RUN: SFTP server failed verification\n";
+ # failed to talk to it properly. Kill the server and return failure
+ display_sftplog();
+ display_sftpconfig();
+ display_sshdlog();
+ display_sshdconfig();
+ stopserver($server, "$sshpid $pid2");
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+
+ if($verbose) {
+ logmsg "RUN: $srvrname server is now running PID $pid2\n";
+ }
+
+ return ($pid2, $sshpid);
+}
+
+#######################################################################
+# Start the socks server
+#
+sub runsocksserver {
+ my ($id, $verbose, $ipv6) = @_;
+ my $ip=$HOSTIP;
+ my $port = $SOCKSPORT;
+ my $proto = 'socks';
+ my $ipvnum = 4;
+ my $idnum = ($id && ($id =~ /^(\d+)$/) && ($id > 1)) ? $id : 1;
+ my $server;
+ my $srvrname;
+ my $pidfile;
+ my $logfile;
+ my $flags = "";
+
+ $server = servername_id($proto, $ipvnum, $idnum);
+
+ $pidfile = $serverpidfile{$server};
+
+ # don't retry if the server doesn't work
+ if ($doesntrun{$pidfile}) {
+ return (0,0);
+ }
+
+ my $pid = processexists($pidfile);
+ if($pid > 0) {
+ stopserver($server, "$pid");
+ }
+ unlink($pidfile) if(-f $pidfile);
+
+ $srvrname = servername_str($proto, $ipvnum, $idnum);
+
+ $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
+
+ # The ssh server must be already running
+ if(!$run{'ssh'}) {
+ logmsg "RUN: SOCKS server cannot find running SSH server\n";
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+
+ # Find out ssh daemon canonical file name
+ my $sshd = find_sshd();
+ if(!$sshd) {
+ logmsg "RUN: SOCKS server cannot find $sshdexe\n";
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+
+ # Find out ssh daemon version info
+ ($sshdid, $sshdvernum, $sshdverstr, $sshderror) = sshversioninfo($sshd);
+ if(!$sshdid) {
+ # Not an OpenSSH or SunSSH ssh daemon
+ logmsg "$sshderror\n" if($verbose);
+ logmsg "SCP, SFTP and SOCKS tests require OpenSSH 2.9.9 or later\n";
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+ logmsg "ssh server found $sshd is $sshdverstr\n" if($verbose);
+
+ # Find out ssh client canonical file name
+ my $ssh = find_ssh();
+ if(!$ssh) {
+ logmsg "RUN: SOCKS server cannot find $sshexe\n";
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+
+ # Find out ssh client version info
+ my ($sshid, $sshvernum, $sshverstr, $ssherror) = sshversioninfo($ssh);
+ if(!$sshid) {
+ # Not an OpenSSH or SunSSH ssh client
+ logmsg "$ssherror\n" if($verbose);
+ logmsg "SCP, SFTP and SOCKS tests require OpenSSH 2.9.9 or later\n";
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+
+ # Verify minimum ssh client version
+ if((($sshid =~ /OpenSSH/) && ($sshvernum < 299)) ||
+ (($sshid =~ /SunSSH/) && ($sshvernum < 100))) {
+ logmsg "ssh client found $ssh is $sshverstr\n";
+ logmsg "SCP, SFTP and SOCKS tests require OpenSSH 2.9.9 or later\n";
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+ logmsg "ssh client found $ssh is $sshverstr\n" if($verbose);
+
+ # Verify if ssh client and ssh daemon versions match
+ if(($sshdid ne $sshid) || ($sshdvernum != $sshvernum)) {
+ # Our test harness might work with slightly mismatched versions
+ logmsg "Warning: version mismatch: sshd $sshdverstr - ssh $sshverstr\n"
+ if($verbose);
+ }
+
+ # Config file options for ssh client are previously set from sshserver.pl
+ if(! -e $sshconfig) {
+ logmsg "RUN: SOCKS server cannot find $sshconfig\n";
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+
+ $sshlog = server_logfilename($LOGDIR, 'socks', $ipvnum, $idnum);
+
+ # start our socks server
+ my $cmd="$ssh -N -F $sshconfig $ip > $sshlog 2>&1";
+ my ($sshpid, $pid2) = startnew($cmd, $pidfile, 30, 1);
+
+ if($sshpid <= 0 || !kill(0, $sshpid)) {
+ # it is NOT alive
+ logmsg "RUN: failed to start the $srvrname server\n";
+ display_sshlog();
+ display_sshconfig();
+ display_sshdlog();
+ display_sshdconfig();
+ stopserver($server, "$pid2");
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+
+ # Ugly hack but ssh doesn't support pid files
+ my $pid3 = verifyserver($proto, $ipvnum, $idnum, $ip, $port);
+ if(!$pid3) {
+ logmsg "RUN: $srvrname server failed verification\n";
+ # failed to talk to it properly. Kill the server and return failure
+ stopserver($server, "$sshpid $pid2");
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+ $pid2 = $pid3;
+
+ if($verbose) {
+ logmsg "RUN: $srvrname server is now running PID $pid2\n";
+ }
+
+ return ($pid2, $sshpid);
+}
+
+#######################################################################
+# Remove all files in the specified directory
+#
+sub cleardir {
+ my $dir = $_[0];
+ my $count;
+ my $file;
+
+ # Get all files
+ opendir(DIR, $dir) ||
+ return 0; # can't open dir
+ while($file = readdir(DIR)) {
+ if($file !~ /^\./) {
+ unlink("$dir/$file");
+ $count++;
+ }
+ }
+ closedir DIR;
+ return $count;
+}
+
+#######################################################################
+# filter out the specified pattern from the given input file and store the
+# results in the given output file
+#
+sub filteroff {
+ my $infile=$_[0];
+ my $filter=$_[1];
+ my $ofile=$_[2];
+
+ open(IN, "<$infile")
+ || return 1;
+
+ open(OUT, ">$ofile")
+ || return 1;
+
+ # logmsg "FILTER: off $filter from $infile to $ofile\n";
+
+ while(<IN>) {
+ $_ =~ s/$filter//;
+ print OUT $_;
+ }
+ close(IN);
+ close(OUT);
+ return 0;
+}
+
+#######################################################################
+# compare test results with the expected output, we might filter off
+# some pattern that is allowed to differ, output test results
+#
+
+sub compare {
+ # filter off patterns _before_ this comparison!
+ my ($subject, $firstref, $secondref)=@_;
+
+ my $result = compareparts($firstref, $secondref);
+
+ if($result) {
+ if(!$short) {
+ logmsg "\n $subject FAILED:\n";
+ logmsg showdiff($LOGDIR, $firstref, $secondref);
+ }
+ else {
+ logmsg "FAILED\n";
+ }
+ }
+ return $result;
+}
+
+#######################################################################
+# display information about curl and the host the test suite runs on
+#
+sub checksystem {
+
+ unlink($memdump); # remove this if there was one left
+
+ my $feat;
+ my $curl;
+ my $libcurl;
+ my $versretval;
+ my $versnoexec;
+ my @version=();
+
+ my $curlverout="$LOGDIR/curlverout.log";
+ my $curlvererr="$LOGDIR/curlvererr.log";
+ my $versioncmd="$CURL --version 1>$curlverout 2>$curlvererr";
+
+ unlink($curlverout);
+ unlink($curlvererr);
+
+ $versretval = runclient($versioncmd);
+ $versnoexec = $!;
+
+ open(VERSOUT, "<$curlverout");
+ @version = <VERSOUT>;
+ close(VERSOUT);
+
+ for(@version) {
+ chomp;
+
+ if($_ =~ /^curl/) {
+ $curl = $_;
+ $curl =~ s/^(.*)(libcurl.*)/$1/g;
+
+ $libcurl = $2;
+ if($curl =~ /mingw32/) {
+ # This is a windows minw32 build, we need to translate the
+ # given path to the "actual" windows path.
+
+ my @m = `mount`;
+ my $matchlen;
+ my $bestmatch;
+ my $mount;
+
+# example mount output:
+# C:\DOCUME~1\Temp on /tmp type user (binmode,noumount)
+# c:\ActiveState\perl on /perl type user (binmode)
+# C:\msys\1.0\bin on /usr/bin type user (binmode,cygexec,noumount)
+# C:\msys\1.0\bin on /bin type user (binmode,cygexec,noumount)
+
+ foreach $mount (@m) {
+ if( $mount =~ /(.*) on ([^ ]*) type /) {
+ my ($mingw, $real)=($2, $1);
+ if($pwd =~ /^$mingw/) {
+ # the path we got from pwd starts with the path
+ # we found on this line in the mount output
+
+ my $len = length($real);
+ if($len > $matchlen) {
+ # we remember the match that is the longest
+ $matchlen = $len;
+ $bestmatch = $real;
+ }
+ }
+ }
+ }
+ if(!$matchlen) {
+ logmsg "Serious error, can't find our \"real\" path\n";
+ }
+ else {
+ # now prepend the prefix from the mount command to build
+ # our "actual path"
+ $pwd = "$bestmatch$pwd";
+ }
+ $pwd =~ s#\\#/#g;
+ }
+ elsif ($curl =~ /win32/) {
+ # Native Windows builds don't understand the
+ # output of cygwin's pwd. It will be
+ # something like /cygdrive/c/<some path>.
+ #
+ # Use the cygpath utility to convert the
+ # working directory to a Windows friendly
+ # path. The -m option converts to use drive
+ # letter:, but it uses / instead \. Forward
+ # slashes (/) are easier for us. We don't
+ # have to escape them to get them to curl
+ # through a shell.
+ chomp($pwd = `cygpath -m $pwd`);
+ }
+ elsif ($libcurl =~ /openssl/i) {
+ $has_openssl=1;
+ $ssllib="OpenSSL";
+ }
+ elsif ($libcurl =~ /gnutls/i) {
+ $has_gnutls=1;
+ $ssllib="GnuTLS";
+ }
+ elsif ($libcurl =~ /nss/i) {
+ $has_nss=1;
+ $ssllib="NSS";
+ }
+ elsif ($libcurl =~ /yassl/i) {
+ $has_yassl=1;
+ $has_openssl=1;
+ $ssllib="yassl";
+ }
+ elsif ($libcurl =~ /polarssl/i) {
+ $has_polarssl=1;
+ $has_openssl=1;
+ $ssllib="polarssl";
+ }
+ }
+ elsif($_ =~ /^Protocols: (.*)/i) {
+ # these are the protocols compiled in to this libcurl
+ @protocols = split(' ', $1);
+
+ # Generate a "proto-ipv6" version of each protocol to match the
+ # IPv6 <server> name. This works even if IPv6 support isn't
+ # compiled in because the <features> test will fail.
+ push @protocols, map($_ . "-ipv6", @protocols);
+
+ # 'none' is used in test cases to mean no server
+ push @protocols, ('none');
+ }
+ elsif($_ =~ /^Features: (.*)/i) {
+ $feat = $1;
+ if($feat =~ /TrackMemory/i) {
+ # curl was built with --enable-curldebug (memory tracking)
+ $curl_debug = 1;
+ }
+ if($feat =~ /debug/i) {
+ # curl was built with --enable-debug
+ $debug_build = 1;
+ # set the NETRC debug env
+ $ENV{'CURL_DEBUG_NETRC'} = "$LOGDIR/netrc";
+ }
+ if($feat =~ /SSL/i) {
+ # ssl enabled
+ $ssl_version=1;
+ }
+ if($feat =~ /Largefile/i) {
+ # large file support
+ $large_file=1;
+ }
+ if($feat =~ /IDN/i) {
+ # IDN support
+ $has_idn=1;
+ }
+ if($feat =~ /IPv6/i) {
+ $has_ipv6 = 1;
+ }
+ if($feat =~ /libz/i) {
+ $has_libz = 1;
+ }
+ if($feat =~ /NTLM/i) {
+ # NTLM enabled
+ $has_ntlm=1;
+ }
+ if($feat =~ /CharConv/i) {
+ # CharConv enabled
+ $has_charconv=1;
+ }
+ }
+ }
+ if(!$curl) {
+ logmsg "unable to get curl's version, further details are:\n";
+ logmsg "issued command: \n";
+ logmsg "$versioncmd \n";
+ if ($versretval == -1) {
+ logmsg "command failed with: \n";
+ logmsg "$versnoexec \n";
+ }
+ elsif ($versretval & 127) {
+ logmsg sprintf("command died with signal %d, and %s coredump.\n",
+ ($versretval & 127), ($versretval & 128)?"a":"no");
+ }
+ else {
+ logmsg sprintf("command exited with value %d \n", $versretval >> 8);
+ }
+ logmsg "contents of $curlverout: \n";
+ displaylogcontent("$curlverout");
+ logmsg "contents of $curlvererr: \n";
+ displaylogcontent("$curlvererr");
+ die "couldn't get curl's version";
+ }
+
+ if(-r "../lib/curl_config.h") {
+ open(CONF, "<../lib/curl_config.h");
+ while(<CONF>) {
+ if($_ =~ /^\#define HAVE_GETRLIMIT/) {
+ $has_getrlimit = 1;
+ }
+ }
+ close(CONF);
+ }
+
+ if($has_ipv6) {
+ # client has ipv6 support
+
+ # check if the HTTP server has it!
+ my @sws = `server/sws --version`;
+ if($sws[0] =~ /IPv6/) {
+ # HTTP server has ipv6 support!
+ $http_ipv6 = 1;
+ $gopher_ipv6 = 1;
+ }
+
+ # check if the FTP server has it!
+ @sws = `server/sockfilt --version`;
+ if($sws[0] =~ /IPv6/) {
+ # FTP server has ipv6 support!
+ $ftp_ipv6 = 1;
+ }
+ }
+
+ if(!$curl_debug && $torture) {
+ die "can't run torture tests since curl was not built with curldebug";
+ }
+
+ $has_shared = `sh $CURLCONFIG --built-shared`;
+ chomp $has_shared;
+
+ # curl doesn't list cryptographic support separately, so assume it's
+ # always available
+ $has_crypto=1;
+
+ my $hostname=join(' ', runclientoutput("hostname"));
+ my $hosttype=join(' ', runclientoutput("uname -a"));
+
+ logmsg ("********* System characteristics ******** \n",
+ "* $curl\n",
+ "* $libcurl\n",
+ "* Features: $feat\n",
+ "* Host: $hostname",
+ "* System: $hosttype");
+
+ logmsg sprintf("* Server SSL: %8s", $stunnel?"ON ":"OFF");
+ logmsg sprintf(" libcurl SSL: %s\n", $ssl_version?"ON ":"OFF");
+ logmsg sprintf("* debug build: %8s", $debug_build?"ON ":"OFF");
+ logmsg sprintf(" track memory: %s\n", $curl_debug?"ON ":"OFF");
+ logmsg sprintf("* valgrind: %8s", $valgrind?"ON ":"OFF");
+ logmsg sprintf(" HTTP IPv6 %s\n", $http_ipv6?"ON ":"OFF");
+ logmsg sprintf("* FTP IPv6 %8s", $ftp_ipv6?"ON ":"OFF");
+ logmsg sprintf(" Libtool lib: %s\n", $libtool?"ON ":"OFF");
+ logmsg sprintf("* Shared build: %s\n", $has_shared);
+ if($ssl_version) {
+ logmsg sprintf("* SSL library: %13s\n", $ssllib);
+ }
+
+ logmsg "* Ports:\n";
+
+ logmsg sprintf("* HTTP/%d ", $HTTPPORT);
+ logmsg sprintf("FTP/%d ", $FTPPORT);
+ logmsg sprintf("FTP2/%d ", $FTP2PORT);
+ logmsg sprintf("RTSP/%d ", $RTSPPORT);
+ if($stunnel) {
+ logmsg sprintf("FTPS/%d ", $FTPSPORT);
+ logmsg sprintf("HTTPS/%d ", $HTTPSPORT);
+ }
+ logmsg sprintf("\n* TFTP/%d ", $TFTPPORT);
+ if($http_ipv6) {
+ logmsg sprintf("HTTP-IPv6/%d ", $HTTP6PORT);
+ logmsg sprintf("RTSP-IPv6/%d ", $RTSP6PORT);
+ }
+ if($ftp_ipv6) {
+ logmsg sprintf("FTP-IPv6/%d ", $FTP6PORT);
+ }
+ if($tftp_ipv6) {
+ logmsg sprintf("TFTP-IPv6/%d ", $TFTP6PORT);
+ }
+ logmsg sprintf("\n* GOPHER/%d ", $GOPHERPORT);
+ if($gopher_ipv6) {
+ logmsg sprintf("GOPHER-IPv6/%d", $GOPHERPORT);
+ }
+ logmsg sprintf("\n* SSH/%d ", $SSHPORT);
+ logmsg sprintf("SOCKS/%d ", $SOCKSPORT);
+ logmsg sprintf("POP3/%d ", $POP3PORT);
+ logmsg sprintf("IMAP/%d ", $IMAPPORT);
+ logmsg sprintf("SMTP/%d\n", $SMTPPORT);
+ if($ftp_ipv6) {
+ logmsg sprintf("* POP3-IPv6/%d ", $POP36PORT);
+ logmsg sprintf("IMAP-IPv6/%d ", $IMAP6PORT);
+ logmsg sprintf("SMTP-IPv6/%d\n", $SMTP6PORT);
+ }
+
+ $has_textaware = ($^O eq 'MSWin32') || ($^O eq 'msys');
+
+ logmsg "***************************************** \n";
+}
+
+#######################################################################
+# substitute the variable stuff into either a joined up file or
+# a command, in either case passed by reference
+#
+sub subVariables {
+ my ($thing) = @_;
+ $$thing =~ s/%HOSTIP/$HOSTIP/g;
+ $$thing =~ s/%HTTPPORT/$HTTPPORT/g;
+ $$thing =~ s/%HOST6IP/$HOST6IP/g;
+ $$thing =~ s/%HTTP6PORT/$HTTP6PORT/g;
+ $$thing =~ s/%HTTPSPORT/$HTTPSPORT/g;
+ $$thing =~ s/%FTPPORT/$FTPPORT/g;
+ $$thing =~ s/%FTP6PORT/$FTP6PORT/g;
+ $$thing =~ s/%FTP2PORT/$FTP2PORT/g;
+ $$thing =~ s/%FTPSPORT/$FTPSPORT/g;
+ $$thing =~ s/%SRCDIR/$srcdir/g;
+ $$thing =~ s/%PWD/$pwd/g;
+ $$thing =~ s/%TFTPPORT/$TFTPPORT/g;
+ $$thing =~ s/%TFTP6PORT/$TFTP6PORT/g;
+ $$thing =~ s/%SSHPORT/$SSHPORT/g;
+ $$thing =~ s/%SOCKSPORT/$SOCKSPORT/g;
+ $$thing =~ s/%POP3PORT/$POP3PORT/g;
+ $$thing =~ s/%POP36PORT/$POP36PORT/g;
+ $$thing =~ s/%IMAPPORT/$IMAPPORT/g;
+ $$thing =~ s/%IMAP6PORT/$IMAP6PORT/g;
+ $$thing =~ s/%SMTPPORT/$SMTPPORT/g;
+ $$thing =~ s/%SMTP6PORT/$SMTP6PORT/g;
+ $$thing =~ s/%CURL/$CURL/g;
+ $$thing =~ s/%USER/$USER/g;
+ $$thing =~ s/%CLIENTIP/$CLIENTIP/g;
+ $$thing =~ s/%CLIENT6IP/$CLIENT6IP/g;
+ $$thing =~ s/%RTSPPORT/$RTSPPORT/g;
+ $$thing =~ s/%RTSP6PORT/$RTSP6PORT/g;
+ $$thing =~ s/%GOPHERPORT/$GOPHERPORT/g;
+ $$thing =~ s/%GOPHER6PORT/$GOPHER6PORT/g;
+
+ # The purpose of FTPTIME2 and FTPTIME3 is to provide times that can be
+ # used for time-out tests and that whould work on most hosts as these
+ # adjust for the startup/check time for this particular host. We needed
+ # to do this to make the test suite run better on very slow hosts.
+
+ my $ftp2 = $ftpchecktime * 2;
+ my $ftp3 = $ftpchecktime * 3;
+
+ $$thing =~ s/%FTPTIME2/$ftp2/g;
+ $$thing =~ s/%FTPTIME3/$ftp3/g;
+}
+
+sub fixarray {
+ my @in = @_;
+
+ for(@in) {
+ subVariables \$_;
+ }
+ return @in;
+}
+
+#######################################################################
+# Provide time stamps for single test skipped events
+#
+sub timestampskippedevents {
+ my $testnum = $_[0];
+
+ return if((not defined($testnum)) || ($testnum < 1));
+
+ if($timestats) {
+
+ if($timevrfyend{$testnum}) {
+ return;
+ }
+ elsif($timesrvrlog{$testnum}) {
+ $timevrfyend{$testnum} = $timesrvrlog{$testnum};
+ return;
+ }
+ elsif($timetoolend{$testnum}) {
+ $timevrfyend{$testnum} = $timetoolend{$testnum};
+ $timesrvrlog{$testnum} = $timetoolend{$testnum};
+ }
+ elsif($timetoolini{$testnum}) {
+ $timevrfyend{$testnum} = $timetoolini{$testnum};
+ $timesrvrlog{$testnum} = $timetoolini{$testnum};
+ $timetoolend{$testnum} = $timetoolini{$testnum};
+ }
+ elsif($timesrvrend{$testnum}) {
+ $timevrfyend{$testnum} = $timesrvrend{$testnum};
+ $timesrvrlog{$testnum} = $timesrvrend{$testnum};
+ $timetoolend{$testnum} = $timesrvrend{$testnum};
+ $timetoolini{$testnum} = $timesrvrend{$testnum};
+ }
+ elsif($timesrvrini{$testnum}) {
+ $timevrfyend{$testnum} = $timesrvrini{$testnum};
+ $timesrvrlog{$testnum} = $timesrvrini{$testnum};
+ $timetoolend{$testnum} = $timesrvrini{$testnum};
+ $timetoolini{$testnum} = $timesrvrini{$testnum};
+ $timesrvrend{$testnum} = $timesrvrini{$testnum};
+ }
+ elsif($timeprepini{$testnum}) {
+ $timevrfyend{$testnum} = $timeprepini{$testnum};
+ $timesrvrlog{$testnum} = $timeprepini{$testnum};
+ $timetoolend{$testnum} = $timeprepini{$testnum};
+ $timetoolini{$testnum} = $timeprepini{$testnum};
+ $timesrvrend{$testnum} = $timeprepini{$testnum};
+ $timesrvrini{$testnum} = $timeprepini{$testnum};
+ }
+ }
+}
+
+#######################################################################
+# Run a single specified test case
+#
+sub singletest {
+ my ($testnum, $count, $total)=@_;
+
+ my @what;
+ my $why;
+ my %feature;
+ my $cmd;
+ my $disablevalgrind;
+
+ # copy test number to a global scope var, this allows
+ # testnum checking when starting test harness servers.
+ $testnumcheck = $testnum;
+
+ # timestamp test preparation start
+ $timeprepini{$testnum} = Time::HiRes::time() if($timestats);
+
+ if($disttests !~ /test$testnum\W/ ) {
+ logmsg "Warning: test$testnum not present in tests/data/Makefile.am\n";
+ }
+
+ # load the test case file definition
+ if(loadtest("${TESTDIR}/test${testnum}")) {
+ if($verbose) {
+ # this is not a test
+ logmsg "RUN: $testnum doesn't look like a test case\n";
+ }
+ $why = "no test";
+ }
+ else {
+ @what = getpart("client", "features");
+ }
+
+ for(@what) {
+ my $f = $_;
+ $f =~ s/\s//g;
+
+ $feature{$f}=$f; # we require this feature
+
+ if($f eq "SSL") {
+ if($ssl_version) {
+ next;
+ }
+ }
+ elsif($f eq "OpenSSL") {
+ if($has_openssl) {
+ next;
+ }
+ }
+ elsif($f eq "GnuTLS") {
+ if($has_gnutls) {
+ next;
+ }
+ }
+ elsif($f eq "NSS") {
+ if($has_nss) {
+ next;
+ }
+ }
+ elsif($f eq "netrc_debug") {
+ if($debug_build) {
+ next;
+ }
+ }
+ elsif($f eq "large_file") {
+ if($large_file) {
+ next;
+ }
+ }
+ elsif($f eq "idn") {
+ if($has_idn) {
+ next;
+ }
+ }
+ elsif($f eq "ipv6") {
+ if($has_ipv6) {
+ next;
+ }
+ }
+ elsif($f eq "libz") {
+ if($has_libz) {
+ next;
+ }
+ }
+ elsif($f eq "NTLM") {
+ if($has_ntlm) {
+ next;
+ }
+ }
+ elsif($f eq "getrlimit") {
+ if($has_getrlimit) {
+ next;
+ }
+ }
+ elsif($f eq "crypto") {
+ if($has_crypto) {
+ next;
+ }
+ }
+ elsif($f eq "socks") {
+ next;
+ }
+ # See if this "feature" is in the list of supported protocols
+ elsif (grep /^$f$/, @protocols) {
+ next;
+ }
+
+ $why = "curl lacks $f support";
+ last;
+ }
+
+ if(!$why) {
+ my @keywords = getpart("info", "keywords");
+ my $match;
+ my $k;
+ for $k (@keywords) {
+ chomp $k;
+ if ($disabled_keywords{$k}) {
+ $why = "disabled by keyword";
+ } elsif ($enabled_keywords{$k}) {
+ $match = 1;
+ }
+ }
+
+ if(!$why && !$match && %enabled_keywords) {
+ $why = "disabled by missing keyword";
+ }
+ }
+
+ # test definition may instruct to (un)set environment vars
+ # this is done this early, so that the precheck can use environment
+ # variables and still bail out fine on errors
+
+ # restore environment variables that were modified in a previous run
+ foreach my $var (keys %oldenv) {
+ if($oldenv{$var} eq 'notset') {
+ delete $ENV{$var} if($ENV{$var});
+ }
+ else {
+ $ENV{$var} = $oldenv{$var};
+ }
+ delete $oldenv{$var};
+ }
+
+ # timestamp required servers verification start
+ $timesrvrini{$testnum} = Time::HiRes::time() if($timestats);
+
+ if(!$why) {
+ $why = serverfortest($testnum);
+ }
+
+ # timestamp required servers verification end
+ $timesrvrend{$testnum} = Time::HiRes::time() if($timestats);
+
+ my @setenv = getpart("client", "setenv");
+ if(@setenv) {
+ foreach my $s (@setenv) {
+ chomp $s;
+ subVariables \$s;
+ if($s =~ /([^=]*)=(.*)/) {
+ my ($var, $content) = ($1, $2);
+ # remember current setting, to restore it once test runs
+ $oldenv{$var} = ($ENV{$var})?"$ENV{$var}":'notset';
+ # set new value
+ if(!$content) {
+ delete $ENV{$var} if($ENV{$var});
+ }
+ else {
+ if(($var =~ /^LD_PRELOAD/) &&
+ ($debug_build || ($has_shared ne "yes"))) {
+ # print "Skipping LD_PRELOAD due to no release shared build\n";
+ next;
+ }
+ $ENV{$var} = "$content";
+ }
+ }
+ }
+ }
+
+ if(!$why) {
+ # TODO:
+ # Add a precheck cache. If a precheck command was already invoked
+ # exactly like this, then use the previous result to speed up
+ # successive test invokes!
+
+ my @precheck = getpart("client", "precheck");
+ if(@precheck) {
+ $cmd = $precheck[0];
+ chomp $cmd;
+ subVariables \$cmd;
+ if($cmd) {
+ my @p = split(/ /, $cmd);
+ if($p[0] !~ /\//) {
+ # the first word, the command, does not contain a slash so
+ # we will scan the "improved" PATH to find the command to
+ # be able to run it
+ my $fullp = checktestcmd($p[0]);
+
+ if($fullp) {
+ $p[0] = $fullp;
+ }
+ $cmd = join(" ", @p);
+ }
+
+ my @o = `$cmd 2>/dev/null`;
+ if($o[0]) {
+ $why = $o[0];
+ chomp $why;
+ } elsif($?) {
+ $why = "precheck command error";
+ }
+ logmsg "prechecked $cmd\n" if($verbose);
+ }
+ }
+ }
+
+ if($why && !$listonly) {
+ # there's a problem, count it as "skipped"
+ $skipped++;
+ $skipped{$why}++;
+ $teststat[$testnum]=$why; # store reason for this test case
+
+ if(!$short) {
+ printf "test %03d SKIPPED: $why\n", $testnum;
+ }
+
+ timestampskippedevents($testnum);
+ return -1;
+ }
+ logmsg sprintf("test %03d...", $testnum);
+
+ # extract the reply data
+ my @reply = getpart("reply", "data");
+ my @replycheck = getpart("reply", "datacheck");
+
+ if (@replycheck) {
+ # we use this file instead to check the final output against
+
+ my %hash = getpartattr("reply", "datacheck");
+ if($hash{'nonewline'}) {
+ # Yes, we must cut off the final newline from the final line
+ # of the datacheck
+ chomp($replycheck[$#replycheck]);
+ }
+
+ @reply=@replycheck;
+ }
+
+ # this is the valid protocol blurb curl should generate
+ my @protocol= fixarray ( getpart("verify", "protocol") );
+
+ # redirected stdout/stderr to these files
+ $STDOUT="$LOGDIR/stdout$testnum";
+ $STDERR="$LOGDIR/stderr$testnum";
+
+ # if this section exists, we verify that the stdout contained this:
+ my @validstdout = fixarray ( getpart("verify", "stdout") );
+
+ # if this section exists, we verify upload
+ my @upload = getpart("verify", "upload");
+
+ # if this section exists, it might be FTP server instructions:
+ my @ftpservercmd = getpart("reply", "servercmd");
+
+ my $CURLOUT="$LOGDIR/curl$testnum.out"; # curl output if not stdout
+
+ # name of the test
+ my @testname= getpart("client", "name");
+
+ if(!$short) {
+ my $name = $testname[0];
+ $name =~ s/\n//g;
+ logmsg "[$name]\n";
+ }
+
+ if($listonly) {
+ timestampskippedevents($testnum);
+ return 0; # look successful
+ }
+
+ my @codepieces = getpart("client", "tool");
+
+ my $tool="";
+ if(@codepieces) {
+ $tool = $codepieces[0];
+ chomp $tool;
+ }
+
+ # remove server output logfiles
+ unlink($SERVERIN);
+ unlink($SERVER2IN);
+
+ if(@ftpservercmd) {
+ # write the instructions to file
+ writearray($FTPDCMD, \@ftpservercmd);
+ }
+
+ # get the command line options to use
+ my @blaha;
+ ($cmd, @blaha)= getpart("client", "command");
+
+ if($cmd) {
+ # make some nice replace operations
+ $cmd =~ s/\n//g; # no newlines please
+ # substitute variables in the command line
+ subVariables \$cmd;
+ }
+ if($curl_debug) {
+ unlink($memdump);
+ }
+
+ # create a (possibly-empty) file before starting the test
+ my @inputfile=getpart("client", "file");
+ my %fileattr = getpartattr("client", "file");
+ my $filename=$fileattr{'name'};
+ if(@inputfile || $filename) {
+ if(!$filename) {
+ logmsg "ERROR: section client=>file has no name attribute\n";
+ timestampskippedevents($testnum);
+ return -1;
+ }
+ my $fileContent = join('', @inputfile);
+ subVariables \$fileContent;
+# logmsg "DEBUG: writing file " . $filename . "\n";
+ open(OUTFILE, ">$filename");
+ binmode OUTFILE; # for crapage systems, use binary
+ print OUTFILE $fileContent;
+ close(OUTFILE);
+ }
+
+ my %cmdhash = getpartattr("client", "command");
+
+ my $out="";
+
+ if((!$cmdhash{'option'}) || ($cmdhash{'option'} !~ /no-output/)) {
+ #We may slap on --output!
+ if (!@validstdout) {
+ $out=" --output $CURLOUT ";
+ }
+ }
+
+ my $serverlogslocktimeout = $defserverlogslocktimeout;
+ if($cmdhash{'timeout'}) {
+ # test is allowed to override default server logs lock timeout
+ if($cmdhash{'timeout'} =~ /(\d+)/) {
+ $serverlogslocktimeout = $1 if($1 >= 0);
+ }
+ }
+
+ my $postcommanddelay = $defpostcommanddelay;
+ if($cmdhash{'delay'}) {
+ # test is allowed to specify a delay after command is executed
+ if($cmdhash{'delay'} =~ /(\d+)/) {
+ $postcommanddelay = $1 if($1 > 0);
+ }
+ }
+
+ my $CMDLINE;
+ my $cmdargs;
+ my $cmdtype = $cmdhash{'type'} || "default";
+ if($cmdtype eq "perl") {
+ # run the command line prepended with "perl"
+ $cmdargs ="$cmd";
+ $CMDLINE = "perl ";
+ $tool=$CMDLINE;
+ $disablevalgrind=1;
+ }
+ elsif(!$tool) {
+ # run curl, add --verbose for debug information output
+ $cmdargs ="$out --include --verbose --trace-time $cmd";
+ }
+ else {
+ $cmdargs = " $cmd"; # $cmd is the command line for the test file
+ $CURLOUT = $STDOUT; # sends received data to stdout
+
+ $CMDLINE="$LIBDIR/$tool";
+ if(! -f $CMDLINE) {
+ print "The tool set in the test case for this: '$tool' does not exist\n";
+ timestampskippedevents($testnum);
+ return -1;
+ }
+ $DBGCURL=$CMDLINE;
+ }
+
+ my @stdintest = getpart("client", "stdin");
+
+ if(@stdintest) {
+ my $stdinfile="$LOGDIR/stdin-for-$testnum";
+ writearray($stdinfile, \@stdintest);
+
+ $cmdargs .= " <$stdinfile";
+ }
+
+ if(!$tool) {
+ $CMDLINE="$CURL";
+ }
+
+ my $usevalgrind;
+ if($valgrind && !$disablevalgrind) {
+ my @valgrindoption = getpart("verify", "valgrind");
+ if((!@valgrindoption) || ($valgrindoption[0] !~ /disable/)) {
+ $usevalgrind = 1;
+ my $valgrindcmd = "$valgrind ";
+ $valgrindcmd .= "$valgrind_tool " if($valgrind_tool);
+ $valgrindcmd .= "--leak-check=yes ";
+ $valgrindcmd .= "--num-callers=16 ";
+ $valgrindcmd .= "${valgrind_logfile}=$LOGDIR/valgrind$testnum";
+ $CMDLINE = "$valgrindcmd $CMDLINE";
+ }
+ }
+
+ $CMDLINE .= "$cmdargs >$STDOUT 2>$STDERR";
+
+ if($verbose) {
+ logmsg "$CMDLINE\n";
+ }
+
+ print CMDLOG "$CMDLINE\n";
+
+ unlink("core");
+
+ my $dumped_core;
+ my $cmdres;
+
+ # Apr 2007: precommand isn't being used and could be removed
+ my @precommand= getpart("client", "precommand");
+ if($precommand[0]) {
+ # this is pure perl to eval!
+ my $code = join("", @precommand);
+ eval $code;
+ if($@) {
+ logmsg "perl: $code\n";
+ logmsg "precommand: $@";
+ stopservers($verbose);
+ timestampskippedevents($testnum);
+ return -1;
+ }
+ }
+
+ if($gdbthis) {
+ my $gdbinit = "$TESTDIR/gdbinit$testnum";
+ open(GDBCMD, ">$LOGDIR/gdbcmd");
+ print GDBCMD "set args $cmdargs\n";
+ print GDBCMD "show args\n";
+ print GDBCMD "source $gdbinit\n" if -e $gdbinit;
+ close(GDBCMD);
+ }
+
+ # timestamp starting of test command
+ $timetoolini{$testnum} = Time::HiRes::time() if($timestats);
+
+ # run the command line we built
+ if ($torture) {
+ $cmdres = torture($CMDLINE,
+ "$gdb --directory libtest $DBGCURL -x $LOGDIR/gdbcmd");
+ }
+ elsif($gdbthis) {
+ runclient("$gdb --directory libtest $DBGCURL -x $LOGDIR/gdbcmd");
+ $cmdres=0; # makes it always continue after a debugged run
+ }
+ else {
+ $cmdres = runclient("$CMDLINE");
+ my $signal_num = $cmdres & 127;
+ $dumped_core = $cmdres & 128;
+
+ if(!$anyway && ($signal_num || $dumped_core)) {
+ $cmdres = 1000;
+ }
+ else {
+ $cmdres >>= 8;
+ $cmdres = (2000 + $signal_num) if($signal_num && !$cmdres);
+ }
+ }
+
+ # timestamp finishing of test command
+ $timetoolend{$testnum} = Time::HiRes::time() if($timestats);
+
+ if(!$dumped_core) {
+ if(-r "core") {
+ # there's core file present now!
+ $dumped_core = 1;
+ }
+ }
+
+ if($dumped_core) {
+ logmsg "core dumped\n";
+ if(0 && $gdb) {
+ logmsg "running gdb for post-mortem analysis:\n";
+ open(GDBCMD, ">$LOGDIR/gdbcmd2");
+ print GDBCMD "bt\n";
+ close(GDBCMD);
+ runclient("$gdb --directory libtest -x $LOGDIR/gdbcmd2 -batch $DBGCURL core ");
+ # unlink("$LOGDIR/gdbcmd2");
+ }
+ }
+
+ # If a server logs advisor read lock file exists, it is an indication
+ # that the server has not yet finished writing out all its log files,
+ # including server request log files used for protocol verification.
+ # So, if the lock file exists the script waits here a certain amount
+ # of time until the server removes it, or the given time expires.
+
+ if($serverlogslocktimeout) {
+ my $lockretry = $serverlogslocktimeout * 20;
+ while((-f $SERVERLOGS_LOCK) && $lockretry--) {
+ select(undef, undef, undef, 0.05);
+ }
+ if(($lockretry < 0) &&
+ ($serverlogslocktimeout >= $defserverlogslocktimeout)) {
+ logmsg "Warning: server logs lock timeout ",
+ "($serverlogslocktimeout seconds) expired\n";
+ }
+ }
+
+ # Test harness ssh server does not have this synchronization mechanism,
+ # this implies that some ssh server based tests might need a small delay
+ # once that the client command has run to avoid false test failures.
+
+ sleep($postcommanddelay) if($postcommanddelay);
+
+ # timestamp removal of server logs advisor read lock
+ $timesrvrlog{$testnum} = Time::HiRes::time() if($timestats);
+
+ # test definition might instruct to stop some servers
+ # stop also all servers relative to the given one
+
+ my @killtestservers = getpart("client", "killserver");
+ if(@killtestservers) {
+ #
+ # All servers relative to the given one must be stopped also
+ #
+ my @killservers;
+ foreach my $server (@killtestservers) {
+ chomp $server;
+ if($server =~ /^(ftp|http|imap|pop3|smtp)s(.*)$/) {
+ # given an ssl server, also kill non-ssl underlying one
+ push @killservers, "${1}${2}";
+ }
+ elsif($server =~ /^(ftp|http|imap|pop3|smtp)(.*)$/) {
+ # given a non-ssl server, also kill ssl piggybacking one
+ push @killservers, "${1}s${2}";
+ }
+ elsif($server =~ /^(socks)(.*)$/) {
+ # given an socks server, also kill ssh underlying one
+ push @killservers, "ssh${2}";
+ }
+ elsif($server =~ /^(ssh)(.*)$/) {
+ # given an ssh server, also kill socks piggybacking one
+ push @killservers, "socks${2}";
+ }
+ push @killservers, $server;
+ }
+ #
+ # kill sockfilter processes for pingpong relative servers
+ #
+ foreach my $server (@killservers) {
+ if($server =~ /^(ftp|imap|pop3|smtp)s?(\d*)(-ipv6|)$/) {
+ my $proto = $1;
+ my $idnum = ($2 && ($2 > 1)) ? $2 : 1;
+ my $ipvnum = ($3 && ($3 =~ /6$/)) ? 6 : 4;
+ killsockfilters($proto, $ipvnum, $idnum, $verbose);
+ }
+ }
+ #
+ # kill server relative pids clearing them in %run hash
+ #
+ my $pidlist;
+ foreach my $server (@killservers) {
+ if($run{$server}) {
+ $pidlist .= "$run{$server} ";
+ $run{$server} = 0;
+ }
+ $runcert{$server} = 0 if($runcert{$server});
+ }
+ killpid($verbose, $pidlist);
+ #
+ # cleanup server pid files
+ #
+ foreach my $server (@killservers) {
+ my $pidfile = $serverpidfile{$server};
+ my $pid = processexists($pidfile);
+ if($pid > 0) {
+ logmsg "Warning: $server server unexpectedly alive\n";
+ killpid($verbose, $pid);
+ }
+ unlink($pidfile) if(-f $pidfile);
+ }
+ }
+
+ # remove the test server commands file after each test
+ unlink($FTPDCMD);
+
+ # run the postcheck command
+ my @postcheck= getpart("client", "postcheck");
+ if(@postcheck) {
+ $cmd = $postcheck[0];
+ chomp $cmd;
+ subVariables \$cmd;
+ if($cmd) {
+ logmsg "postcheck $cmd\n" if($verbose);
+ my $rc = runclient("$cmd");
+ # Must run the postcheck command in torture mode in order
+ # to clean up, but the result can't be relied upon.
+ if($rc != 0 && !$torture) {
+ logmsg " postcheck FAILED\n";
+ # timestamp test result verification end
+ $timevrfyend{$testnum} = Time::HiRes::time() if($timestats);
+ return 1;
+ }
+ }
+ }
+
+ # restore environment variables that were modified
+ if(%oldenv) {
+ foreach my $var (keys %oldenv) {
+ if($oldenv{$var} eq 'notset') {
+ delete $ENV{$var} if($ENV{$var});
+ }
+ else {
+ $ENV{$var} = "$oldenv{$var}";
+ }
+ }
+ }
+
+ # Skip all the verification on torture tests
+ if ($torture) {
+ if(!$cmdres && !$keepoutfiles) {
+ cleardir($LOGDIR);
+ }
+ # timestamp test result verification end
+ $timevrfyend{$testnum} = Time::HiRes::time() if($timestats);
+ return $cmdres;
+ }
+
+ my @err = getpart("verify", "errorcode");
+ my $errorcode = $err[0] || "0";
+ my $ok="";
+ my $res;
+ if (@validstdout) {
+ # verify redirected stdout
+ my @actual = loadarray($STDOUT);
+
+ # variable-replace in the stdout we have from the test case file
+ @validstdout = fixarray(@validstdout);
+
+ # get all attributes
+ my %hash = getpartattr("verify", "stdout");
+
+ # get the mode attribute
+ my $filemode=$hash{'mode'};
+ if($filemode && ($filemode eq "text") && $has_textaware) {
+ # text mode when running on windows: fix line endings
+ map s/\r\n/\n/g, @actual;
+ }
+
+ if($hash{'nonewline'}) {
+ # Yes, we must cut off the final newline from the final line
+ # of the protocol data
+ chomp($validstdout[$#validstdout]);
+ }
+
+ $res = compare("stdout", \@actual, \@validstdout);
+ if($res) {
+ # timestamp test result verification end
+ $timevrfyend{$testnum} = Time::HiRes::time() if($timestats);
+ return 1;
+ }
+ $ok .= "s";
+ }
+ else {
+ $ok .= "-"; # stdout not checked
+ }
+
+ my %replyattr = getpartattr("reply", "data");
+ if(!$replyattr{'nocheck'} && (@reply || $replyattr{'sendzero'})) {
+ # verify the received data
+ my @out = loadarray($CURLOUT);
+ my %hash = getpartattr("reply", "data");
+ # get the mode attribute
+ my $filemode=$hash{'mode'};
+ if($filemode && ($filemode eq "text") && $has_textaware) {
+ # text mode when running on windows: fix line endings
+ map s/\r\n/\n/g, @out;
+ }
+
+ $res = compare("data", \@out, \@reply);
+ if ($res) {
+ # timestamp test result verification end
+ $timevrfyend{$testnum} = Time::HiRes::time() if($timestats);
+ return 1;
+ }
+ $ok .= "d";
+ }
+ else {
+ $ok .= "-"; # data not checked
+ }
+
+ if(@upload) {
+ # verify uploaded data
+ my @out = loadarray("$LOGDIR/upload.$testnum");
+ $res = compare("upload", \@out, \@upload);
+ if ($res) {
+ # timestamp test result verification end
+ $timevrfyend{$testnum} = Time::HiRes::time() if($timestats);
+ return 1;
+ }
+ $ok .= "u";
+ }
+ else {
+ $ok .= "-"; # upload not checked
+ }
+
+ if(@protocol) {
+ # Verify the sent request
+ my @out = loadarray($SERVERIN);
+
+ # what to cut off from the live protocol sent by curl
+ my @strip = getpart("verify", "strip");
+
+ my @protstrip=@protocol;
+
+ # check if there's any attributes on the verify/protocol section
+ my %hash = getpartattr("verify", "protocol");
+
+ if($hash{'nonewline'}) {
+ # Yes, we must cut off the final newline from the final line
+ # of the protocol data
+ chomp($protstrip[$#protstrip]);
+ }
+
+ for(@strip) {
+ # strip off all lines that match the patterns from both arrays
+ chomp $_;
+ @out = striparray( $_, \@out);
+ @protstrip= striparray( $_, \@protstrip);
+ }
+
+ # what parts to cut off from the protocol
+ my @strippart = getpart("verify", "strippart");
+ my $strip;
+ for $strip (@strippart) {
+ chomp $strip;
+ for(@out) {
+ eval $strip;
+ }
+ }
+
+ $res = compare("protocol", \@out, \@protstrip);
+ if($res) {
+ # timestamp test result verification end
+ $timevrfyend{$testnum} = Time::HiRes::time() if($timestats);
+ return 1;
+ }
+
+ $ok .= "p";
+
+ }
+ else {
+ $ok .= "-"; # protocol not checked
+ }
+
+ my @outfile=getpart("verify", "file");
+ if(@outfile) {
+ # we're supposed to verify a dynamically generated file!
+ my %hash = getpartattr("verify", "file");
+
+ my $filename=$hash{'name'};
+ if(!$filename) {
+ logmsg "ERROR: section verify=>file has no name attribute\n";
+ stopservers($verbose);
+ # timestamp test result verification end
+ $timevrfyend{$testnum} = Time::HiRes::time() if($timestats);
+ return -1;
+ }
+ my @generated=loadarray($filename);
+
+ # what parts to cut off from the file
+ my @stripfile = getpart("verify", "stripfile");
+
+ my $filemode=$hash{'mode'};
+ if($filemode && ($filemode eq "text") && $has_textaware) {
+ # text mode when running on windows means adding an extra
+ # strip expression
+ push @stripfile, "s/\r\n/\n/";
+ }
+
+ my $strip;
+ for $strip (@stripfile) {
+ chomp $strip;
+ for(@generated) {
+ eval $strip;
+ }
+ }
+
+ @outfile = fixarray(@outfile);
+
+ $res = compare("output", \@generated, \@outfile);
+ if($res) {
+ # timestamp test result verification end
+ $timevrfyend{$testnum} = Time::HiRes::time() if($timestats);
+ return 1;
+ }
+
+ $ok .= "o";
+ }
+ else {
+ $ok .= "-"; # output not checked
+ }
+
+ # accept multiple comma-separated error codes
+ my @splerr = split(/ *, */, $errorcode);
+ my $errok;
+ foreach my $e (@splerr) {
+ if($e == $cmdres) {
+ # a fine error code
+ $errok = 1;
+ last;
+ }
+ }
+
+ if($errok) {
+ $ok .= "e";
+ }
+ else {
+ if(!$short) {
+ printf("\n%s returned $cmdres, %d was expected\n",
+ (!$tool)?"curl":$tool, $errorcode);
+ }
+ logmsg " exit FAILED\n";
+ # timestamp test result verification end
+ $timevrfyend{$testnum} = Time::HiRes::time() if($timestats);
+ return 1;
+ }
+
+ if($curl_debug) {
+ if(! -f $memdump) {
+ logmsg "\n** ALERT! memory debugging with no output file?\n"
+ if(!$cmdtype eq "perl");
+ }
+ else {
+ my @memdata=`$memanalyze $memdump`;
+ my $leak=0;
+ for(@memdata) {
+ if($_ ne "") {
+ # well it could be other memory problems as well, but
+ # we call it leak for short here
+ $leak=1;
+ }
+ }
+ if($leak) {
+ logmsg "\n** MEMORY FAILURE\n";
+ logmsg @memdata;
+ # timestamp test result verification end
+ $timevrfyend{$testnum} = Time::HiRes::time() if($timestats);
+ return 1;
+ }
+ else {
+ $ok .= "m";
+ }
+ }
+ }
+ else {
+ $ok .= "-"; # memory not checked
+ }
+
+ if($valgrind) {
+ if($usevalgrind) {
+ unless(opendir(DIR, "$LOGDIR")) {
+ logmsg "ERROR: unable to read $LOGDIR\n";
+ # timestamp test result verification end
+ $timevrfyend{$testnum} = Time::HiRes::time() if($timestats);
+ return 1;
+ }
+ my @files = readdir(DIR);
+ closedir(DIR);
+ my $vgfile;
+ foreach my $file (@files) {
+ if($file =~ /^valgrind$testnum(\..*|)$/) {
+ $vgfile = $file;
+ last;
+ }
+ }
+ if(!$vgfile) {
+ logmsg "ERROR: valgrind log file missing for test $testnum\n";
+ # timestamp test result verification end
+ $timevrfyend{$testnum} = Time::HiRes::time() if($timestats);
+ return 1;
+ }
+ my @e = valgrindparse($srcdir, $feature{'SSL'}, "$LOGDIR/$vgfile");
+ if(@e && $e[0]) {
+ logmsg " valgrind ERROR ";
+ logmsg @e;
+ # timestamp test result verification end
+ $timevrfyend{$testnum} = Time::HiRes::time() if($timestats);
+ return 1;
+ }
+ $ok .= "v";
+ }
+ else {
+ if(!$short && !$disablevalgrind) {
+ logmsg " valgrind SKIPPED\n";
+ }
+ $ok .= "-"; # skipped
+ }
+ }
+ else {
+ $ok .= "-"; # valgrind not checked
+ }
+
+ logmsg "$ok " if(!$short);
+
+ my $sofar= time()-$start;
+ my $esttotal = $sofar/$count * $total;
+ my $estleft = $esttotal - $sofar;
+ my $left=sprintf("remaining: %02d:%02d",
+ $estleft/60,
+ $estleft%60);
+ printf "OK (%-3d out of %-3d, %s)\n", $count, $total, $left;
+
+ # the test succeeded, remove all log files
+ if(!$keepoutfiles) {
+ cleardir($LOGDIR);
+ }
+
+ # timestamp test result verification end
+ $timevrfyend{$testnum} = Time::HiRes::time() if($timestats);
+
+ return 0;
+}
+
+#######################################################################
+# Stop all running test servers
+sub stopservers {
+ my $verbose = $_[0];
+ #
+ # kill sockfilter processes for all pingpong servers
+ #
+ killallsockfilters($verbose);
+ #
+ # kill all server pids from %run hash clearing them
+ #
+ my $pidlist;
+ foreach my $server (keys %run) {
+ if($run{$server}) {
+ if($verbose) {
+ my $prev = 0;
+ my $pids = $run{$server};
+ foreach my $pid (split(' ', $pids)) {
+ if($pid != $prev) {
+ logmsg sprintf("* kill pid for %s => %d\n",
+ $server, $pid);
+ $prev = $pid;
+ }
+ }
+ }
+ $pidlist .= "$run{$server} ";
+ $run{$server} = 0;
+ }
+ $runcert{$server} = 0 if($runcert{$server});
+ }
+ killpid($verbose, $pidlist);
+ #
+ # cleanup all server pid files
+ #
+ foreach my $server (keys %serverpidfile) {
+ my $pidfile = $serverpidfile{$server};
+ my $pid = processexists($pidfile);
+ if($pid > 0) {
+ logmsg "Warning: $server server unexpectedly alive\n";
+ killpid($verbose, $pid);
+ }
+ unlink($pidfile) if(-f $pidfile);
+ }
+}
+
+#######################################################################
+# startservers() starts all the named servers
+#
+# Returns: string with error reason or blank for success
+
+sub startservers {
+ my @what = @_;
+ my ($pid, $pid2);
+ for(@what) {
+ my (@whatlist) = split(/\s+/,$_);
+ my $what = lc($whatlist[0]);
+ $what =~ s/[^a-z0-9-]//g;
+
+ my $certfile;
+ if($what =~ /^(ftp|http|imap|pop3|smtp)s(.*)$/) {
+ $certfile = ($whatlist[1]) ? $whatlist[1] : 'stunnel.pem';
+ }
+
+ if(($what eq "pop3") ||
+ ($what eq "ftp") ||
+ ($what eq "imap") ||
+ ($what eq "smtp")) {
+ if(!$run{$what}) {
+ ($pid, $pid2) = runpingpongserver($what, "", $verbose);
+ if($pid <= 0) {
+ return "failed starting ". uc($what) ." server";
+ }
+ printf ("* pid $what => %d %d\n", $pid, $pid2) if($verbose);
+ $run{$what}="$pid $pid2";
+ }
+ }
+ elsif($what eq "ftp2") {
+ if(!$run{'ftp2'}) {
+ ($pid, $pid2) = runpingpongserver("ftp", "2", $verbose);
+ if($pid <= 0) {
+ return "failed starting FTP2 server";
+ }
+ printf ("* pid ftp2 => %d %d\n", $pid, $pid2) if($verbose);
+ $run{'ftp2'}="$pid $pid2";
+ }
+ }
+ elsif($what eq "ftp-ipv6") {
+ if(!$run{'ftp-ipv6'}) {
+ ($pid, $pid2) = runpingpongserver("ftp", "", $verbose, "ipv6");
+ if($pid <= 0) {
+ return "failed starting FTP-IPv6 server";
+ }
+ logmsg sprintf("* pid ftp-ipv6 => %d %d\n", $pid,
+ $pid2) if($verbose);
+ $run{'ftp-ipv6'}="$pid $pid2";
+ }
+ }
+ elsif($what eq "gopher") {
+ if(!$run{'gopher'}) {
+ ($pid, $pid2) = runhttpserver("gopher", $verbose, 0,
+ $GOPHERPORT);
+ if($pid <= 0) {
+ return "failed starting GOPHER server";
+ }
+ printf ("* pid gopher => %d %d\n", $pid, $pid2) if($verbose);
+ $run{'gopher'}="$pid $pid2";
+ }
+ }
+ elsif($what eq "gopher-ipv6") {
+ if(!$run{'gopher-ipv6'}) {
+ ($pid, $pid2) = runhttpserver("gopher", $verbose, "ipv6",
+ $GOPHER6PORT);
+ if($pid <= 0) {
+ return "failed starting GOPHER-IPv6 server";
+ }
+ logmsg sprintf("* pid gopher-ipv6 => %d %d\n", $pid,
+ $pid2) if($verbose);
+ $run{'gopher-ipv6'}="$pid $pid2";
+ }
+ }
+ elsif($what eq "http") {
+ if(!$run{'http'}) {
+ ($pid, $pid2) = runhttpserver("http", $verbose, 0,
+ $HTTPPORT);
+ if($pid <= 0) {
+ return "failed starting HTTP server";
+ }
+ printf ("* pid http => %d %d\n", $pid, $pid2) if($verbose);
+ $run{'http'}="$pid $pid2";
+ }
+ }
+ elsif($what eq "http-ipv6") {
+ if(!$run{'http-ipv6'}) {
+ ($pid, $pid2) = runhttpserver("http", $verbose, "IPv6",
+ $HTTP6PORT);
+ if($pid <= 0) {
+ return "failed starting HTTP-IPv6 server";
+ }
+ logmsg sprintf("* pid http-ipv6 => %d %d\n", $pid, $pid2)
+ if($verbose);
+ $run{'http-ipv6'}="$pid $pid2";
+ }
+ }
+ elsif($what eq "rtsp") {
+ if(!$run{'rtsp'}) {
+ ($pid, $pid2) = runrtspserver($verbose);
+ if($pid <= 0) {
+ return "failed starting RTSP server";
+ }
+ printf ("* pid rtsp => %d %d\n", $pid, $pid2) if($verbose);
+ $run{'rtsp'}="$pid $pid2";
+ }
+ }
+ elsif($what eq "rtsp-ipv6") {
+ if(!$run{'rtsp-ipv6'}) {
+ ($pid, $pid2) = runrtspserver($verbose, "IPv6");
+ if($pid <= 0) {
+ return "failed starting RTSP-IPv6 server";
+ }
+ logmsg sprintf("* pid rtsp-ipv6 => %d %d\n", $pid, $pid2)
+ if($verbose);
+ $run{'rtsp-ipv6'}="$pid $pid2";
+ }
+ }
+
+ elsif($what eq "ftps") {
+ if(!$stunnel) {
+ # we can't run ftps tests without stunnel
+ return "no stunnel";
+ }
+ if(!$ssl_version) {
+ # we can't run ftps tests if libcurl is SSL-less
+ return "curl lacks SSL support";
+ }
+ if($runcert{'ftps'} && ($runcert{'ftps'} ne $certfile)) {
+ # stop server when running and using a different cert
+ stopserver('ftps');
+ }
+ if(!$run{'ftp'}) {
+ ($pid, $pid2) = runpingpongserver("ftp", "", $verbose);
+ if($pid <= 0) {
+ return "failed starting FTP server";
+ }
+ printf ("* pid ftp => %d %d\n", $pid, $pid2) if($verbose);
+ $run{'ftp'}="$pid $pid2";
+ }
+ if(!$run{'ftps'}) {
+ ($pid, $pid2) = runftpsserver($verbose, "", $certfile);
+ if($pid <= 0) {
+ return "failed starting FTPS server (stunnel)";
+ }
+ logmsg sprintf("* pid ftps => %d %d\n", $pid, $pid2)
+ if($verbose);
+ $run{'ftps'}="$pid $pid2";
+ }
+ }
+ elsif($what eq "file") {
+ # we support it but have no server!
+ }
+ elsif($what eq "https") {
+ if(!$stunnel) {
+ # we can't run ftps tests without stunnel
+ return "no stunnel";
+ }
+ if(!$ssl_version) {
+ # we can't run ftps tests if libcurl is SSL-less
+ return "curl lacks SSL support";
+ }
+ if($runcert{'https'} && ($runcert{'https'} ne $certfile)) {
+ # stop server when running and using a different cert
+ stopserver('https');
+ }
+ if(!$run{'http'}) {
+ ($pid, $pid2) = runhttpserver("http", $verbose, 0,
+ $HTTPPORT);
+ if($pid <= 0) {
+ return "failed starting HTTP server";
+ }
+ printf ("* pid http => %d %d\n", $pid, $pid2) if($verbose);
+ $run{'http'}="$pid $pid2";
+ }
+ if(!$run{'https'}) {
+ ($pid, $pid2) = runhttpsserver($verbose, "", $certfile);
+ if($pid <= 0) {
+ return "failed starting HTTPS server (stunnel)";
+ }
+ logmsg sprintf("* pid https => %d %d\n", $pid, $pid2)
+ if($verbose);
+ $run{'https'}="$pid $pid2";
+ }
+ }
+ elsif($what eq "tftp") {
+ if(!$run{'tftp'}) {
+ ($pid, $pid2) = runtftpserver("", $verbose);
+ if($pid <= 0) {
+ return "failed starting TFTP server";
+ }
+ printf ("* pid tftp => %d %d\n", $pid, $pid2) if($verbose);
+ $run{'tftp'}="$pid $pid2";
+ }
+ }
+ elsif($what eq "tftp-ipv6") {
+ if(!$run{'tftp-ipv6'}) {
+ ($pid, $pid2) = runtftpserver("", $verbose, "IPv6");
+ if($pid <= 0) {
+ return "failed starting TFTP-IPv6 server";
+ }
+ printf("* pid tftp-ipv6 => %d %d\n", $pid, $pid2) if($verbose);
+ $run{'tftp-ipv6'}="$pid $pid2";
+ }
+ }
+ elsif($what eq "sftp" || $what eq "scp" || $what eq "socks4" || $what eq "socks5" ) {
+ if(!$run{'ssh'}) {
+ ($pid, $pid2) = runsshserver("", $verbose);
+ if($pid <= 0) {
+ return "failed starting SSH server";
+ }
+ printf ("* pid ssh => %d %d\n", $pid, $pid2) if($verbose);
+ $run{'ssh'}="$pid $pid2";
+ }
+ if($what eq "socks4" || $what eq "socks5") {
+ if(!$run{'socks'}) {
+ ($pid, $pid2) = runsocksserver("", $verbose);
+ if($pid <= 0) {
+ return "failed starting socks server";
+ }
+ printf ("* pid socks => %d %d\n", $pid, $pid2) if($verbose);
+ $run{'socks'}="$pid $pid2";
+ }
+ }
+ if($what eq "socks5") {
+ if(!$sshdid) {
+ # Not an OpenSSH or SunSSH ssh daemon
+ logmsg "Not OpenSSH or SunSSH; socks5 tests need at least OpenSSH 3.7\n";
+ return "failed starting socks5 server";
+ }
+ elsif(($sshdid =~ /OpenSSH/) && ($sshdvernum < 370)) {
+ # Need OpenSSH 3.7 for socks5 - http://www.openssh.com/txt/release-3.7
+ logmsg "$sshdverstr insufficient; socks5 tests need at least OpenSSH 3.7\n";
+ return "failed starting socks5 server";
+ }
+ elsif(($sshdid =~ /SunSSH/) && ($sshdvernum < 100)) {
+ # Need SunSSH 1.0 for socks5
+ logmsg "$sshdverstr insufficient; socks5 tests need at least SunSSH 1.0\n";
+ return "failed starting socks5 server";
+ }
+ }
+ }
+ elsif($what eq "none") {
+ logmsg "* starts no server\n" if ($verbose);
+ }
+ else {
+ warn "we don't support a server for $what";
+ return "no server for $what";
+ }
+ }
+ return 0;
+}
+
+##############################################################################
+# This function makes sure the right set of server is running for the
+# specified test case. This is a useful design when we run single tests as not
+# all servers need to run then!
+#
+# Returns: a string, blank if everything is fine or a reason why it failed
+#
+
+sub serverfortest {
+ my ($testnum)=@_;
+
+ my @what = getpart("client", "server");
+
+ if(!$what[0]) {
+ warn "Test case $testnum has no server(s) specified";
+ return "no server specified";
+ }
+
+ for (@what) {
+ my $proto = lc($_);
+ chomp $proto;
+ $proto =~ s/\s.*//g; # take first word
+ if (! grep /^$proto$/, @protocols) {
+ if (substr($proto,0,5) ne "socks") {
+ return "curl lacks $proto support";
+ }
+ }
+ }
+
+ return &startservers(@what);
+}
+
+#######################################################################
+# runtimestats displays test-suite run time statistics
+#
+sub runtimestats {
+ my $lasttest = $_[0];
+
+ return if(not $timestats);
+
+ logmsg "\nTest suite total running time breakdown per task...\n\n";
+
+ my @timesrvr;
+ my @timeprep;
+ my @timetool;
+ my @timelock;
+ my @timevrfy;
+ my @timetest;
+ my $timesrvrtot = 0.0;
+ my $timepreptot = 0.0;
+ my $timetooltot = 0.0;
+ my $timelocktot = 0.0;
+ my $timevrfytot = 0.0;
+ my $timetesttot = 0.0;
+ my $counter;
+
+ for my $testnum (1 .. $lasttest) {
+ if($timesrvrini{$testnum}) {
+ $timesrvrtot += $timesrvrend{$testnum} - $timesrvrini{$testnum};
+ $timepreptot +=
+ (($timetoolini{$testnum} - $timeprepini{$testnum}) -
+ ($timesrvrend{$testnum} - $timesrvrini{$testnum}));
+ $timetooltot += $timetoolend{$testnum} - $timetoolini{$testnum};
+ $timelocktot += $timesrvrlog{$testnum} - $timetoolend{$testnum};
+ $timevrfytot += $timevrfyend{$testnum} - $timesrvrlog{$testnum};
+ $timetesttot += $timevrfyend{$testnum} - $timeprepini{$testnum};
+ push @timesrvr, sprintf("%06.3f %04d",
+ $timesrvrend{$testnum} - $timesrvrini{$testnum}, $testnum);
+ push @timeprep, sprintf("%06.3f %04d",
+ ($timetoolini{$testnum} - $timeprepini{$testnum}) -
+ ($timesrvrend{$testnum} - $timesrvrini{$testnum}), $testnum);
+ push @timetool, sprintf("%06.3f %04d",
+ $timetoolend{$testnum} - $timetoolini{$testnum}, $testnum);
+ push @timelock, sprintf("%06.3f %04d",
+ $timesrvrlog{$testnum} - $timetoolend{$testnum}, $testnum);
+ push @timevrfy, sprintf("%06.3f %04d",
+ $timevrfyend{$testnum} - $timesrvrlog{$testnum}, $testnum);
+ push @timetest, sprintf("%06.3f %04d",
+ $timevrfyend{$testnum} - $timeprepini{$testnum}, $testnum);
+ }
+ }
+
+ {
+ no warnings 'numeric';
+ @timesrvr = sort { $b <=> $a } @timesrvr;
+ @timeprep = sort { $b <=> $a } @timeprep;
+ @timetool = sort { $b <=> $a } @timetool;
+ @timelock = sort { $b <=> $a } @timelock;
+ @timevrfy = sort { $b <=> $a } @timevrfy;
+ @timetest = sort { $b <=> $a } @timetest;
+ }
+
+ logmsg "Spent ". sprintf("%08.3f ", $timesrvrtot) .
+ "seconds starting and verifying test harness servers.\n";
+ logmsg "Spent ". sprintf("%08.3f ", $timepreptot) .
+ "seconds reading definitions and doing test preparations.\n";
+ logmsg "Spent ". sprintf("%08.3f ", $timetooltot) .
+ "seconds actually running test tools.\n";
+ logmsg "Spent ". sprintf("%08.3f ", $timelocktot) .
+ "seconds awaiting server logs lock removal.\n";
+ logmsg "Spent ". sprintf("%08.3f ", $timevrfytot) .
+ "seconds verifying test results.\n";
+ logmsg "Spent ". sprintf("%08.3f ", $timetesttot) .
+ "seconds doing all of the above.\n";
+
+ $counter = 25;
+ logmsg "\nTest server starting and verification time per test ".
+ sprintf("(%s)...\n\n", (not $fullstats)?"top $counter":"full");
+ logmsg "-time- test\n";
+ logmsg "------ ----\n";
+ foreach my $txt (@timesrvr) {
+ last if((not $fullstats) && (not $counter--));
+ logmsg "$txt\n";
+ }
+
+ $counter = 10;
+ logmsg "\nTest definition reading and preparation time per test ".
+ sprintf("(%s)...\n\n", (not $fullstats)?"top $counter":"full");
+ logmsg "-time- test\n";
+ logmsg "------ ----\n";
+ foreach my $txt (@timeprep) {
+ last if((not $fullstats) && (not $counter--));
+ logmsg "$txt\n";
+ }
+
+ $counter = 25;
+ logmsg "\nTest tool execution time per test ".
+ sprintf("(%s)...\n\n", (not $fullstats)?"top $counter":"full");
+ logmsg "-time- test\n";
+ logmsg "------ ----\n";
+ foreach my $txt (@timetool) {
+ last if((not $fullstats) && (not $counter--));
+ logmsg "$txt\n";
+ }
+
+ $counter = 15;
+ logmsg "\nTest server logs lock removal time per test ".
+ sprintf("(%s)...\n\n", (not $fullstats)?"top $counter":"full");
+ logmsg "-time- test\n";
+ logmsg "------ ----\n";
+ foreach my $txt (@timelock) {
+ last if((not $fullstats) && (not $counter--));
+ logmsg "$txt\n";
+ }
+
+ $counter = 10;
+ logmsg "\nTest results verification time per test ".
+ sprintf("(%s)...\n\n", (not $fullstats)?"top $counter":"full");
+ logmsg "-time- test\n";
+ logmsg "------ ----\n";
+ foreach my $txt (@timevrfy) {
+ last if((not $fullstats) && (not $counter--));
+ logmsg "$txt\n";
+ }
+
+ $counter = 50;
+ logmsg "\nTotal time per test ".
+ sprintf("(%s)...\n\n", (not $fullstats)?"top $counter":"full");
+ logmsg "-time- test\n";
+ logmsg "------ ----\n";
+ foreach my $txt (@timetest) {
+ last if((not $fullstats) && (not $counter--));
+ logmsg "$txt\n";
+ }
+
+ logmsg "\n";
+}
+
+#######################################################################
+# Check options to this test program
+#
+
+my $number=0;
+my $fromnum=-1;
+my @testthis;
+my %disabled;
+while(@ARGV) {
+ if ($ARGV[0] eq "-v") {
+ # verbose output
+ $verbose=1;
+ }
+ elsif($ARGV[0] =~ /^-b(.*)/) {
+ my $portno=$1;
+ if($portno =~ s/(\d+)$//) {
+ $base = int $1;
+ }
+ }
+ elsif ($ARGV[0] eq "-c") {
+ # use this path to curl instead of default
+ $DBGCURL=$CURL=$ARGV[1];
+ shift @ARGV;
+ }
+ elsif ($ARGV[0] eq "-d") {
+ # have the servers display protocol output
+ $debugprotocol=1;
+ }
+ elsif ($ARGV[0] eq "-f") {
+ # run fork-servers, which makes the server fork for all new
+ # connections This is NOT what you wanna do without knowing exactly
+ # why and for what
+ $forkserver=1;
+ }
+ elsif ($ARGV[0] eq "-g") {
+ # run this test with gdb
+ $gdbthis=1;
+ }
+ elsif($ARGV[0] eq "-s") {
+ # short output
+ $short=1;
+ }
+ elsif($ARGV[0] eq "-n") {
+ # no valgrind
+ undef $valgrind;
+ }
+ elsif($ARGV[0] =~ /^-t(.*)/) {
+ # torture
+ $torture=1;
+ my $xtra = $1;
+
+ if($xtra =~ s/(\d+)$//) {
+ $tortalloc = $1;
+ }
+ # we undef valgrind to make this fly in comparison
+ undef $valgrind;
+ }
+ elsif($ARGV[0] eq "-a") {
+ # continue anyway, even if a test fail
+ $anyway=1;
+ }
+ elsif($ARGV[0] eq "-p") {
+ $postmortem=1;
+ }
+ elsif($ARGV[0] eq "-l") {
+ # lists the test case names only
+ $listonly=1;
+ }
+ elsif($ARGV[0] eq "-k") {
+ # keep stdout and stderr files after tests
+ $keepoutfiles=1;
+ }
+ elsif($ARGV[0] eq "-r") {
+ # run time statistics needs Time::HiRes
+ if($Time::HiRes::VERSION) {
+ keys(%timeprepini) = 1000;
+ keys(%timesrvrini) = 1000;
+ keys(%timesrvrend) = 1000;
+ keys(%timetoolini) = 1000;
+ keys(%timetoolend) = 1000;
+ keys(%timesrvrlog) = 1000;
+ keys(%timevrfyend) = 1000;
+ $timestats=1;
+ $fullstats=0;
+ }
+ }
+ elsif($ARGV[0] eq "-rf") {
+ # run time statistics needs Time::HiRes
+ if($Time::HiRes::VERSION) {
+ keys(%timeprepini) = 1000;
+ keys(%timesrvrini) = 1000;
+ keys(%timesrvrend) = 1000;
+ keys(%timetoolini) = 1000;
+ keys(%timetoolend) = 1000;
+ keys(%timesrvrlog) = 1000;
+ keys(%timevrfyend) = 1000;
+ $timestats=1;
+ $fullstats=1;
+ }
+ }
+ elsif(($ARGV[0] eq "-h") || ($ARGV[0] eq "--help")) {
+ # show help text
+ print <<EOHELP
+Usage: runtests.pl [options] [test selection(s)]
+ -a continue even if a test fails
+ -bN use base port number N for test servers (default $base)
+ -c path use this curl executable
+ -d display server debug info
+ -g run the test case with gdb
+ -h this help text
+ -k keep stdout and stderr files present after tests
+ -l list all test case names/descriptions
+ -n no valgrind
+ -p print log file contents when a test fails
+ -r run time statistics
+ -rf full run time statistics
+ -s short output
+ -t[N] torture (simulate memory alloc failures); N means fail Nth alloc
+ -v verbose output
+ [num] like "5 6 9" or " 5 to 22 " to run those tests only
+ [!num] like "!5 !6 !9" to disable those tests
+ [keyword] like "IPv6" to select only tests containing the key word
+ [!keyword] like "!cookies" to disable any tests containing the key word
+EOHELP
+ ;
+ exit;
+ }
+ elsif($ARGV[0] =~ /^(\d+)/) {
+ $number = $1;
+ if($fromnum >= 0) {
+ for($fromnum .. $number) {
+ push @testthis, $_;
+ }
+ $fromnum = -1;
+ }
+ else {
+ push @testthis, $1;
+ }
+ }
+ elsif($ARGV[0] =~ /^to$/i) {
+ $fromnum = $number+1;
+ }
+ elsif($ARGV[0] =~ /^!(\d+)/) {
+ $fromnum = -1;
+ $disabled{$1}=$1;
+ }
+ elsif($ARGV[0] =~ /^!(.+)/) {
+ $disabled_keywords{$1}=$1;
+ }
+ elsif($ARGV[0] =~ /^([-[{a-zA-Z].*)/) {
+ $enabled_keywords{$1}=$1;
+ }
+ else {
+ print "Unknown option: $ARGV[0]\n";
+ exit;
+ }
+ shift @ARGV;
+}
+
+if(@testthis && ($testthis[0] ne "")) {
+ $TESTCASES=join(" ", @testthis);
+}
+
+if($valgrind) {
+ # we have found valgrind on the host, use it
+
+ # verify that we can invoke it fine
+ my $code = runclient("valgrind >/dev/null 2>&1");
+
+ if(($code>>8) != 1) {
+ #logmsg "Valgrind failure, disable it\n";
+ undef $valgrind;
+ } else {
+
+ # since valgrind 2.1.x, '--tool' option is mandatory
+ # use it, if it is supported by the version installed on the system
+ runclient("valgrind --help 2>&1 | grep -- --tool > /dev/null 2>&1");
+ if (($? >> 8)==0) {
+ $valgrind_tool="--tool=memcheck";
+ }
+ open(C, "<$CURL");
+ my $l = <C>;
+ if($l =~ /^\#\!/) {
+ # A shell script. This is typically when built with libtool,
+ $valgrind="../libtool --mode=execute $valgrind";
+ }
+ close(C);
+
+ # valgrind 3 renamed the --logfile option to --log-file!!!
+ my $ver=join(' ', runclientoutput("valgrind --version"));
+ # cut off all but digits and dots
+ $ver =~ s/[^0-9.]//g;
+
+ if($ver =~ /^(\d+)/) {
+ $ver = $1;
+ if($ver >= 3) {
+ $valgrind_logfile="--log-file";
+ }
+ }
+ }
+}
+
+if ($gdbthis) {
+ # open the executable curl and read the first 4 bytes of it
+ open(CHECK, "<$CURL");
+ my $c;
+ sysread CHECK, $c, 4;
+ close(CHECK);
+ if($c eq "#! /") {
+ # A shell script. This is typically when built with libtool,
+ $libtool = 1;
+ $gdb = "libtool --mode=execute gdb";
+ }
+}
+
+$HTTPPORT = $base++; # HTTP server port
+$HTTPSPORT = $base++; # HTTPS server port
+$FTPPORT = $base++; # FTP server port
+$FTPSPORT = $base++; # FTPS server port
+$HTTP6PORT = $base++; # HTTP IPv6 server port (different IP protocol
+ # but we follow the same port scheme anyway)
+$FTP2PORT = $base++; # FTP server 2 port
+$FTP6PORT = $base++; # FTP IPv6 port
+$TFTPPORT = $base++; # TFTP (UDP) port
+$TFTP6PORT = $base++; # TFTP IPv6 (UDP) port
+$SSHPORT = $base++; # SSH (SCP/SFTP) port
+$SOCKSPORT = $base++; # SOCKS port
+$POP3PORT = $base++;
+$POP36PORT = $base++;
+$IMAPPORT = $base++;
+$IMAP6PORT = $base++;
+$SMTPPORT = $base++;
+$SMTP6PORT = $base++;
+$RTSPPORT = $base++;
+$RTSP6PORT = $base++;
+$GOPHERPORT =$base++;
+$GOPHER6PORT=$base++;
+
+#######################################################################
+# clear and create logging directory:
+#
+
+cleardir($LOGDIR);
+mkdir($LOGDIR, 0777);
+
+#######################################################################
+# initialize some variables
+#
+
+get_disttests();
+init_serverpidfile_hash();
+
+#######################################################################
+# Output curl version and host info being tested
+#
+
+if(!$listonly) {
+ checksystem();
+}
+
+#######################################################################
+# If 'all' tests are requested, find out all test numbers
+#
+
+if ( $TESTCASES eq "all") {
+ # Get all commands and find out their test numbers
+ opendir(DIR, $TESTDIR) || die "can't opendir $TESTDIR: $!";
+ my @cmds = grep { /^test([0-9]+)$/ && -f "$TESTDIR/$_" } readdir(DIR);
+ closedir(DIR);
+
+ open(D, "<$TESTDIR/DISABLED");
+ while(<D>) {
+ if(/^ *\#/) {
+ # allow comments
+ next;
+ }
+ if($_ =~ /(\d+)/) {
+ $disabled{$1}=$1; # disable this test number
+ }
+ }
+ close(D);
+
+ $TESTCASES=""; # start with no test cases
+
+ # cut off everything but the digits
+ for(@cmds) {
+ $_ =~ s/[a-z\/\.]*//g;
+ }
+ # sort the numbers from low to high
+ foreach my $n (sort { $a <=> $b } @cmds) {
+ if($disabled{$n}) {
+ # skip disabled test cases
+ my $why = "configured as DISABLED";
+ $skipped++;
+ $skipped{$why}++;
+ $teststat[$n]=$why; # store reason for this test case
+ next;
+ }
+ $TESTCASES .= " $n";
+ }
+}
+
+#######################################################################
+# Start the command line log
+#
+open(CMDLOG, ">$CURLLOG") ||
+ logmsg "can't log command lines to $CURLLOG\n";
+
+#######################################################################
+
+# Display the contents of the given file. Line endings are canonicalized
+# and excessively long files are elided
+sub displaylogcontent {
+ my ($file)=@_;
+ if(open(SINGLE, "<$file")) {
+ my $linecount = 0;
+ my $truncate;
+ my @tail;
+ while(my $string = <SINGLE>) {
+ $string =~ s/\r\n/\n/g;
+ $string =~ s/[\r\f\032]/\n/g;
+ $string .= "\n" unless ($string =~ /\n$/);
+ $string =~ tr/\n//;
+ for my $line (split("\n", $string)) {
+ $line =~ s/\s*\!$//;
+ if ($truncate) {
+ push @tail, " $line\n";
+ } else {
+ logmsg " $line\n";
+ }
+ $linecount++;
+ $truncate = $linecount > 1000;
+ }
+ }
+ if(@tail) {
+ my $tailshow = 200;
+ my $tailskip = 0;
+ my $tailtotal = scalar @tail;
+ if($tailtotal > $tailshow) {
+ $tailskip = $tailtotal - $tailshow;
+ logmsg "=== File too long: $tailskip lines omitted here\n";
+ }
+ for($tailskip .. $tailtotal-1) {
+ logmsg "$tail[$_]";
+ }
+ }
+ close(SINGLE);
+ }
+}
+
+sub displaylogs {
+ my ($testnum)=@_;
+ opendir(DIR, "$LOGDIR") ||
+ die "can't open dir: $!";
+ my @logs = readdir(DIR);
+ closedir(DIR);
+
+ logmsg "== Contents of files in the $LOGDIR/ dir after test $testnum\n";
+ foreach my $log (sort @logs) {
+ if($log =~ /\.(\.|)$/) {
+ next; # skip "." and ".."
+ }
+ if($log =~ /^\.nfs/) {
+ next; # skip ".nfs"
+ }
+ if(($log eq "memdump") || ($log eq "core")) {
+ next; # skip "memdump" and "core"
+ }
+ if((-d "$LOGDIR/$log") || (! -s "$LOGDIR/$log")) {
+ next; # skip directory and empty files
+ }
+ if(($log =~ /^stdout\d+/) && ($log !~ /^stdout$testnum/)) {
+ next; # skip stdoutNnn of other tests
+ }
+ if(($log =~ /^stderr\d+/) && ($log !~ /^stderr$testnum/)) {
+ next; # skip stderrNnn of other tests
+ }
+ if(($log =~ /^upload\d+/) && ($log !~ /^upload$testnum/)) {
+ next; # skip uploadNnn of other tests
+ }
+ if(($log =~ /^curl\d+\.out/) && ($log !~ /^curl$testnum\.out/)) {
+ next; # skip curlNnn.out of other tests
+ }
+ if(($log =~ /^test\d+\.txt/) && ($log !~ /^test$testnum\.txt/)) {
+ next; # skip testNnn.txt of other tests
+ }
+ if(($log =~ /^file\d+\.txt/) && ($log !~ /^file$testnum\.txt/)) {
+ next; # skip fileNnn.txt of other tests
+ }
+ if(($log =~ /^valgrind\d+/) && ($log !~ /^valgrind$testnum(\..*|)$/)) {
+ next; # skip valgrindNnn of other tests
+ }
+ logmsg "=== Start of file $log\n";
+ displaylogcontent("$LOGDIR/$log");
+ logmsg "=== End of file $log\n";
+ }
+}
+
+#######################################################################
+# The main test-loop
+#
+
+my $failed;
+my $testnum;
+my $ok=0;
+my $total=0;
+my $lasttest=0;
+my @at = split(" ", $TESTCASES);
+my $count=0;
+
+$start = time();
+
+foreach $testnum (@at) {
+
+ $lasttest = $testnum if($testnum > $lasttest);
+ $count++;
+
+ my $error = singletest($testnum, $count, scalar(@at));
+ if($error < 0) {
+ # not a test we can run
+ next;
+ }
+
+ $total++; # number of tests we've run
+
+ if($error>0) {
+ $failed.= "$testnum ";
+ if($postmortem) {
+ # display all files in log/ in a nice way
+ displaylogs($testnum);
+ }
+ if(!$anyway) {
+ # a test failed, abort
+ logmsg "\n - abort tests\n";
+ last;
+ }
+ }
+ elsif(!$error) {
+ $ok++; # successful test counter
+ }
+
+ # loop for next test
+}
+
+my $sofar = time() - $start;
+
+#######################################################################
+# Close command log
+#
+close(CMDLOG);
+
+# Tests done, stop the servers
+stopservers($verbose);
+
+my $all = $total + $skipped;
+
+runtimestats($lasttest);
+
+if($total) {
+ logmsg sprintf("TESTDONE: $ok tests out of $total reported OK: %d%%\n",
+ $ok/$total*100);
+
+ if($ok != $total) {
+ logmsg "TESTFAIL: These test cases failed: $failed\n";
+ }
+}
+else {
+ logmsg "TESTFAIL: No tests were performed\n";
+}
+
+if($all) {
+ logmsg "TESTDONE: $all tests were considered during ".
+ sprintf("%.0f", $sofar) ." seconds.\n";
+}
+
+if($skipped) {
+ my $s=0;
+ logmsg "TESTINFO: $skipped tests were skipped due to these restraints:\n";
+
+ for(keys %skipped) {
+ my $r = $_;
+ printf "TESTINFO: \"%s\" %d times (", $r, $skipped{$_};
+
+ # now show all test case numbers that had this reason for being
+ # skipped
+ my $c=0;
+ for(0 .. scalar @teststat) {
+ my $t = $_;
+ if($teststat[$_] && ($teststat[$_] eq $r)) {
+ logmsg ", " if($c);
+ logmsg $_;
+ $c++;
+ }
+ }
+ logmsg ")\n";
+ }
+}
+
+if($total && ($ok != $total)) {
+ exit 1;
+}
diff --git a/tests/secureserver.pl b/tests/secureserver.pl
new file mode 100755
index 000000000..064fa84f5
--- /dev/null
+++ b/tests/secureserver.pl
@@ -0,0 +1,298 @@
+#!/usr/bin/env perl
+#***************************************************************************
+# _ _ ____ _
+# Project ___| | | | _ \| |
+# / __| | | | |_) | |
+# | (__| |_| | _ <| |___
+# \___|\___/|_| \_\_____|
+#
+# Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+#
+# This software is licensed as described in the file COPYING, which
+# you should have received as part of this distribution. The terms
+# are also available at http://curl.haxx.se/docs/copyright.html.
+#
+# You may opt to use, copy, modify, merge, publish, distribute and/or sell
+# copies of the Software, and permit persons to whom the Software is
+# furnished to do so, under the terms of the COPYING file.
+#
+# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+# KIND, either express or implied.
+#
+#***************************************************************************
+
+# This is the HTTPS, FTPS, POP3S, IMAPS, SMTPS, server used for curl test
+# harness. Actually just a layer that runs stunnel properly using the
+# non-secure test harness servers.
+
+BEGIN {
+ @INC=(@INC, $ENV{'srcdir'}, '.');
+}
+
+use strict;
+use warnings;
+use Cwd;
+
+use serverhelp qw(
+ server_pidfilename
+ server_logfilename
+ );
+
+my $stunnel = "stunnel";
+
+my $verbose=0; # set to 1 for debugging
+
+my $accept_port = 8991; # just our default, weird enough
+my $target_port = 8999; # default test http-server port
+
+my $stuncert;
+
+my $ver_major;
+my $ver_minor;
+my $stunnel_version;
+my $socketopt;
+my $cmd;
+
+my $pidfile; # stunnel pid file
+my $logfile; # stunnel log file
+my $loglevel = 5; # stunnel log level
+my $ipvnum = 4; # default IP version of stunneled server
+my $idnum = 1; # dafault stunneled server instance number
+my $proto = 'https'; # default secure server protocol
+my $conffile; # stunnel configuration file
+my $certfile; # certificate chain PEM file
+
+#***************************************************************************
+# stunnel requires full path specification for several files.
+#
+my $path = getcwd();
+my $srcdir = $path;
+my $logdir = $path .'/log';
+
+#***************************************************************************
+# Signal handler to remove our stunnel 4.00 and newer configuration file.
+#
+sub exit_signal_handler {
+ my $signame = shift;
+ local $!; # preserve errno
+ local $?; # preserve exit status
+ unlink($conffile) if($conffile && (-f $conffile));
+ exit;
+}
+
+#***************************************************************************
+# Process command line options
+#
+while(@ARGV) {
+ if($ARGV[0] eq '--verbose') {
+ $verbose = 1;
+ }
+ elsif($ARGV[0] eq '--proto') {
+ if($ARGV[1]) {
+ $proto = $ARGV[1];
+ shift @ARGV;
+ }
+ }
+ elsif($ARGV[0] eq '--accept') {
+ if($ARGV[1]) {
+ if($ARGV[1] =~ /^(\d+)$/) {
+ $accept_port = $1;
+ shift @ARGV;
+ }
+ }
+ }
+ elsif($ARGV[0] eq '--connect') {
+ if($ARGV[1]) {
+ if($ARGV[1] =~ /^(\d+)$/) {
+ $target_port = $1;
+ shift @ARGV;
+ }
+ }
+ }
+ elsif($ARGV[0] eq '--stunnel') {
+ if($ARGV[1]) {
+ $stunnel = $ARGV[1];
+ shift @ARGV;
+ }
+ }
+ elsif($ARGV[0] eq '--srcdir') {
+ if($ARGV[1]) {
+ $srcdir = $ARGV[1];
+ shift @ARGV;
+ }
+ }
+ elsif($ARGV[0] eq '--certfile') {
+ if($ARGV[1]) {
+ $stuncert = $ARGV[1];
+ shift @ARGV;
+ }
+ }
+ elsif($ARGV[0] eq '--id') {
+ if($ARGV[1]) {
+ if($ARGV[1] =~ /^(\d+)$/) {
+ $idnum = $1 if($1 > 0);
+ shift @ARGV;
+ }
+ }
+ }
+ elsif($ARGV[0] eq '--ipv4') {
+ $ipvnum = 4;
+ }
+ elsif($ARGV[0] eq '--ipv6') {
+ $ipvnum = 6;
+ }
+ elsif($ARGV[0] eq '--pidfile') {
+ if($ARGV[1]) {
+ $pidfile = "$path/". $ARGV[1];
+ shift @ARGV;
+ }
+ }
+ elsif($ARGV[0] eq '--logfile') {
+ if($ARGV[1]) {
+ $logfile = "$path/". $ARGV[1];
+ shift @ARGV;
+ }
+ }
+ else {
+ print STDERR "\nWarning: secureserver.pl unknown parameter: $ARGV[0]\n";
+ }
+ shift @ARGV;
+}
+
+#***************************************************************************
+# Initialize command line option dependant variables
+#
+if(!$pidfile) {
+ $pidfile = "$path/". server_pidfilename($proto, $ipvnum, $idnum);
+}
+if(!$logfile) {
+ $logfile = server_logfilename($logdir, $proto, $ipvnum, $idnum);
+}
+
+$conffile = "$path/stunnel.conf";
+
+$certfile = "$srcdir/". ($stuncert?"certs/$stuncert":"stunnel.pem");
+
+my $ssltext = uc($proto) ." SSL/TLS:";
+
+#***************************************************************************
+# Find out version info for the given stunnel binary
+#
+foreach my $veropt (('-version', '-V')) {
+ foreach my $verstr (qx($stunnel $veropt 2>&1)) {
+ if($verstr =~ /^stunnel (\d+)\.(\d+) on /) {
+ $ver_major = $1;
+ $ver_minor = $2;
+ last;
+ }
+ }
+ last if($ver_major);
+}
+if((!$ver_major) || (!$ver_minor)) {
+ if(-x "$stunnel" && ! -d "$stunnel") {
+ print "$ssltext Unknown stunnel version\n";
+ }
+ else {
+ print "$ssltext No stunnel\n";
+ }
+ exit 1;
+}
+$stunnel_version = (100*$ver_major) + $ver_minor;
+
+#***************************************************************************
+# Verify minimmum stunnel required version
+#
+if($stunnel_version < 310) {
+ print "$ssltext Unsupported stunnel version $ver_major.$ver_minor\n";
+ exit 1;
+}
+
+#***************************************************************************
+# Build command to execute for stunnel 3.X versions
+#
+if($stunnel_version < 400) {
+ if($stunnel_version >= 319) {
+ $socketopt = "-O a:SO_REUSEADDR=1";
+ }
+ $cmd = "$stunnel -p $certfile -P $pidfile ";
+ $cmd .= "-d $accept_port -r $target_port -f -D $loglevel ";
+ $cmd .= ($socketopt) ? "$socketopt " : "";
+ $cmd .= ">$logfile 2>&1";
+ if($verbose) {
+ print uc($proto) ." server (stunnel $ver_major.$ver_minor)\n";
+ print "cmd: $cmd\n";
+ print "pem cert file: $certfile\n";
+ print "pid file: $pidfile\n";
+ print "log file: $logfile\n";
+ print "log level: $loglevel\n";
+ print "listen on port: $accept_port\n";
+ print "connect to port: $target_port\n";
+ }
+}
+
+#***************************************************************************
+# Build command to execute for stunnel 4.00 and newer
+#
+if($stunnel_version >= 400) {
+ $socketopt = "a:SO_REUSEADDR=1";
+ $cmd = "$stunnel $conffile ";
+ $cmd .= ">$logfile 2>&1";
+ # setup signal handler
+ $SIG{INT} = \&exit_signal_handler;
+ $SIG{TERM} = \&exit_signal_handler;
+ # stunnel configuration file
+ if(open(STUNCONF, ">$conffile")) {
+ print STUNCONF "
+ CApath = $path
+ cert = $certfile
+ pid = $pidfile
+ debug = $loglevel
+ output = $logfile
+ socket = $socketopt
+ foreground = yes
+
+ [curltest]
+ accept = $accept_port
+ connect = $target_port
+ ";
+ if(!close(STUNCONF)) {
+ print "$ssltext Error closing file $conffile\n";
+ exit 1;
+ }
+ }
+ else {
+ print "$ssltext Error writing file $conffile\n";
+ exit 1;
+ }
+ if($verbose) {
+ print uc($proto) ." server (stunnel $ver_major.$ver_minor)\n";
+ print "cmd: $cmd\n";
+ print "CApath = $path\n";
+ print "cert = $certfile\n";
+ print "pid = $pidfile\n";
+ print "debug = $loglevel\n";
+ print "output = $logfile\n";
+ print "socket = $socketopt\n";
+ print "foreground = yes\n";
+ print "\n";
+ print "[curltest]\n";
+ print "accept = $accept_port\n";
+ print "connect = $target_port\n";
+ }
+}
+
+#***************************************************************************
+# Set file permissions on certificate pem file.
+#
+chmod(0600, $certfile) if(-f $certfile);
+
+#***************************************************************************
+# Run stunnel.
+#
+my $rc = system($cmd);
+
+$rc >>= 8;
+
+unlink($conffile) if($conffile && -f $conffile);
+
+exit $rc;
diff --git a/tests/server/Makefile.am b/tests/server/Makefile.am
new file mode 100644
index 000000000..d4b9cc38a
--- /dev/null
+++ b/tests/server/Makefile.am
@@ -0,0 +1,57 @@
+#***************************************************************************
+# _ _ ____ _
+# Project ___| | | | _ \| |
+# / __| | | | |_) | |
+# | (__| |_| | _ <| |___
+# \___|\___/|_| \_\_____|
+#
+# Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
+#
+# This software is licensed as described in the file COPYING, which
+# you should have received as part of this distribution. The terms
+# are also available at http://curl.haxx.se/docs/copyright.html.
+#
+# You may opt to use, copy, modify, merge, publish, distribute and/or sell
+# copies of the Software, and permit persons to whom the Software is
+# furnished to do so, under the terms of the COPYING file.
+#
+# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+# KIND, either express or implied.
+#
+###########################################################################
+AUTOMAKE_OPTIONS = foreign nostdinc
+
+# Specify our include paths here, and do it relative to $(top_srcdir) and
+# $(top_builddir), to ensure that these paths which belong to the library
+# being currently built and tested are searched before the library which
+# might possibly already be installed in the system.
+#
+# $(top_builddir)/include/curl for generated curlbuild.h included from curl.h
+# $(top_builddir)/include for generated curlbuild.h included from lib/setup.h
+# $(top_srcdir)/include is for libcurl's external include files
+# $(top_builddir)/lib is for libcurl's generated lib/curl_config.h file
+# $(top_srcdir)/lib is for libcurl's lib/setup.h and other "borrowed" files
+# $(top_builddir)/ares is for in-tree c-ares's generated ares_build.h file
+# $(top_srcdir)/ares is for in-tree c-ares's external include files
+
+if USE_EMBEDDED_ARES
+INCLUDES = -I$(top_builddir)/include/curl \
+ -I$(top_builddir)/include \
+ -I$(top_srcdir)/include \
+ -I$(top_builddir)/lib \
+ -I$(top_srcdir)/lib \
+ -I$(top_builddir)/ares \
+ -I$(top_srcdir)/ares
+else
+INCLUDES = -I$(top_builddir)/include/curl \
+ -I$(top_builddir)/include \
+ -I$(top_srcdir)/include \
+ -I$(top_builddir)/lib \
+ -I$(top_srcdir)/lib
+endif
+
+# Makefile.inc provides the source defines (noinst_PROGRAMS, useful, *_SOURCES, and *_LDADD)
+include Makefile.inc
+
+extra_DIST = base64.pl Makefile.inc
+
diff --git a/tests/server/Makefile.in b/tests/server/Makefile.in
new file mode 100644
index 000000000..a998155d2
--- /dev/null
+++ b/tests/server/Makefile.in
@@ -0,0 +1,1696 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(srcdir)/Makefile.inc
+noinst_PROGRAMS = getpart$(EXEEXT) resolve$(EXEEXT) rtspd$(EXEEXT) \
+ sockfilt$(EXEEXT) sws$(EXEEXT) tftpd$(EXEEXT)
+subdir = tests/server
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/curl-compilers.m4 \
+ $(top_srcdir)/m4/curl-confopts.m4 \
+ $(top_srcdir)/m4/curl-functions.m4 \
+ $(top_srcdir)/m4/curl-override.m4 \
+ $(top_srcdir)/m4/curl-reentrant.m4 \
+ $(top_srcdir)/m4/curl-system.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/lib/curl_config.h \
+ $(top_builddir)/src/curl_config.h \
+ $(top_builddir)/include/curl/curlbuild.h
+CONFIG_CLEAN_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am__objects_1 = getpart-mprintf.$(OBJEXT) getpart-nonblock.$(OBJEXT) \
+ getpart-strequal.$(OBJEXT) getpart-strtoofft.$(OBJEXT) \
+ getpart-timeval.$(OBJEXT) getpart-warnless.$(OBJEXT)
+am__objects_2 =
+am__objects_3 = getpart-getpart.$(OBJEXT) getpart-base64.$(OBJEXT) \
+ getpart-memdebug.$(OBJEXT)
+am_getpart_OBJECTS = $(am__objects_1) $(am__objects_2) \
+ $(am__objects_3) getpart-testpart.$(OBJEXT)
+getpart_OBJECTS = $(am_getpart_OBJECTS)
+getpart_DEPENDENCIES =
+am__objects_4 = resolve-mprintf.$(OBJEXT) resolve-nonblock.$(OBJEXT) \
+ resolve-strequal.$(OBJEXT) resolve-strtoofft.$(OBJEXT) \
+ resolve-timeval.$(OBJEXT) resolve-warnless.$(OBJEXT)
+am__objects_5 = resolve-getpart.$(OBJEXT) resolve-base64.$(OBJEXT) \
+ resolve-memdebug.$(OBJEXT)
+am__objects_6 = resolve-util.$(OBJEXT)
+am_resolve_OBJECTS = $(am__objects_4) $(am__objects_2) \
+ $(am__objects_5) $(am__objects_6) resolve-resolve.$(OBJEXT)
+resolve_OBJECTS = $(am_resolve_OBJECTS)
+resolve_DEPENDENCIES =
+am__objects_7 = rtspd-mprintf.$(OBJEXT) rtspd-nonblock.$(OBJEXT) \
+ rtspd-strequal.$(OBJEXT) rtspd-strtoofft.$(OBJEXT) \
+ rtspd-timeval.$(OBJEXT) rtspd-warnless.$(OBJEXT)
+am__objects_8 = rtspd-getpart.$(OBJEXT) rtspd-base64.$(OBJEXT) \
+ rtspd-memdebug.$(OBJEXT)
+am__objects_9 = rtspd-util.$(OBJEXT)
+am_rtspd_OBJECTS = $(am__objects_7) $(am__objects_2) $(am__objects_8) \
+ $(am__objects_9) rtspd-rtspd.$(OBJEXT)
+rtspd_OBJECTS = $(am_rtspd_OBJECTS)
+rtspd_DEPENDENCIES =
+am__objects_10 = sockfilt-mprintf.$(OBJEXT) \
+ sockfilt-nonblock.$(OBJEXT) sockfilt-strequal.$(OBJEXT) \
+ sockfilt-strtoofft.$(OBJEXT) sockfilt-timeval.$(OBJEXT) \
+ sockfilt-warnless.$(OBJEXT)
+am__objects_11 = sockfilt-getpart.$(OBJEXT) sockfilt-base64.$(OBJEXT) \
+ sockfilt-memdebug.$(OBJEXT)
+am__objects_12 = sockfilt-util.$(OBJEXT)
+am_sockfilt_OBJECTS = $(am__objects_10) $(am__objects_2) \
+ $(am__objects_11) $(am__objects_12) \
+ sockfilt-sockfilt.$(OBJEXT) sockfilt-inet_pton.$(OBJEXT)
+sockfilt_OBJECTS = $(am_sockfilt_OBJECTS)
+sockfilt_DEPENDENCIES =
+am__objects_13 = sws-mprintf.$(OBJEXT) sws-nonblock.$(OBJEXT) \
+ sws-strequal.$(OBJEXT) sws-strtoofft.$(OBJEXT) \
+ sws-timeval.$(OBJEXT) sws-warnless.$(OBJEXT)
+am__objects_14 = sws-getpart.$(OBJEXT) sws-base64.$(OBJEXT) \
+ sws-memdebug.$(OBJEXT)
+am__objects_15 = sws-util.$(OBJEXT)
+am_sws_OBJECTS = $(am__objects_13) $(am__objects_2) $(am__objects_14) \
+ $(am__objects_15) sws-sws.$(OBJEXT)
+sws_OBJECTS = $(am_sws_OBJECTS)
+sws_DEPENDENCIES =
+am__objects_16 = tftpd-mprintf.$(OBJEXT) tftpd-nonblock.$(OBJEXT) \
+ tftpd-strequal.$(OBJEXT) tftpd-strtoofft.$(OBJEXT) \
+ tftpd-timeval.$(OBJEXT) tftpd-warnless.$(OBJEXT)
+am__objects_17 = tftpd-getpart.$(OBJEXT) tftpd-base64.$(OBJEXT) \
+ tftpd-memdebug.$(OBJEXT)
+am__objects_18 = tftpd-util.$(OBJEXT)
+am_tftpd_OBJECTS = $(am__objects_16) $(am__objects_2) \
+ $(am__objects_17) $(am__objects_18) tftpd-tftpd.$(OBJEXT)
+tftpd_OBJECTS = $(am_tftpd_OBJECTS)
+tftpd_DEPENDENCIES =
+DEFAULT_INCLUDES =
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(getpart_SOURCES) $(resolve_SOURCES) $(rtspd_SOURCES) \
+ $(sockfilt_SOURCES) $(sws_SOURCES) $(tftpd_SOURCES)
+DIST_SOURCES = $(getpart_SOURCES) $(resolve_SOURCES) $(rtspd_SOURCES) \
+ $(sockfilt_SOURCES) $(sws_SOURCES) $(tftpd_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_LIBHOSTNAME_FALSE = @BUILD_LIBHOSTNAME_FALSE@
+BUILD_LIBHOSTNAME_TRUE = @BUILD_LIBHOSTNAME_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONFIGURE_OPTIONS = @CONFIGURE_OPTIONS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CROSSCOMPILING_FALSE = @CROSSCOMPILING_FALSE@
+CROSSCOMPILING_TRUE = @CROSSCOMPILING_TRUE@
+CURLDEBUG_FALSE = @CURLDEBUG_FALSE@
+CURLDEBUG_TRUE = @CURLDEBUG_TRUE@
+CURL_CA_BUNDLE = @CURL_CA_BUNDLE@
+CURL_CFLAG_EXTRAS = @CURL_CFLAG_EXTRAS@
+CURL_DISABLE_DICT = @CURL_DISABLE_DICT@
+CURL_DISABLE_FILE = @CURL_DISABLE_FILE@
+CURL_DISABLE_FTP = @CURL_DISABLE_FTP@
+CURL_DISABLE_GOPHER = @CURL_DISABLE_GOPHER@
+CURL_DISABLE_HTTP = @CURL_DISABLE_HTTP@
+CURL_DISABLE_IMAP = @CURL_DISABLE_IMAP@
+CURL_DISABLE_LDAP = @CURL_DISABLE_LDAP@
+CURL_DISABLE_LDAPS = @CURL_DISABLE_LDAPS@
+CURL_DISABLE_POP3 = @CURL_DISABLE_POP3@
+CURL_DISABLE_PROXY = @CURL_DISABLE_PROXY@
+CURL_DISABLE_RTSP = @CURL_DISABLE_RTSP@
+CURL_DISABLE_SMTP = @CURL_DISABLE_SMTP@
+CURL_DISABLE_TELNET = @CURL_DISABLE_TELNET@
+CURL_DISABLE_TFTP = @CURL_DISABLE_TFTP@
+CURL_LIBS = @CURL_LIBS@
+CURL_NETWORK_LIBS = @CURL_NETWORK_LIBS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_SHARED = @ENABLE_SHARED@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+HAVE_LDAP_SSL = @HAVE_LDAP_SSL@
+HAVE_LIBZ = @HAVE_LIBZ@
+HAVE_LIBZ_FALSE = @HAVE_LIBZ_FALSE@
+HAVE_LIBZ_TRUE = @HAVE_LIBZ_TRUE@
+HAVE_PK11_CREATEGENERICOBJECT = @HAVE_PK11_CREATEGENERICOBJECT@
+IDN_ENABLED = @IDN_ENABLED@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+IPV6_ENABLED = @IPV6_ENABLED@
+KRB4_ENABLED = @KRB4_ENABLED@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBCURL_LIBS = @LIBCURL_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+MANOPT = @MANOPT@
+MIMPURE_FALSE = @MIMPURE_FALSE@
+MIMPURE_TRUE = @MIMPURE_TRUE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NO_UNDEFINED_FALSE = @NO_UNDEFINED_FALSE@
+NO_UNDEFINED_TRUE = @NO_UNDEFINED_TRUE@
+NROFF = @NROFF@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH = @PATH@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+PKGADD_NAME = @PKGADD_NAME@
+PKGADD_PKG = @PKGADD_PKG@
+PKGADD_VENDOR = @PKGADD_VENDOR@
+PKGCONFIG = @PKGCONFIG@
+RANDOM_FILE = @RANDOM_FILE@
+RANLIB = @RANLIB@
+REQUIRE_LIB_DEPS = @REQUIRE_LIB_DEPS@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SONAME_BUMP_FALSE = @SONAME_BUMP_FALSE@
+SONAME_BUMP_TRUE = @SONAME_BUMP_TRUE@
+SSL_ENABLED = @SSL_ENABLED@
+STATICLIB_FALSE = @STATICLIB_FALSE@
+STATICLIB_TRUE = @STATICLIB_TRUE@
+STRIP = @STRIP@
+SUPPORT_FEATURES = @SUPPORT_FEATURES@
+SUPPORT_PROTOCOLS = @SUPPORT_PROTOCOLS@
+TEST_SERVER_LIBS = @TEST_SERVER_LIBS@
+USE_ARES = @USE_ARES@
+USE_EMBEDDED_ARES_FALSE = @USE_EMBEDDED_ARES_FALSE@
+USE_EMBEDDED_ARES_TRUE = @USE_EMBEDDED_ARES_TRUE@
+USE_GNUTLS = @USE_GNUTLS@
+USE_LIBRTMP = @USE_LIBRTMP@
+USE_LIBSSH2 = @USE_LIBSSH2@
+USE_MANUAL_FALSE = @USE_MANUAL_FALSE@
+USE_MANUAL_TRUE = @USE_MANUAL_TRUE@
+USE_NSS = @USE_NSS@
+USE_OPENLDAP = @USE_OPENLDAP@
+USE_POLARSSL = @USE_POLARSSL@
+USE_SSLEAY = @USE_SSLEAY@
+USE_WINDOWS_SSPI = @USE_WINDOWS_SSPI@
+VERSION = @VERSION@
+VERSIONNUM = @VERSIONNUM@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+libext = @libext@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+subdirs = @subdirs@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+
+#***************************************************************************
+# _ _ ____ _
+# Project ___| | | | _ \| |
+# / __| | | | |_) | |
+# | (__| |_| | _ <| |___
+# \___|\___/|_| \_\_____|
+#
+# Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
+#
+# This software is licensed as described in the file COPYING, which
+# you should have received as part of this distribution. The terms
+# are also available at http://curl.haxx.se/docs/copyright.html.
+#
+# You may opt to use, copy, modify, merge, publish, distribute and/or sell
+# copies of the Software, and permit persons to whom the Software is
+# furnished to do so, under the terms of the COPYING file.
+#
+# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+# KIND, either express or implied.
+#
+###########################################################################
+AUTOMAKE_OPTIONS = foreign nostdinc
+@USE_EMBEDDED_ARES_FALSE@INCLUDES = -I$(top_builddir)/include/curl \
+@USE_EMBEDDED_ARES_FALSE@ -I$(top_builddir)/include \
+@USE_EMBEDDED_ARES_FALSE@ -I$(top_srcdir)/include \
+@USE_EMBEDDED_ARES_FALSE@ -I$(top_builddir)/lib \
+@USE_EMBEDDED_ARES_FALSE@ -I$(top_srcdir)/lib
+
+
+# Specify our include paths here, and do it relative to $(top_srcdir) and
+# $(top_builddir), to ensure that these paths which belong to the library
+# being currently built and tested are searched before the library which
+# might possibly already be installed in the system.
+#
+# $(top_builddir)/include/curl for generated curlbuild.h included from curl.h
+# $(top_builddir)/include for generated curlbuild.h included from lib/setup.h
+# $(top_srcdir)/include is for libcurl's external include files
+# $(top_builddir)/lib is for libcurl's generated lib/curl_config.h file
+# $(top_srcdir)/lib is for libcurl's lib/setup.h and other "borrowed" files
+# $(top_builddir)/ares is for in-tree c-ares's generated ares_build.h file
+# $(top_srcdir)/ares is for in-tree c-ares's external include files
+@USE_EMBEDDED_ARES_TRUE@INCLUDES = -I$(top_builddir)/include/curl \
+@USE_EMBEDDED_ARES_TRUE@ -I$(top_builddir)/include \
+@USE_EMBEDDED_ARES_TRUE@ -I$(top_srcdir)/include \
+@USE_EMBEDDED_ARES_TRUE@ -I$(top_builddir)/lib \
+@USE_EMBEDDED_ARES_TRUE@ -I$(top_srcdir)/lib \
+@USE_EMBEDDED_ARES_TRUE@ -I$(top_builddir)/ares \
+@USE_EMBEDDED_ARES_TRUE@ -I$(top_srcdir)/ares
+
+CURLX_SRCS = \
+ $(top_srcdir)/lib/mprintf.c \
+ $(top_srcdir)/lib/nonblock.c \
+ $(top_srcdir)/lib/strequal.c \
+ $(top_srcdir)/lib/strtoofft.c \
+ $(top_srcdir)/lib/timeval.c \
+ $(top_srcdir)/lib/warnless.c
+
+CURLX_HDRS = \
+ $(top_srcdir)/lib/curlx.h \
+ $(top_srcdir)/lib/nonblock.h \
+ $(top_srcdir)/lib/strequal.h \
+ $(top_srcdir)/lib/strtoofft.h \
+ $(top_srcdir)/lib/timeval.h \
+ $(top_srcdir)/lib/warnless.h
+
+USEFUL = \
+ getpart.c \
+ getpart.h \
+ $(top_srcdir)/lib/base64.c \
+ $(top_srcdir)/lib/curl_base64.h \
+ $(top_srcdir)/lib/memdebug.c \
+ $(top_srcdir)/lib/memdebug.h
+
+UTIL = \
+ util.c \
+ util.h
+
+getpart_SOURCES = $(CURLX_SRCS) $(CURLX_HDRS) $(USEFUL) \
+ testpart.c
+
+getpart_LDADD = @TEST_SERVER_LIBS@
+getpart_CFLAGS = $(AM_CFLAGS)
+resolve_SOURCES = $(CURLX_SRCS) $(CURLX_HDRS) $(USEFUL) $(UTIL) \
+ resolve.c
+
+resolve_LDADD = @TEST_SERVER_LIBS@
+resolve_CFLAGS = $(AM_CFLAGS)
+rtspd_SOURCES = $(CURLX_SRCS) $(CURLX_HDRS) $(USEFUL) $(UTIL) \
+ server_sockaddr.h \
+ rtspd.c
+
+rtspd_LDADD = @TEST_SERVER_LIBS@
+rtspd_CFLAGS = $(AM_CFLAGS)
+sockfilt_SOURCES = $(CURLX_SRCS) $(CURLX_HDRS) $(USEFUL) $(UTIL) \
+ server_sockaddr.h \
+ sockfilt.c \
+ $(top_srcdir)/lib/inet_pton.c
+
+sockfilt_LDADD = @TEST_SERVER_LIBS@
+sockfilt_CFLAGS = $(AM_CFLAGS)
+sws_SOURCES = $(CURLX_SRCS) $(CURLX_HDRS) $(USEFUL) $(UTIL) \
+ server_sockaddr.h \
+ sws.c
+
+sws_LDADD = @TEST_SERVER_LIBS@
+sws_CFLAGS = $(AM_CFLAGS)
+tftpd_SOURCES = $(CURLX_SRCS) $(CURLX_HDRS) $(USEFUL) $(UTIL) \
+ server_sockaddr.h \
+ tftpd.c \
+ tftp.h
+
+tftpd_LDADD = @TEST_SERVER_LIBS@
+tftpd_CFLAGS = $(AM_CFLAGS)
+
+# Makefile.inc provides the source defines (noinst_PROGRAMS, useful, *_SOURCES, and *_LDADD)
+extra_DIST = base64.pl Makefile.inc
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/Makefile.inc $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/server/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign tests/server/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstPROGRAMS:
+ @list='$(noinst_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+getpart$(EXEEXT): $(getpart_OBJECTS) $(getpart_DEPENDENCIES)
+ @rm -f getpart$(EXEEXT)
+ $(LINK) $(getpart_LDFLAGS) $(getpart_OBJECTS) $(getpart_LDADD) $(LIBS)
+resolve$(EXEEXT): $(resolve_OBJECTS) $(resolve_DEPENDENCIES)
+ @rm -f resolve$(EXEEXT)
+ $(LINK) $(resolve_LDFLAGS) $(resolve_OBJECTS) $(resolve_LDADD) $(LIBS)
+rtspd$(EXEEXT): $(rtspd_OBJECTS) $(rtspd_DEPENDENCIES)
+ @rm -f rtspd$(EXEEXT)
+ $(LINK) $(rtspd_LDFLAGS) $(rtspd_OBJECTS) $(rtspd_LDADD) $(LIBS)
+sockfilt$(EXEEXT): $(sockfilt_OBJECTS) $(sockfilt_DEPENDENCIES)
+ @rm -f sockfilt$(EXEEXT)
+ $(LINK) $(sockfilt_LDFLAGS) $(sockfilt_OBJECTS) $(sockfilt_LDADD) $(LIBS)
+sws$(EXEEXT): $(sws_OBJECTS) $(sws_DEPENDENCIES)
+ @rm -f sws$(EXEEXT)
+ $(LINK) $(sws_LDFLAGS) $(sws_OBJECTS) $(sws_LDADD) $(LIBS)
+tftpd$(EXEEXT): $(tftpd_OBJECTS) $(tftpd_DEPENDENCIES)
+ @rm -f tftpd$(EXEEXT)
+ $(LINK) $(tftpd_LDFLAGS) $(tftpd_OBJECTS) $(tftpd_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpart-base64.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpart-getpart.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpart-memdebug.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpart-mprintf.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpart-nonblock.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpart-strequal.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpart-strtoofft.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpart-testpart.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpart-timeval.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpart-warnless.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resolve-base64.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resolve-getpart.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resolve-memdebug.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resolve-mprintf.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resolve-nonblock.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resolve-resolve.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resolve-strequal.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resolve-strtoofft.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resolve-timeval.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resolve-util.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resolve-warnless.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtspd-base64.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtspd-getpart.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtspd-memdebug.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtspd-mprintf.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtspd-nonblock.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtspd-rtspd.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtspd-strequal.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtspd-strtoofft.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtspd-timeval.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtspd-util.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtspd-warnless.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockfilt-base64.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockfilt-getpart.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockfilt-inet_pton.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockfilt-memdebug.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockfilt-mprintf.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockfilt-nonblock.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockfilt-sockfilt.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockfilt-strequal.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockfilt-strtoofft.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockfilt-timeval.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockfilt-util.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockfilt-warnless.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sws-base64.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sws-getpart.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sws-memdebug.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sws-mprintf.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sws-nonblock.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sws-strequal.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sws-strtoofft.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sws-sws.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sws-timeval.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sws-util.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sws-warnless.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tftpd-base64.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tftpd-getpart.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tftpd-memdebug.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tftpd-mprintf.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tftpd-nonblock.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tftpd-strequal.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tftpd-strtoofft.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tftpd-tftpd.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tftpd-timeval.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tftpd-util.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tftpd-warnless.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+getpart-mprintf.o: $(top_srcdir)/lib/mprintf.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT getpart-mprintf.o -MD -MP -MF "$(DEPDIR)/getpart-mprintf.Tpo" -c -o getpart-mprintf.o `test -f '$(top_srcdir)/lib/mprintf.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/mprintf.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/getpart-mprintf.Tpo" "$(DEPDIR)/getpart-mprintf.Po"; else rm -f "$(DEPDIR)/getpart-mprintf.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/mprintf.c' object='getpart-mprintf.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o getpart-mprintf.o `test -f '$(top_srcdir)/lib/mprintf.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/mprintf.c
+
+getpart-mprintf.obj: $(top_srcdir)/lib/mprintf.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT getpart-mprintf.obj -MD -MP -MF "$(DEPDIR)/getpart-mprintf.Tpo" -c -o getpart-mprintf.obj `if test -f '$(top_srcdir)/lib/mprintf.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/mprintf.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/mprintf.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/getpart-mprintf.Tpo" "$(DEPDIR)/getpart-mprintf.Po"; else rm -f "$(DEPDIR)/getpart-mprintf.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/mprintf.c' object='getpart-mprintf.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o getpart-mprintf.obj `if test -f '$(top_srcdir)/lib/mprintf.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/mprintf.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/mprintf.c'; fi`
+
+getpart-nonblock.o: $(top_srcdir)/lib/nonblock.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT getpart-nonblock.o -MD -MP -MF "$(DEPDIR)/getpart-nonblock.Tpo" -c -o getpart-nonblock.o `test -f '$(top_srcdir)/lib/nonblock.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/nonblock.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/getpart-nonblock.Tpo" "$(DEPDIR)/getpart-nonblock.Po"; else rm -f "$(DEPDIR)/getpart-nonblock.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/nonblock.c' object='getpart-nonblock.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o getpart-nonblock.o `test -f '$(top_srcdir)/lib/nonblock.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/nonblock.c
+
+getpart-nonblock.obj: $(top_srcdir)/lib/nonblock.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT getpart-nonblock.obj -MD -MP -MF "$(DEPDIR)/getpart-nonblock.Tpo" -c -o getpart-nonblock.obj `if test -f '$(top_srcdir)/lib/nonblock.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/nonblock.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/nonblock.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/getpart-nonblock.Tpo" "$(DEPDIR)/getpart-nonblock.Po"; else rm -f "$(DEPDIR)/getpart-nonblock.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/nonblock.c' object='getpart-nonblock.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o getpart-nonblock.obj `if test -f '$(top_srcdir)/lib/nonblock.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/nonblock.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/nonblock.c'; fi`
+
+getpart-strequal.o: $(top_srcdir)/lib/strequal.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT getpart-strequal.o -MD -MP -MF "$(DEPDIR)/getpart-strequal.Tpo" -c -o getpart-strequal.o `test -f '$(top_srcdir)/lib/strequal.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/strequal.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/getpart-strequal.Tpo" "$(DEPDIR)/getpart-strequal.Po"; else rm -f "$(DEPDIR)/getpart-strequal.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/strequal.c' object='getpart-strequal.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o getpart-strequal.o `test -f '$(top_srcdir)/lib/strequal.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/strequal.c
+
+getpart-strequal.obj: $(top_srcdir)/lib/strequal.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT getpart-strequal.obj -MD -MP -MF "$(DEPDIR)/getpart-strequal.Tpo" -c -o getpart-strequal.obj `if test -f '$(top_srcdir)/lib/strequal.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/strequal.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/strequal.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/getpart-strequal.Tpo" "$(DEPDIR)/getpart-strequal.Po"; else rm -f "$(DEPDIR)/getpart-strequal.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/strequal.c' object='getpart-strequal.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o getpart-strequal.obj `if test -f '$(top_srcdir)/lib/strequal.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/strequal.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/strequal.c'; fi`
+
+getpart-strtoofft.o: $(top_srcdir)/lib/strtoofft.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT getpart-strtoofft.o -MD -MP -MF "$(DEPDIR)/getpart-strtoofft.Tpo" -c -o getpart-strtoofft.o `test -f '$(top_srcdir)/lib/strtoofft.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/strtoofft.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/getpart-strtoofft.Tpo" "$(DEPDIR)/getpart-strtoofft.Po"; else rm -f "$(DEPDIR)/getpart-strtoofft.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/strtoofft.c' object='getpart-strtoofft.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o getpart-strtoofft.o `test -f '$(top_srcdir)/lib/strtoofft.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/strtoofft.c
+
+getpart-strtoofft.obj: $(top_srcdir)/lib/strtoofft.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT getpart-strtoofft.obj -MD -MP -MF "$(DEPDIR)/getpart-strtoofft.Tpo" -c -o getpart-strtoofft.obj `if test -f '$(top_srcdir)/lib/strtoofft.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/strtoofft.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/strtoofft.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/getpart-strtoofft.Tpo" "$(DEPDIR)/getpart-strtoofft.Po"; else rm -f "$(DEPDIR)/getpart-strtoofft.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/strtoofft.c' object='getpart-strtoofft.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o getpart-strtoofft.obj `if test -f '$(top_srcdir)/lib/strtoofft.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/strtoofft.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/strtoofft.c'; fi`
+
+getpart-timeval.o: $(top_srcdir)/lib/timeval.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT getpart-timeval.o -MD -MP -MF "$(DEPDIR)/getpart-timeval.Tpo" -c -o getpart-timeval.o `test -f '$(top_srcdir)/lib/timeval.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/timeval.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/getpart-timeval.Tpo" "$(DEPDIR)/getpart-timeval.Po"; else rm -f "$(DEPDIR)/getpart-timeval.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/timeval.c' object='getpart-timeval.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o getpart-timeval.o `test -f '$(top_srcdir)/lib/timeval.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/timeval.c
+
+getpart-timeval.obj: $(top_srcdir)/lib/timeval.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT getpart-timeval.obj -MD -MP -MF "$(DEPDIR)/getpart-timeval.Tpo" -c -o getpart-timeval.obj `if test -f '$(top_srcdir)/lib/timeval.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/timeval.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/timeval.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/getpart-timeval.Tpo" "$(DEPDIR)/getpart-timeval.Po"; else rm -f "$(DEPDIR)/getpart-timeval.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/timeval.c' object='getpart-timeval.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o getpart-timeval.obj `if test -f '$(top_srcdir)/lib/timeval.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/timeval.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/timeval.c'; fi`
+
+getpart-warnless.o: $(top_srcdir)/lib/warnless.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT getpart-warnless.o -MD -MP -MF "$(DEPDIR)/getpart-warnless.Tpo" -c -o getpart-warnless.o `test -f '$(top_srcdir)/lib/warnless.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/warnless.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/getpart-warnless.Tpo" "$(DEPDIR)/getpart-warnless.Po"; else rm -f "$(DEPDIR)/getpart-warnless.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/warnless.c' object='getpart-warnless.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o getpart-warnless.o `test -f '$(top_srcdir)/lib/warnless.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/warnless.c
+
+getpart-warnless.obj: $(top_srcdir)/lib/warnless.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT getpart-warnless.obj -MD -MP -MF "$(DEPDIR)/getpart-warnless.Tpo" -c -o getpart-warnless.obj `if test -f '$(top_srcdir)/lib/warnless.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/warnless.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/warnless.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/getpart-warnless.Tpo" "$(DEPDIR)/getpart-warnless.Po"; else rm -f "$(DEPDIR)/getpart-warnless.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/warnless.c' object='getpart-warnless.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o getpart-warnless.obj `if test -f '$(top_srcdir)/lib/warnless.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/warnless.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/warnless.c'; fi`
+
+getpart-getpart.o: getpart.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT getpart-getpart.o -MD -MP -MF "$(DEPDIR)/getpart-getpart.Tpo" -c -o getpart-getpart.o `test -f 'getpart.c' || echo '$(srcdir)/'`getpart.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/getpart-getpart.Tpo" "$(DEPDIR)/getpart-getpart.Po"; else rm -f "$(DEPDIR)/getpart-getpart.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='getpart.c' object='getpart-getpart.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o getpart-getpart.o `test -f 'getpart.c' || echo '$(srcdir)/'`getpart.c
+
+getpart-getpart.obj: getpart.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT getpart-getpart.obj -MD -MP -MF "$(DEPDIR)/getpart-getpart.Tpo" -c -o getpart-getpart.obj `if test -f 'getpart.c'; then $(CYGPATH_W) 'getpart.c'; else $(CYGPATH_W) '$(srcdir)/getpart.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/getpart-getpart.Tpo" "$(DEPDIR)/getpart-getpart.Po"; else rm -f "$(DEPDIR)/getpart-getpart.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='getpart.c' object='getpart-getpart.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o getpart-getpart.obj `if test -f 'getpart.c'; then $(CYGPATH_W) 'getpart.c'; else $(CYGPATH_W) '$(srcdir)/getpart.c'; fi`
+
+getpart-base64.o: $(top_srcdir)/lib/base64.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT getpart-base64.o -MD -MP -MF "$(DEPDIR)/getpart-base64.Tpo" -c -o getpart-base64.o `test -f '$(top_srcdir)/lib/base64.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/base64.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/getpart-base64.Tpo" "$(DEPDIR)/getpart-base64.Po"; else rm -f "$(DEPDIR)/getpart-base64.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/base64.c' object='getpart-base64.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o getpart-base64.o `test -f '$(top_srcdir)/lib/base64.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/base64.c
+
+getpart-base64.obj: $(top_srcdir)/lib/base64.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT getpart-base64.obj -MD -MP -MF "$(DEPDIR)/getpart-base64.Tpo" -c -o getpart-base64.obj `if test -f '$(top_srcdir)/lib/base64.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/base64.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/base64.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/getpart-base64.Tpo" "$(DEPDIR)/getpart-base64.Po"; else rm -f "$(DEPDIR)/getpart-base64.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/base64.c' object='getpart-base64.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o getpart-base64.obj `if test -f '$(top_srcdir)/lib/base64.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/base64.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/base64.c'; fi`
+
+getpart-memdebug.o: $(top_srcdir)/lib/memdebug.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT getpart-memdebug.o -MD -MP -MF "$(DEPDIR)/getpart-memdebug.Tpo" -c -o getpart-memdebug.o `test -f '$(top_srcdir)/lib/memdebug.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/memdebug.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/getpart-memdebug.Tpo" "$(DEPDIR)/getpart-memdebug.Po"; else rm -f "$(DEPDIR)/getpart-memdebug.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/memdebug.c' object='getpart-memdebug.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o getpart-memdebug.o `test -f '$(top_srcdir)/lib/memdebug.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/memdebug.c
+
+getpart-memdebug.obj: $(top_srcdir)/lib/memdebug.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT getpart-memdebug.obj -MD -MP -MF "$(DEPDIR)/getpart-memdebug.Tpo" -c -o getpart-memdebug.obj `if test -f '$(top_srcdir)/lib/memdebug.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/memdebug.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/memdebug.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/getpart-memdebug.Tpo" "$(DEPDIR)/getpart-memdebug.Po"; else rm -f "$(DEPDIR)/getpart-memdebug.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/memdebug.c' object='getpart-memdebug.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o getpart-memdebug.obj `if test -f '$(top_srcdir)/lib/memdebug.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/memdebug.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/memdebug.c'; fi`
+
+getpart-testpart.o: testpart.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT getpart-testpart.o -MD -MP -MF "$(DEPDIR)/getpart-testpart.Tpo" -c -o getpart-testpart.o `test -f 'testpart.c' || echo '$(srcdir)/'`testpart.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/getpart-testpart.Tpo" "$(DEPDIR)/getpart-testpart.Po"; else rm -f "$(DEPDIR)/getpart-testpart.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testpart.c' object='getpart-testpart.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o getpart-testpart.o `test -f 'testpart.c' || echo '$(srcdir)/'`testpart.c
+
+getpart-testpart.obj: testpart.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT getpart-testpart.obj -MD -MP -MF "$(DEPDIR)/getpart-testpart.Tpo" -c -o getpart-testpart.obj `if test -f 'testpart.c'; then $(CYGPATH_W) 'testpart.c'; else $(CYGPATH_W) '$(srcdir)/testpart.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/getpart-testpart.Tpo" "$(DEPDIR)/getpart-testpart.Po"; else rm -f "$(DEPDIR)/getpart-testpart.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testpart.c' object='getpart-testpart.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o getpart-testpart.obj `if test -f 'testpart.c'; then $(CYGPATH_W) 'testpart.c'; else $(CYGPATH_W) '$(srcdir)/testpart.c'; fi`
+
+resolve-mprintf.o: $(top_srcdir)/lib/mprintf.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT resolve-mprintf.o -MD -MP -MF "$(DEPDIR)/resolve-mprintf.Tpo" -c -o resolve-mprintf.o `test -f '$(top_srcdir)/lib/mprintf.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/mprintf.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/resolve-mprintf.Tpo" "$(DEPDIR)/resolve-mprintf.Po"; else rm -f "$(DEPDIR)/resolve-mprintf.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/mprintf.c' object='resolve-mprintf.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o resolve-mprintf.o `test -f '$(top_srcdir)/lib/mprintf.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/mprintf.c
+
+resolve-mprintf.obj: $(top_srcdir)/lib/mprintf.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT resolve-mprintf.obj -MD -MP -MF "$(DEPDIR)/resolve-mprintf.Tpo" -c -o resolve-mprintf.obj `if test -f '$(top_srcdir)/lib/mprintf.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/mprintf.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/mprintf.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/resolve-mprintf.Tpo" "$(DEPDIR)/resolve-mprintf.Po"; else rm -f "$(DEPDIR)/resolve-mprintf.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/mprintf.c' object='resolve-mprintf.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o resolve-mprintf.obj `if test -f '$(top_srcdir)/lib/mprintf.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/mprintf.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/mprintf.c'; fi`
+
+resolve-nonblock.o: $(top_srcdir)/lib/nonblock.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT resolve-nonblock.o -MD -MP -MF "$(DEPDIR)/resolve-nonblock.Tpo" -c -o resolve-nonblock.o `test -f '$(top_srcdir)/lib/nonblock.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/nonblock.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/resolve-nonblock.Tpo" "$(DEPDIR)/resolve-nonblock.Po"; else rm -f "$(DEPDIR)/resolve-nonblock.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/nonblock.c' object='resolve-nonblock.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o resolve-nonblock.o `test -f '$(top_srcdir)/lib/nonblock.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/nonblock.c
+
+resolve-nonblock.obj: $(top_srcdir)/lib/nonblock.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT resolve-nonblock.obj -MD -MP -MF "$(DEPDIR)/resolve-nonblock.Tpo" -c -o resolve-nonblock.obj `if test -f '$(top_srcdir)/lib/nonblock.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/nonblock.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/nonblock.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/resolve-nonblock.Tpo" "$(DEPDIR)/resolve-nonblock.Po"; else rm -f "$(DEPDIR)/resolve-nonblock.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/nonblock.c' object='resolve-nonblock.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o resolve-nonblock.obj `if test -f '$(top_srcdir)/lib/nonblock.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/nonblock.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/nonblock.c'; fi`
+
+resolve-strequal.o: $(top_srcdir)/lib/strequal.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT resolve-strequal.o -MD -MP -MF "$(DEPDIR)/resolve-strequal.Tpo" -c -o resolve-strequal.o `test -f '$(top_srcdir)/lib/strequal.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/strequal.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/resolve-strequal.Tpo" "$(DEPDIR)/resolve-strequal.Po"; else rm -f "$(DEPDIR)/resolve-strequal.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/strequal.c' object='resolve-strequal.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o resolve-strequal.o `test -f '$(top_srcdir)/lib/strequal.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/strequal.c
+
+resolve-strequal.obj: $(top_srcdir)/lib/strequal.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT resolve-strequal.obj -MD -MP -MF "$(DEPDIR)/resolve-strequal.Tpo" -c -o resolve-strequal.obj `if test -f '$(top_srcdir)/lib/strequal.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/strequal.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/strequal.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/resolve-strequal.Tpo" "$(DEPDIR)/resolve-strequal.Po"; else rm -f "$(DEPDIR)/resolve-strequal.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/strequal.c' object='resolve-strequal.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o resolve-strequal.obj `if test -f '$(top_srcdir)/lib/strequal.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/strequal.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/strequal.c'; fi`
+
+resolve-strtoofft.o: $(top_srcdir)/lib/strtoofft.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT resolve-strtoofft.o -MD -MP -MF "$(DEPDIR)/resolve-strtoofft.Tpo" -c -o resolve-strtoofft.o `test -f '$(top_srcdir)/lib/strtoofft.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/strtoofft.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/resolve-strtoofft.Tpo" "$(DEPDIR)/resolve-strtoofft.Po"; else rm -f "$(DEPDIR)/resolve-strtoofft.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/strtoofft.c' object='resolve-strtoofft.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o resolve-strtoofft.o `test -f '$(top_srcdir)/lib/strtoofft.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/strtoofft.c
+
+resolve-strtoofft.obj: $(top_srcdir)/lib/strtoofft.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT resolve-strtoofft.obj -MD -MP -MF "$(DEPDIR)/resolve-strtoofft.Tpo" -c -o resolve-strtoofft.obj `if test -f '$(top_srcdir)/lib/strtoofft.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/strtoofft.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/strtoofft.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/resolve-strtoofft.Tpo" "$(DEPDIR)/resolve-strtoofft.Po"; else rm -f "$(DEPDIR)/resolve-strtoofft.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/strtoofft.c' object='resolve-strtoofft.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o resolve-strtoofft.obj `if test -f '$(top_srcdir)/lib/strtoofft.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/strtoofft.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/strtoofft.c'; fi`
+
+resolve-timeval.o: $(top_srcdir)/lib/timeval.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT resolve-timeval.o -MD -MP -MF "$(DEPDIR)/resolve-timeval.Tpo" -c -o resolve-timeval.o `test -f '$(top_srcdir)/lib/timeval.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/timeval.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/resolve-timeval.Tpo" "$(DEPDIR)/resolve-timeval.Po"; else rm -f "$(DEPDIR)/resolve-timeval.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/timeval.c' object='resolve-timeval.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o resolve-timeval.o `test -f '$(top_srcdir)/lib/timeval.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/timeval.c
+
+resolve-timeval.obj: $(top_srcdir)/lib/timeval.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT resolve-timeval.obj -MD -MP -MF "$(DEPDIR)/resolve-timeval.Tpo" -c -o resolve-timeval.obj `if test -f '$(top_srcdir)/lib/timeval.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/timeval.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/timeval.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/resolve-timeval.Tpo" "$(DEPDIR)/resolve-timeval.Po"; else rm -f "$(DEPDIR)/resolve-timeval.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/timeval.c' object='resolve-timeval.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o resolve-timeval.obj `if test -f '$(top_srcdir)/lib/timeval.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/timeval.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/timeval.c'; fi`
+
+resolve-warnless.o: $(top_srcdir)/lib/warnless.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT resolve-warnless.o -MD -MP -MF "$(DEPDIR)/resolve-warnless.Tpo" -c -o resolve-warnless.o `test -f '$(top_srcdir)/lib/warnless.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/warnless.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/resolve-warnless.Tpo" "$(DEPDIR)/resolve-warnless.Po"; else rm -f "$(DEPDIR)/resolve-warnless.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/warnless.c' object='resolve-warnless.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o resolve-warnless.o `test -f '$(top_srcdir)/lib/warnless.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/warnless.c
+
+resolve-warnless.obj: $(top_srcdir)/lib/warnless.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT resolve-warnless.obj -MD -MP -MF "$(DEPDIR)/resolve-warnless.Tpo" -c -o resolve-warnless.obj `if test -f '$(top_srcdir)/lib/warnless.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/warnless.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/warnless.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/resolve-warnless.Tpo" "$(DEPDIR)/resolve-warnless.Po"; else rm -f "$(DEPDIR)/resolve-warnless.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/warnless.c' object='resolve-warnless.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o resolve-warnless.obj `if test -f '$(top_srcdir)/lib/warnless.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/warnless.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/warnless.c'; fi`
+
+resolve-getpart.o: getpart.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT resolve-getpart.o -MD -MP -MF "$(DEPDIR)/resolve-getpart.Tpo" -c -o resolve-getpart.o `test -f 'getpart.c' || echo '$(srcdir)/'`getpart.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/resolve-getpart.Tpo" "$(DEPDIR)/resolve-getpart.Po"; else rm -f "$(DEPDIR)/resolve-getpart.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='getpart.c' object='resolve-getpart.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o resolve-getpart.o `test -f 'getpart.c' || echo '$(srcdir)/'`getpart.c
+
+resolve-getpart.obj: getpart.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT resolve-getpart.obj -MD -MP -MF "$(DEPDIR)/resolve-getpart.Tpo" -c -o resolve-getpart.obj `if test -f 'getpart.c'; then $(CYGPATH_W) 'getpart.c'; else $(CYGPATH_W) '$(srcdir)/getpart.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/resolve-getpart.Tpo" "$(DEPDIR)/resolve-getpart.Po"; else rm -f "$(DEPDIR)/resolve-getpart.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='getpart.c' object='resolve-getpart.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o resolve-getpart.obj `if test -f 'getpart.c'; then $(CYGPATH_W) 'getpart.c'; else $(CYGPATH_W) '$(srcdir)/getpart.c'; fi`
+
+resolve-base64.o: $(top_srcdir)/lib/base64.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT resolve-base64.o -MD -MP -MF "$(DEPDIR)/resolve-base64.Tpo" -c -o resolve-base64.o `test -f '$(top_srcdir)/lib/base64.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/base64.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/resolve-base64.Tpo" "$(DEPDIR)/resolve-base64.Po"; else rm -f "$(DEPDIR)/resolve-base64.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/base64.c' object='resolve-base64.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o resolve-base64.o `test -f '$(top_srcdir)/lib/base64.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/base64.c
+
+resolve-base64.obj: $(top_srcdir)/lib/base64.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT resolve-base64.obj -MD -MP -MF "$(DEPDIR)/resolve-base64.Tpo" -c -o resolve-base64.obj `if test -f '$(top_srcdir)/lib/base64.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/base64.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/base64.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/resolve-base64.Tpo" "$(DEPDIR)/resolve-base64.Po"; else rm -f "$(DEPDIR)/resolve-base64.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/base64.c' object='resolve-base64.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o resolve-base64.obj `if test -f '$(top_srcdir)/lib/base64.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/base64.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/base64.c'; fi`
+
+resolve-memdebug.o: $(top_srcdir)/lib/memdebug.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT resolve-memdebug.o -MD -MP -MF "$(DEPDIR)/resolve-memdebug.Tpo" -c -o resolve-memdebug.o `test -f '$(top_srcdir)/lib/memdebug.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/memdebug.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/resolve-memdebug.Tpo" "$(DEPDIR)/resolve-memdebug.Po"; else rm -f "$(DEPDIR)/resolve-memdebug.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/memdebug.c' object='resolve-memdebug.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o resolve-memdebug.o `test -f '$(top_srcdir)/lib/memdebug.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/memdebug.c
+
+resolve-memdebug.obj: $(top_srcdir)/lib/memdebug.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT resolve-memdebug.obj -MD -MP -MF "$(DEPDIR)/resolve-memdebug.Tpo" -c -o resolve-memdebug.obj `if test -f '$(top_srcdir)/lib/memdebug.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/memdebug.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/memdebug.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/resolve-memdebug.Tpo" "$(DEPDIR)/resolve-memdebug.Po"; else rm -f "$(DEPDIR)/resolve-memdebug.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/memdebug.c' object='resolve-memdebug.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o resolve-memdebug.obj `if test -f '$(top_srcdir)/lib/memdebug.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/memdebug.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/memdebug.c'; fi`
+
+resolve-util.o: util.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT resolve-util.o -MD -MP -MF "$(DEPDIR)/resolve-util.Tpo" -c -o resolve-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/resolve-util.Tpo" "$(DEPDIR)/resolve-util.Po"; else rm -f "$(DEPDIR)/resolve-util.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util.c' object='resolve-util.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o resolve-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c
+
+resolve-util.obj: util.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT resolve-util.obj -MD -MP -MF "$(DEPDIR)/resolve-util.Tpo" -c -o resolve-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/resolve-util.Tpo" "$(DEPDIR)/resolve-util.Po"; else rm -f "$(DEPDIR)/resolve-util.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util.c' object='resolve-util.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o resolve-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi`
+
+resolve-resolve.o: resolve.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT resolve-resolve.o -MD -MP -MF "$(DEPDIR)/resolve-resolve.Tpo" -c -o resolve-resolve.o `test -f 'resolve.c' || echo '$(srcdir)/'`resolve.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/resolve-resolve.Tpo" "$(DEPDIR)/resolve-resolve.Po"; else rm -f "$(DEPDIR)/resolve-resolve.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='resolve.c' object='resolve-resolve.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o resolve-resolve.o `test -f 'resolve.c' || echo '$(srcdir)/'`resolve.c
+
+resolve-resolve.obj: resolve.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT resolve-resolve.obj -MD -MP -MF "$(DEPDIR)/resolve-resolve.Tpo" -c -o resolve-resolve.obj `if test -f 'resolve.c'; then $(CYGPATH_W) 'resolve.c'; else $(CYGPATH_W) '$(srcdir)/resolve.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/resolve-resolve.Tpo" "$(DEPDIR)/resolve-resolve.Po"; else rm -f "$(DEPDIR)/resolve-resolve.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='resolve.c' object='resolve-resolve.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o resolve-resolve.obj `if test -f 'resolve.c'; then $(CYGPATH_W) 'resolve.c'; else $(CYGPATH_W) '$(srcdir)/resolve.c'; fi`
+
+rtspd-mprintf.o: $(top_srcdir)/lib/mprintf.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT rtspd-mprintf.o -MD -MP -MF "$(DEPDIR)/rtspd-mprintf.Tpo" -c -o rtspd-mprintf.o `test -f '$(top_srcdir)/lib/mprintf.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/mprintf.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/rtspd-mprintf.Tpo" "$(DEPDIR)/rtspd-mprintf.Po"; else rm -f "$(DEPDIR)/rtspd-mprintf.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/mprintf.c' object='rtspd-mprintf.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o rtspd-mprintf.o `test -f '$(top_srcdir)/lib/mprintf.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/mprintf.c
+
+rtspd-mprintf.obj: $(top_srcdir)/lib/mprintf.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT rtspd-mprintf.obj -MD -MP -MF "$(DEPDIR)/rtspd-mprintf.Tpo" -c -o rtspd-mprintf.obj `if test -f '$(top_srcdir)/lib/mprintf.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/mprintf.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/mprintf.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/rtspd-mprintf.Tpo" "$(DEPDIR)/rtspd-mprintf.Po"; else rm -f "$(DEPDIR)/rtspd-mprintf.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/mprintf.c' object='rtspd-mprintf.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o rtspd-mprintf.obj `if test -f '$(top_srcdir)/lib/mprintf.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/mprintf.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/mprintf.c'; fi`
+
+rtspd-nonblock.o: $(top_srcdir)/lib/nonblock.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT rtspd-nonblock.o -MD -MP -MF "$(DEPDIR)/rtspd-nonblock.Tpo" -c -o rtspd-nonblock.o `test -f '$(top_srcdir)/lib/nonblock.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/nonblock.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/rtspd-nonblock.Tpo" "$(DEPDIR)/rtspd-nonblock.Po"; else rm -f "$(DEPDIR)/rtspd-nonblock.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/nonblock.c' object='rtspd-nonblock.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o rtspd-nonblock.o `test -f '$(top_srcdir)/lib/nonblock.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/nonblock.c
+
+rtspd-nonblock.obj: $(top_srcdir)/lib/nonblock.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT rtspd-nonblock.obj -MD -MP -MF "$(DEPDIR)/rtspd-nonblock.Tpo" -c -o rtspd-nonblock.obj `if test -f '$(top_srcdir)/lib/nonblock.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/nonblock.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/nonblock.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/rtspd-nonblock.Tpo" "$(DEPDIR)/rtspd-nonblock.Po"; else rm -f "$(DEPDIR)/rtspd-nonblock.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/nonblock.c' object='rtspd-nonblock.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o rtspd-nonblock.obj `if test -f '$(top_srcdir)/lib/nonblock.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/nonblock.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/nonblock.c'; fi`
+
+rtspd-strequal.o: $(top_srcdir)/lib/strequal.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT rtspd-strequal.o -MD -MP -MF "$(DEPDIR)/rtspd-strequal.Tpo" -c -o rtspd-strequal.o `test -f '$(top_srcdir)/lib/strequal.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/strequal.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/rtspd-strequal.Tpo" "$(DEPDIR)/rtspd-strequal.Po"; else rm -f "$(DEPDIR)/rtspd-strequal.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/strequal.c' object='rtspd-strequal.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o rtspd-strequal.o `test -f '$(top_srcdir)/lib/strequal.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/strequal.c
+
+rtspd-strequal.obj: $(top_srcdir)/lib/strequal.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT rtspd-strequal.obj -MD -MP -MF "$(DEPDIR)/rtspd-strequal.Tpo" -c -o rtspd-strequal.obj `if test -f '$(top_srcdir)/lib/strequal.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/strequal.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/strequal.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/rtspd-strequal.Tpo" "$(DEPDIR)/rtspd-strequal.Po"; else rm -f "$(DEPDIR)/rtspd-strequal.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/strequal.c' object='rtspd-strequal.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o rtspd-strequal.obj `if test -f '$(top_srcdir)/lib/strequal.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/strequal.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/strequal.c'; fi`
+
+rtspd-strtoofft.o: $(top_srcdir)/lib/strtoofft.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT rtspd-strtoofft.o -MD -MP -MF "$(DEPDIR)/rtspd-strtoofft.Tpo" -c -o rtspd-strtoofft.o `test -f '$(top_srcdir)/lib/strtoofft.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/strtoofft.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/rtspd-strtoofft.Tpo" "$(DEPDIR)/rtspd-strtoofft.Po"; else rm -f "$(DEPDIR)/rtspd-strtoofft.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/strtoofft.c' object='rtspd-strtoofft.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o rtspd-strtoofft.o `test -f '$(top_srcdir)/lib/strtoofft.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/strtoofft.c
+
+rtspd-strtoofft.obj: $(top_srcdir)/lib/strtoofft.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT rtspd-strtoofft.obj -MD -MP -MF "$(DEPDIR)/rtspd-strtoofft.Tpo" -c -o rtspd-strtoofft.obj `if test -f '$(top_srcdir)/lib/strtoofft.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/strtoofft.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/strtoofft.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/rtspd-strtoofft.Tpo" "$(DEPDIR)/rtspd-strtoofft.Po"; else rm -f "$(DEPDIR)/rtspd-strtoofft.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/strtoofft.c' object='rtspd-strtoofft.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o rtspd-strtoofft.obj `if test -f '$(top_srcdir)/lib/strtoofft.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/strtoofft.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/strtoofft.c'; fi`
+
+rtspd-timeval.o: $(top_srcdir)/lib/timeval.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT rtspd-timeval.o -MD -MP -MF "$(DEPDIR)/rtspd-timeval.Tpo" -c -o rtspd-timeval.o `test -f '$(top_srcdir)/lib/timeval.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/timeval.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/rtspd-timeval.Tpo" "$(DEPDIR)/rtspd-timeval.Po"; else rm -f "$(DEPDIR)/rtspd-timeval.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/timeval.c' object='rtspd-timeval.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o rtspd-timeval.o `test -f '$(top_srcdir)/lib/timeval.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/timeval.c
+
+rtspd-timeval.obj: $(top_srcdir)/lib/timeval.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT rtspd-timeval.obj -MD -MP -MF "$(DEPDIR)/rtspd-timeval.Tpo" -c -o rtspd-timeval.obj `if test -f '$(top_srcdir)/lib/timeval.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/timeval.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/timeval.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/rtspd-timeval.Tpo" "$(DEPDIR)/rtspd-timeval.Po"; else rm -f "$(DEPDIR)/rtspd-timeval.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/timeval.c' object='rtspd-timeval.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o rtspd-timeval.obj `if test -f '$(top_srcdir)/lib/timeval.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/timeval.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/timeval.c'; fi`
+
+rtspd-warnless.o: $(top_srcdir)/lib/warnless.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT rtspd-warnless.o -MD -MP -MF "$(DEPDIR)/rtspd-warnless.Tpo" -c -o rtspd-warnless.o `test -f '$(top_srcdir)/lib/warnless.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/warnless.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/rtspd-warnless.Tpo" "$(DEPDIR)/rtspd-warnless.Po"; else rm -f "$(DEPDIR)/rtspd-warnless.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/warnless.c' object='rtspd-warnless.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o rtspd-warnless.o `test -f '$(top_srcdir)/lib/warnless.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/warnless.c
+
+rtspd-warnless.obj: $(top_srcdir)/lib/warnless.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT rtspd-warnless.obj -MD -MP -MF "$(DEPDIR)/rtspd-warnless.Tpo" -c -o rtspd-warnless.obj `if test -f '$(top_srcdir)/lib/warnless.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/warnless.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/warnless.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/rtspd-warnless.Tpo" "$(DEPDIR)/rtspd-warnless.Po"; else rm -f "$(DEPDIR)/rtspd-warnless.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/warnless.c' object='rtspd-warnless.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o rtspd-warnless.obj `if test -f '$(top_srcdir)/lib/warnless.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/warnless.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/warnless.c'; fi`
+
+rtspd-getpart.o: getpart.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT rtspd-getpart.o -MD -MP -MF "$(DEPDIR)/rtspd-getpart.Tpo" -c -o rtspd-getpart.o `test -f 'getpart.c' || echo '$(srcdir)/'`getpart.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/rtspd-getpart.Tpo" "$(DEPDIR)/rtspd-getpart.Po"; else rm -f "$(DEPDIR)/rtspd-getpart.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='getpart.c' object='rtspd-getpart.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o rtspd-getpart.o `test -f 'getpart.c' || echo '$(srcdir)/'`getpart.c
+
+rtspd-getpart.obj: getpart.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT rtspd-getpart.obj -MD -MP -MF "$(DEPDIR)/rtspd-getpart.Tpo" -c -o rtspd-getpart.obj `if test -f 'getpart.c'; then $(CYGPATH_W) 'getpart.c'; else $(CYGPATH_W) '$(srcdir)/getpart.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/rtspd-getpart.Tpo" "$(DEPDIR)/rtspd-getpart.Po"; else rm -f "$(DEPDIR)/rtspd-getpart.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='getpart.c' object='rtspd-getpart.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o rtspd-getpart.obj `if test -f 'getpart.c'; then $(CYGPATH_W) 'getpart.c'; else $(CYGPATH_W) '$(srcdir)/getpart.c'; fi`
+
+rtspd-base64.o: $(top_srcdir)/lib/base64.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT rtspd-base64.o -MD -MP -MF "$(DEPDIR)/rtspd-base64.Tpo" -c -o rtspd-base64.o `test -f '$(top_srcdir)/lib/base64.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/base64.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/rtspd-base64.Tpo" "$(DEPDIR)/rtspd-base64.Po"; else rm -f "$(DEPDIR)/rtspd-base64.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/base64.c' object='rtspd-base64.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o rtspd-base64.o `test -f '$(top_srcdir)/lib/base64.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/base64.c
+
+rtspd-base64.obj: $(top_srcdir)/lib/base64.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT rtspd-base64.obj -MD -MP -MF "$(DEPDIR)/rtspd-base64.Tpo" -c -o rtspd-base64.obj `if test -f '$(top_srcdir)/lib/base64.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/base64.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/base64.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/rtspd-base64.Tpo" "$(DEPDIR)/rtspd-base64.Po"; else rm -f "$(DEPDIR)/rtspd-base64.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/base64.c' object='rtspd-base64.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o rtspd-base64.obj `if test -f '$(top_srcdir)/lib/base64.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/base64.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/base64.c'; fi`
+
+rtspd-memdebug.o: $(top_srcdir)/lib/memdebug.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT rtspd-memdebug.o -MD -MP -MF "$(DEPDIR)/rtspd-memdebug.Tpo" -c -o rtspd-memdebug.o `test -f '$(top_srcdir)/lib/memdebug.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/memdebug.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/rtspd-memdebug.Tpo" "$(DEPDIR)/rtspd-memdebug.Po"; else rm -f "$(DEPDIR)/rtspd-memdebug.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/memdebug.c' object='rtspd-memdebug.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o rtspd-memdebug.o `test -f '$(top_srcdir)/lib/memdebug.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/memdebug.c
+
+rtspd-memdebug.obj: $(top_srcdir)/lib/memdebug.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT rtspd-memdebug.obj -MD -MP -MF "$(DEPDIR)/rtspd-memdebug.Tpo" -c -o rtspd-memdebug.obj `if test -f '$(top_srcdir)/lib/memdebug.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/memdebug.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/memdebug.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/rtspd-memdebug.Tpo" "$(DEPDIR)/rtspd-memdebug.Po"; else rm -f "$(DEPDIR)/rtspd-memdebug.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/memdebug.c' object='rtspd-memdebug.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o rtspd-memdebug.obj `if test -f '$(top_srcdir)/lib/memdebug.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/memdebug.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/memdebug.c'; fi`
+
+rtspd-util.o: util.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT rtspd-util.o -MD -MP -MF "$(DEPDIR)/rtspd-util.Tpo" -c -o rtspd-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/rtspd-util.Tpo" "$(DEPDIR)/rtspd-util.Po"; else rm -f "$(DEPDIR)/rtspd-util.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util.c' object='rtspd-util.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o rtspd-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c
+
+rtspd-util.obj: util.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT rtspd-util.obj -MD -MP -MF "$(DEPDIR)/rtspd-util.Tpo" -c -o rtspd-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/rtspd-util.Tpo" "$(DEPDIR)/rtspd-util.Po"; else rm -f "$(DEPDIR)/rtspd-util.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util.c' object='rtspd-util.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o rtspd-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi`
+
+rtspd-rtspd.o: rtspd.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT rtspd-rtspd.o -MD -MP -MF "$(DEPDIR)/rtspd-rtspd.Tpo" -c -o rtspd-rtspd.o `test -f 'rtspd.c' || echo '$(srcdir)/'`rtspd.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/rtspd-rtspd.Tpo" "$(DEPDIR)/rtspd-rtspd.Po"; else rm -f "$(DEPDIR)/rtspd-rtspd.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rtspd.c' object='rtspd-rtspd.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o rtspd-rtspd.o `test -f 'rtspd.c' || echo '$(srcdir)/'`rtspd.c
+
+rtspd-rtspd.obj: rtspd.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT rtspd-rtspd.obj -MD -MP -MF "$(DEPDIR)/rtspd-rtspd.Tpo" -c -o rtspd-rtspd.obj `if test -f 'rtspd.c'; then $(CYGPATH_W) 'rtspd.c'; else $(CYGPATH_W) '$(srcdir)/rtspd.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/rtspd-rtspd.Tpo" "$(DEPDIR)/rtspd-rtspd.Po"; else rm -f "$(DEPDIR)/rtspd-rtspd.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rtspd.c' object='rtspd-rtspd.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o rtspd-rtspd.obj `if test -f 'rtspd.c'; then $(CYGPATH_W) 'rtspd.c'; else $(CYGPATH_W) '$(srcdir)/rtspd.c'; fi`
+
+sockfilt-mprintf.o: $(top_srcdir)/lib/mprintf.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT sockfilt-mprintf.o -MD -MP -MF "$(DEPDIR)/sockfilt-mprintf.Tpo" -c -o sockfilt-mprintf.o `test -f '$(top_srcdir)/lib/mprintf.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/mprintf.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sockfilt-mprintf.Tpo" "$(DEPDIR)/sockfilt-mprintf.Po"; else rm -f "$(DEPDIR)/sockfilt-mprintf.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/mprintf.c' object='sockfilt-mprintf.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o sockfilt-mprintf.o `test -f '$(top_srcdir)/lib/mprintf.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/mprintf.c
+
+sockfilt-mprintf.obj: $(top_srcdir)/lib/mprintf.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT sockfilt-mprintf.obj -MD -MP -MF "$(DEPDIR)/sockfilt-mprintf.Tpo" -c -o sockfilt-mprintf.obj `if test -f '$(top_srcdir)/lib/mprintf.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/mprintf.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/mprintf.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sockfilt-mprintf.Tpo" "$(DEPDIR)/sockfilt-mprintf.Po"; else rm -f "$(DEPDIR)/sockfilt-mprintf.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/mprintf.c' object='sockfilt-mprintf.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o sockfilt-mprintf.obj `if test -f '$(top_srcdir)/lib/mprintf.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/mprintf.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/mprintf.c'; fi`
+
+sockfilt-nonblock.o: $(top_srcdir)/lib/nonblock.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT sockfilt-nonblock.o -MD -MP -MF "$(DEPDIR)/sockfilt-nonblock.Tpo" -c -o sockfilt-nonblock.o `test -f '$(top_srcdir)/lib/nonblock.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/nonblock.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sockfilt-nonblock.Tpo" "$(DEPDIR)/sockfilt-nonblock.Po"; else rm -f "$(DEPDIR)/sockfilt-nonblock.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/nonblock.c' object='sockfilt-nonblock.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o sockfilt-nonblock.o `test -f '$(top_srcdir)/lib/nonblock.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/nonblock.c
+
+sockfilt-nonblock.obj: $(top_srcdir)/lib/nonblock.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT sockfilt-nonblock.obj -MD -MP -MF "$(DEPDIR)/sockfilt-nonblock.Tpo" -c -o sockfilt-nonblock.obj `if test -f '$(top_srcdir)/lib/nonblock.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/nonblock.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/nonblock.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sockfilt-nonblock.Tpo" "$(DEPDIR)/sockfilt-nonblock.Po"; else rm -f "$(DEPDIR)/sockfilt-nonblock.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/nonblock.c' object='sockfilt-nonblock.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o sockfilt-nonblock.obj `if test -f '$(top_srcdir)/lib/nonblock.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/nonblock.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/nonblock.c'; fi`
+
+sockfilt-strequal.o: $(top_srcdir)/lib/strequal.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT sockfilt-strequal.o -MD -MP -MF "$(DEPDIR)/sockfilt-strequal.Tpo" -c -o sockfilt-strequal.o `test -f '$(top_srcdir)/lib/strequal.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/strequal.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sockfilt-strequal.Tpo" "$(DEPDIR)/sockfilt-strequal.Po"; else rm -f "$(DEPDIR)/sockfilt-strequal.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/strequal.c' object='sockfilt-strequal.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o sockfilt-strequal.o `test -f '$(top_srcdir)/lib/strequal.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/strequal.c
+
+sockfilt-strequal.obj: $(top_srcdir)/lib/strequal.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT sockfilt-strequal.obj -MD -MP -MF "$(DEPDIR)/sockfilt-strequal.Tpo" -c -o sockfilt-strequal.obj `if test -f '$(top_srcdir)/lib/strequal.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/strequal.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/strequal.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sockfilt-strequal.Tpo" "$(DEPDIR)/sockfilt-strequal.Po"; else rm -f "$(DEPDIR)/sockfilt-strequal.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/strequal.c' object='sockfilt-strequal.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o sockfilt-strequal.obj `if test -f '$(top_srcdir)/lib/strequal.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/strequal.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/strequal.c'; fi`
+
+sockfilt-strtoofft.o: $(top_srcdir)/lib/strtoofft.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT sockfilt-strtoofft.o -MD -MP -MF "$(DEPDIR)/sockfilt-strtoofft.Tpo" -c -o sockfilt-strtoofft.o `test -f '$(top_srcdir)/lib/strtoofft.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/strtoofft.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sockfilt-strtoofft.Tpo" "$(DEPDIR)/sockfilt-strtoofft.Po"; else rm -f "$(DEPDIR)/sockfilt-strtoofft.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/strtoofft.c' object='sockfilt-strtoofft.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o sockfilt-strtoofft.o `test -f '$(top_srcdir)/lib/strtoofft.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/strtoofft.c
+
+sockfilt-strtoofft.obj: $(top_srcdir)/lib/strtoofft.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT sockfilt-strtoofft.obj -MD -MP -MF "$(DEPDIR)/sockfilt-strtoofft.Tpo" -c -o sockfilt-strtoofft.obj `if test -f '$(top_srcdir)/lib/strtoofft.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/strtoofft.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/strtoofft.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sockfilt-strtoofft.Tpo" "$(DEPDIR)/sockfilt-strtoofft.Po"; else rm -f "$(DEPDIR)/sockfilt-strtoofft.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/strtoofft.c' object='sockfilt-strtoofft.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o sockfilt-strtoofft.obj `if test -f '$(top_srcdir)/lib/strtoofft.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/strtoofft.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/strtoofft.c'; fi`
+
+sockfilt-timeval.o: $(top_srcdir)/lib/timeval.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT sockfilt-timeval.o -MD -MP -MF "$(DEPDIR)/sockfilt-timeval.Tpo" -c -o sockfilt-timeval.o `test -f '$(top_srcdir)/lib/timeval.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/timeval.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sockfilt-timeval.Tpo" "$(DEPDIR)/sockfilt-timeval.Po"; else rm -f "$(DEPDIR)/sockfilt-timeval.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/timeval.c' object='sockfilt-timeval.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o sockfilt-timeval.o `test -f '$(top_srcdir)/lib/timeval.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/timeval.c
+
+sockfilt-timeval.obj: $(top_srcdir)/lib/timeval.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT sockfilt-timeval.obj -MD -MP -MF "$(DEPDIR)/sockfilt-timeval.Tpo" -c -o sockfilt-timeval.obj `if test -f '$(top_srcdir)/lib/timeval.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/timeval.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/timeval.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sockfilt-timeval.Tpo" "$(DEPDIR)/sockfilt-timeval.Po"; else rm -f "$(DEPDIR)/sockfilt-timeval.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/timeval.c' object='sockfilt-timeval.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o sockfilt-timeval.obj `if test -f '$(top_srcdir)/lib/timeval.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/timeval.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/timeval.c'; fi`
+
+sockfilt-warnless.o: $(top_srcdir)/lib/warnless.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT sockfilt-warnless.o -MD -MP -MF "$(DEPDIR)/sockfilt-warnless.Tpo" -c -o sockfilt-warnless.o `test -f '$(top_srcdir)/lib/warnless.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/warnless.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sockfilt-warnless.Tpo" "$(DEPDIR)/sockfilt-warnless.Po"; else rm -f "$(DEPDIR)/sockfilt-warnless.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/warnless.c' object='sockfilt-warnless.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o sockfilt-warnless.o `test -f '$(top_srcdir)/lib/warnless.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/warnless.c
+
+sockfilt-warnless.obj: $(top_srcdir)/lib/warnless.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT sockfilt-warnless.obj -MD -MP -MF "$(DEPDIR)/sockfilt-warnless.Tpo" -c -o sockfilt-warnless.obj `if test -f '$(top_srcdir)/lib/warnless.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/warnless.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/warnless.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sockfilt-warnless.Tpo" "$(DEPDIR)/sockfilt-warnless.Po"; else rm -f "$(DEPDIR)/sockfilt-warnless.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/warnless.c' object='sockfilt-warnless.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o sockfilt-warnless.obj `if test -f '$(top_srcdir)/lib/warnless.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/warnless.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/warnless.c'; fi`
+
+sockfilt-getpart.o: getpart.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT sockfilt-getpart.o -MD -MP -MF "$(DEPDIR)/sockfilt-getpart.Tpo" -c -o sockfilt-getpart.o `test -f 'getpart.c' || echo '$(srcdir)/'`getpart.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sockfilt-getpart.Tpo" "$(DEPDIR)/sockfilt-getpart.Po"; else rm -f "$(DEPDIR)/sockfilt-getpart.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='getpart.c' object='sockfilt-getpart.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o sockfilt-getpart.o `test -f 'getpart.c' || echo '$(srcdir)/'`getpart.c
+
+sockfilt-getpart.obj: getpart.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT sockfilt-getpart.obj -MD -MP -MF "$(DEPDIR)/sockfilt-getpart.Tpo" -c -o sockfilt-getpart.obj `if test -f 'getpart.c'; then $(CYGPATH_W) 'getpart.c'; else $(CYGPATH_W) '$(srcdir)/getpart.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sockfilt-getpart.Tpo" "$(DEPDIR)/sockfilt-getpart.Po"; else rm -f "$(DEPDIR)/sockfilt-getpart.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='getpart.c' object='sockfilt-getpart.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o sockfilt-getpart.obj `if test -f 'getpart.c'; then $(CYGPATH_W) 'getpart.c'; else $(CYGPATH_W) '$(srcdir)/getpart.c'; fi`
+
+sockfilt-base64.o: $(top_srcdir)/lib/base64.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT sockfilt-base64.o -MD -MP -MF "$(DEPDIR)/sockfilt-base64.Tpo" -c -o sockfilt-base64.o `test -f '$(top_srcdir)/lib/base64.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/base64.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sockfilt-base64.Tpo" "$(DEPDIR)/sockfilt-base64.Po"; else rm -f "$(DEPDIR)/sockfilt-base64.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/base64.c' object='sockfilt-base64.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o sockfilt-base64.o `test -f '$(top_srcdir)/lib/base64.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/base64.c
+
+sockfilt-base64.obj: $(top_srcdir)/lib/base64.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT sockfilt-base64.obj -MD -MP -MF "$(DEPDIR)/sockfilt-base64.Tpo" -c -o sockfilt-base64.obj `if test -f '$(top_srcdir)/lib/base64.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/base64.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/base64.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sockfilt-base64.Tpo" "$(DEPDIR)/sockfilt-base64.Po"; else rm -f "$(DEPDIR)/sockfilt-base64.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/base64.c' object='sockfilt-base64.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o sockfilt-base64.obj `if test -f '$(top_srcdir)/lib/base64.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/base64.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/base64.c'; fi`
+
+sockfilt-memdebug.o: $(top_srcdir)/lib/memdebug.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT sockfilt-memdebug.o -MD -MP -MF "$(DEPDIR)/sockfilt-memdebug.Tpo" -c -o sockfilt-memdebug.o `test -f '$(top_srcdir)/lib/memdebug.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/memdebug.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sockfilt-memdebug.Tpo" "$(DEPDIR)/sockfilt-memdebug.Po"; else rm -f "$(DEPDIR)/sockfilt-memdebug.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/memdebug.c' object='sockfilt-memdebug.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o sockfilt-memdebug.o `test -f '$(top_srcdir)/lib/memdebug.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/memdebug.c
+
+sockfilt-memdebug.obj: $(top_srcdir)/lib/memdebug.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT sockfilt-memdebug.obj -MD -MP -MF "$(DEPDIR)/sockfilt-memdebug.Tpo" -c -o sockfilt-memdebug.obj `if test -f '$(top_srcdir)/lib/memdebug.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/memdebug.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/memdebug.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sockfilt-memdebug.Tpo" "$(DEPDIR)/sockfilt-memdebug.Po"; else rm -f "$(DEPDIR)/sockfilt-memdebug.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/memdebug.c' object='sockfilt-memdebug.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o sockfilt-memdebug.obj `if test -f '$(top_srcdir)/lib/memdebug.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/memdebug.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/memdebug.c'; fi`
+
+sockfilt-util.o: util.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT sockfilt-util.o -MD -MP -MF "$(DEPDIR)/sockfilt-util.Tpo" -c -o sockfilt-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sockfilt-util.Tpo" "$(DEPDIR)/sockfilt-util.Po"; else rm -f "$(DEPDIR)/sockfilt-util.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util.c' object='sockfilt-util.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o sockfilt-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c
+
+sockfilt-util.obj: util.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT sockfilt-util.obj -MD -MP -MF "$(DEPDIR)/sockfilt-util.Tpo" -c -o sockfilt-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sockfilt-util.Tpo" "$(DEPDIR)/sockfilt-util.Po"; else rm -f "$(DEPDIR)/sockfilt-util.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util.c' object='sockfilt-util.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o sockfilt-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi`
+
+sockfilt-sockfilt.o: sockfilt.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT sockfilt-sockfilt.o -MD -MP -MF "$(DEPDIR)/sockfilt-sockfilt.Tpo" -c -o sockfilt-sockfilt.o `test -f 'sockfilt.c' || echo '$(srcdir)/'`sockfilt.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sockfilt-sockfilt.Tpo" "$(DEPDIR)/sockfilt-sockfilt.Po"; else rm -f "$(DEPDIR)/sockfilt-sockfilt.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sockfilt.c' object='sockfilt-sockfilt.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o sockfilt-sockfilt.o `test -f 'sockfilt.c' || echo '$(srcdir)/'`sockfilt.c
+
+sockfilt-sockfilt.obj: sockfilt.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT sockfilt-sockfilt.obj -MD -MP -MF "$(DEPDIR)/sockfilt-sockfilt.Tpo" -c -o sockfilt-sockfilt.obj `if test -f 'sockfilt.c'; then $(CYGPATH_W) 'sockfilt.c'; else $(CYGPATH_W) '$(srcdir)/sockfilt.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sockfilt-sockfilt.Tpo" "$(DEPDIR)/sockfilt-sockfilt.Po"; else rm -f "$(DEPDIR)/sockfilt-sockfilt.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sockfilt.c' object='sockfilt-sockfilt.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o sockfilt-sockfilt.obj `if test -f 'sockfilt.c'; then $(CYGPATH_W) 'sockfilt.c'; else $(CYGPATH_W) '$(srcdir)/sockfilt.c'; fi`
+
+sockfilt-inet_pton.o: $(top_srcdir)/lib/inet_pton.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT sockfilt-inet_pton.o -MD -MP -MF "$(DEPDIR)/sockfilt-inet_pton.Tpo" -c -o sockfilt-inet_pton.o `test -f '$(top_srcdir)/lib/inet_pton.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/inet_pton.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sockfilt-inet_pton.Tpo" "$(DEPDIR)/sockfilt-inet_pton.Po"; else rm -f "$(DEPDIR)/sockfilt-inet_pton.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/inet_pton.c' object='sockfilt-inet_pton.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o sockfilt-inet_pton.o `test -f '$(top_srcdir)/lib/inet_pton.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/inet_pton.c
+
+sockfilt-inet_pton.obj: $(top_srcdir)/lib/inet_pton.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT sockfilt-inet_pton.obj -MD -MP -MF "$(DEPDIR)/sockfilt-inet_pton.Tpo" -c -o sockfilt-inet_pton.obj `if test -f '$(top_srcdir)/lib/inet_pton.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/inet_pton.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/inet_pton.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sockfilt-inet_pton.Tpo" "$(DEPDIR)/sockfilt-inet_pton.Po"; else rm -f "$(DEPDIR)/sockfilt-inet_pton.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/inet_pton.c' object='sockfilt-inet_pton.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o sockfilt-inet_pton.obj `if test -f '$(top_srcdir)/lib/inet_pton.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/inet_pton.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/inet_pton.c'; fi`
+
+sws-mprintf.o: $(top_srcdir)/lib/mprintf.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT sws-mprintf.o -MD -MP -MF "$(DEPDIR)/sws-mprintf.Tpo" -c -o sws-mprintf.o `test -f '$(top_srcdir)/lib/mprintf.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/mprintf.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sws-mprintf.Tpo" "$(DEPDIR)/sws-mprintf.Po"; else rm -f "$(DEPDIR)/sws-mprintf.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/mprintf.c' object='sws-mprintf.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o sws-mprintf.o `test -f '$(top_srcdir)/lib/mprintf.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/mprintf.c
+
+sws-mprintf.obj: $(top_srcdir)/lib/mprintf.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT sws-mprintf.obj -MD -MP -MF "$(DEPDIR)/sws-mprintf.Tpo" -c -o sws-mprintf.obj `if test -f '$(top_srcdir)/lib/mprintf.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/mprintf.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/mprintf.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sws-mprintf.Tpo" "$(DEPDIR)/sws-mprintf.Po"; else rm -f "$(DEPDIR)/sws-mprintf.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/mprintf.c' object='sws-mprintf.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o sws-mprintf.obj `if test -f '$(top_srcdir)/lib/mprintf.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/mprintf.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/mprintf.c'; fi`
+
+sws-nonblock.o: $(top_srcdir)/lib/nonblock.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT sws-nonblock.o -MD -MP -MF "$(DEPDIR)/sws-nonblock.Tpo" -c -o sws-nonblock.o `test -f '$(top_srcdir)/lib/nonblock.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/nonblock.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sws-nonblock.Tpo" "$(DEPDIR)/sws-nonblock.Po"; else rm -f "$(DEPDIR)/sws-nonblock.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/nonblock.c' object='sws-nonblock.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o sws-nonblock.o `test -f '$(top_srcdir)/lib/nonblock.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/nonblock.c
+
+sws-nonblock.obj: $(top_srcdir)/lib/nonblock.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT sws-nonblock.obj -MD -MP -MF "$(DEPDIR)/sws-nonblock.Tpo" -c -o sws-nonblock.obj `if test -f '$(top_srcdir)/lib/nonblock.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/nonblock.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/nonblock.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sws-nonblock.Tpo" "$(DEPDIR)/sws-nonblock.Po"; else rm -f "$(DEPDIR)/sws-nonblock.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/nonblock.c' object='sws-nonblock.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o sws-nonblock.obj `if test -f '$(top_srcdir)/lib/nonblock.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/nonblock.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/nonblock.c'; fi`
+
+sws-strequal.o: $(top_srcdir)/lib/strequal.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT sws-strequal.o -MD -MP -MF "$(DEPDIR)/sws-strequal.Tpo" -c -o sws-strequal.o `test -f '$(top_srcdir)/lib/strequal.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/strequal.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sws-strequal.Tpo" "$(DEPDIR)/sws-strequal.Po"; else rm -f "$(DEPDIR)/sws-strequal.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/strequal.c' object='sws-strequal.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o sws-strequal.o `test -f '$(top_srcdir)/lib/strequal.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/strequal.c
+
+sws-strequal.obj: $(top_srcdir)/lib/strequal.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT sws-strequal.obj -MD -MP -MF "$(DEPDIR)/sws-strequal.Tpo" -c -o sws-strequal.obj `if test -f '$(top_srcdir)/lib/strequal.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/strequal.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/strequal.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sws-strequal.Tpo" "$(DEPDIR)/sws-strequal.Po"; else rm -f "$(DEPDIR)/sws-strequal.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/strequal.c' object='sws-strequal.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o sws-strequal.obj `if test -f '$(top_srcdir)/lib/strequal.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/strequal.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/strequal.c'; fi`
+
+sws-strtoofft.o: $(top_srcdir)/lib/strtoofft.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT sws-strtoofft.o -MD -MP -MF "$(DEPDIR)/sws-strtoofft.Tpo" -c -o sws-strtoofft.o `test -f '$(top_srcdir)/lib/strtoofft.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/strtoofft.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sws-strtoofft.Tpo" "$(DEPDIR)/sws-strtoofft.Po"; else rm -f "$(DEPDIR)/sws-strtoofft.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/strtoofft.c' object='sws-strtoofft.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o sws-strtoofft.o `test -f '$(top_srcdir)/lib/strtoofft.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/strtoofft.c
+
+sws-strtoofft.obj: $(top_srcdir)/lib/strtoofft.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT sws-strtoofft.obj -MD -MP -MF "$(DEPDIR)/sws-strtoofft.Tpo" -c -o sws-strtoofft.obj `if test -f '$(top_srcdir)/lib/strtoofft.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/strtoofft.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/strtoofft.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sws-strtoofft.Tpo" "$(DEPDIR)/sws-strtoofft.Po"; else rm -f "$(DEPDIR)/sws-strtoofft.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/strtoofft.c' object='sws-strtoofft.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o sws-strtoofft.obj `if test -f '$(top_srcdir)/lib/strtoofft.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/strtoofft.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/strtoofft.c'; fi`
+
+sws-timeval.o: $(top_srcdir)/lib/timeval.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT sws-timeval.o -MD -MP -MF "$(DEPDIR)/sws-timeval.Tpo" -c -o sws-timeval.o `test -f '$(top_srcdir)/lib/timeval.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/timeval.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sws-timeval.Tpo" "$(DEPDIR)/sws-timeval.Po"; else rm -f "$(DEPDIR)/sws-timeval.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/timeval.c' object='sws-timeval.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o sws-timeval.o `test -f '$(top_srcdir)/lib/timeval.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/timeval.c
+
+sws-timeval.obj: $(top_srcdir)/lib/timeval.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT sws-timeval.obj -MD -MP -MF "$(DEPDIR)/sws-timeval.Tpo" -c -o sws-timeval.obj `if test -f '$(top_srcdir)/lib/timeval.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/timeval.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/timeval.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sws-timeval.Tpo" "$(DEPDIR)/sws-timeval.Po"; else rm -f "$(DEPDIR)/sws-timeval.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/timeval.c' object='sws-timeval.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o sws-timeval.obj `if test -f '$(top_srcdir)/lib/timeval.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/timeval.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/timeval.c'; fi`
+
+sws-warnless.o: $(top_srcdir)/lib/warnless.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT sws-warnless.o -MD -MP -MF "$(DEPDIR)/sws-warnless.Tpo" -c -o sws-warnless.o `test -f '$(top_srcdir)/lib/warnless.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/warnless.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sws-warnless.Tpo" "$(DEPDIR)/sws-warnless.Po"; else rm -f "$(DEPDIR)/sws-warnless.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/warnless.c' object='sws-warnless.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o sws-warnless.o `test -f '$(top_srcdir)/lib/warnless.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/warnless.c
+
+sws-warnless.obj: $(top_srcdir)/lib/warnless.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT sws-warnless.obj -MD -MP -MF "$(DEPDIR)/sws-warnless.Tpo" -c -o sws-warnless.obj `if test -f '$(top_srcdir)/lib/warnless.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/warnless.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/warnless.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sws-warnless.Tpo" "$(DEPDIR)/sws-warnless.Po"; else rm -f "$(DEPDIR)/sws-warnless.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/warnless.c' object='sws-warnless.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o sws-warnless.obj `if test -f '$(top_srcdir)/lib/warnless.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/warnless.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/warnless.c'; fi`
+
+sws-getpart.o: getpart.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT sws-getpart.o -MD -MP -MF "$(DEPDIR)/sws-getpart.Tpo" -c -o sws-getpart.o `test -f 'getpart.c' || echo '$(srcdir)/'`getpart.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sws-getpart.Tpo" "$(DEPDIR)/sws-getpart.Po"; else rm -f "$(DEPDIR)/sws-getpart.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='getpart.c' object='sws-getpart.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o sws-getpart.o `test -f 'getpart.c' || echo '$(srcdir)/'`getpart.c
+
+sws-getpart.obj: getpart.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT sws-getpart.obj -MD -MP -MF "$(DEPDIR)/sws-getpart.Tpo" -c -o sws-getpart.obj `if test -f 'getpart.c'; then $(CYGPATH_W) 'getpart.c'; else $(CYGPATH_W) '$(srcdir)/getpart.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sws-getpart.Tpo" "$(DEPDIR)/sws-getpart.Po"; else rm -f "$(DEPDIR)/sws-getpart.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='getpart.c' object='sws-getpart.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o sws-getpart.obj `if test -f 'getpart.c'; then $(CYGPATH_W) 'getpart.c'; else $(CYGPATH_W) '$(srcdir)/getpart.c'; fi`
+
+sws-base64.o: $(top_srcdir)/lib/base64.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT sws-base64.o -MD -MP -MF "$(DEPDIR)/sws-base64.Tpo" -c -o sws-base64.o `test -f '$(top_srcdir)/lib/base64.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/base64.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sws-base64.Tpo" "$(DEPDIR)/sws-base64.Po"; else rm -f "$(DEPDIR)/sws-base64.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/base64.c' object='sws-base64.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o sws-base64.o `test -f '$(top_srcdir)/lib/base64.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/base64.c
+
+sws-base64.obj: $(top_srcdir)/lib/base64.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT sws-base64.obj -MD -MP -MF "$(DEPDIR)/sws-base64.Tpo" -c -o sws-base64.obj `if test -f '$(top_srcdir)/lib/base64.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/base64.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/base64.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sws-base64.Tpo" "$(DEPDIR)/sws-base64.Po"; else rm -f "$(DEPDIR)/sws-base64.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/base64.c' object='sws-base64.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o sws-base64.obj `if test -f '$(top_srcdir)/lib/base64.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/base64.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/base64.c'; fi`
+
+sws-memdebug.o: $(top_srcdir)/lib/memdebug.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT sws-memdebug.o -MD -MP -MF "$(DEPDIR)/sws-memdebug.Tpo" -c -o sws-memdebug.o `test -f '$(top_srcdir)/lib/memdebug.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/memdebug.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sws-memdebug.Tpo" "$(DEPDIR)/sws-memdebug.Po"; else rm -f "$(DEPDIR)/sws-memdebug.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/memdebug.c' object='sws-memdebug.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o sws-memdebug.o `test -f '$(top_srcdir)/lib/memdebug.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/memdebug.c
+
+sws-memdebug.obj: $(top_srcdir)/lib/memdebug.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT sws-memdebug.obj -MD -MP -MF "$(DEPDIR)/sws-memdebug.Tpo" -c -o sws-memdebug.obj `if test -f '$(top_srcdir)/lib/memdebug.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/memdebug.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/memdebug.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sws-memdebug.Tpo" "$(DEPDIR)/sws-memdebug.Po"; else rm -f "$(DEPDIR)/sws-memdebug.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/memdebug.c' object='sws-memdebug.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o sws-memdebug.obj `if test -f '$(top_srcdir)/lib/memdebug.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/memdebug.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/memdebug.c'; fi`
+
+sws-util.o: util.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT sws-util.o -MD -MP -MF "$(DEPDIR)/sws-util.Tpo" -c -o sws-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sws-util.Tpo" "$(DEPDIR)/sws-util.Po"; else rm -f "$(DEPDIR)/sws-util.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util.c' object='sws-util.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o sws-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c
+
+sws-util.obj: util.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT sws-util.obj -MD -MP -MF "$(DEPDIR)/sws-util.Tpo" -c -o sws-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sws-util.Tpo" "$(DEPDIR)/sws-util.Po"; else rm -f "$(DEPDIR)/sws-util.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util.c' object='sws-util.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o sws-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi`
+
+sws-sws.o: sws.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT sws-sws.o -MD -MP -MF "$(DEPDIR)/sws-sws.Tpo" -c -o sws-sws.o `test -f 'sws.c' || echo '$(srcdir)/'`sws.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sws-sws.Tpo" "$(DEPDIR)/sws-sws.Po"; else rm -f "$(DEPDIR)/sws-sws.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sws.c' object='sws-sws.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o sws-sws.o `test -f 'sws.c' || echo '$(srcdir)/'`sws.c
+
+sws-sws.obj: sws.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT sws-sws.obj -MD -MP -MF "$(DEPDIR)/sws-sws.Tpo" -c -o sws-sws.obj `if test -f 'sws.c'; then $(CYGPATH_W) 'sws.c'; else $(CYGPATH_W) '$(srcdir)/sws.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sws-sws.Tpo" "$(DEPDIR)/sws-sws.Po"; else rm -f "$(DEPDIR)/sws-sws.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sws.c' object='sws-sws.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o sws-sws.obj `if test -f 'sws.c'; then $(CYGPATH_W) 'sws.c'; else $(CYGPATH_W) '$(srcdir)/sws.c'; fi`
+
+tftpd-mprintf.o: $(top_srcdir)/lib/mprintf.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT tftpd-mprintf.o -MD -MP -MF "$(DEPDIR)/tftpd-mprintf.Tpo" -c -o tftpd-mprintf.o `test -f '$(top_srcdir)/lib/mprintf.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/mprintf.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/tftpd-mprintf.Tpo" "$(DEPDIR)/tftpd-mprintf.Po"; else rm -f "$(DEPDIR)/tftpd-mprintf.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/mprintf.c' object='tftpd-mprintf.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o tftpd-mprintf.o `test -f '$(top_srcdir)/lib/mprintf.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/mprintf.c
+
+tftpd-mprintf.obj: $(top_srcdir)/lib/mprintf.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT tftpd-mprintf.obj -MD -MP -MF "$(DEPDIR)/tftpd-mprintf.Tpo" -c -o tftpd-mprintf.obj `if test -f '$(top_srcdir)/lib/mprintf.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/mprintf.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/mprintf.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/tftpd-mprintf.Tpo" "$(DEPDIR)/tftpd-mprintf.Po"; else rm -f "$(DEPDIR)/tftpd-mprintf.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/mprintf.c' object='tftpd-mprintf.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o tftpd-mprintf.obj `if test -f '$(top_srcdir)/lib/mprintf.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/mprintf.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/mprintf.c'; fi`
+
+tftpd-nonblock.o: $(top_srcdir)/lib/nonblock.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT tftpd-nonblock.o -MD -MP -MF "$(DEPDIR)/tftpd-nonblock.Tpo" -c -o tftpd-nonblock.o `test -f '$(top_srcdir)/lib/nonblock.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/nonblock.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/tftpd-nonblock.Tpo" "$(DEPDIR)/tftpd-nonblock.Po"; else rm -f "$(DEPDIR)/tftpd-nonblock.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/nonblock.c' object='tftpd-nonblock.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o tftpd-nonblock.o `test -f '$(top_srcdir)/lib/nonblock.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/nonblock.c
+
+tftpd-nonblock.obj: $(top_srcdir)/lib/nonblock.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT tftpd-nonblock.obj -MD -MP -MF "$(DEPDIR)/tftpd-nonblock.Tpo" -c -o tftpd-nonblock.obj `if test -f '$(top_srcdir)/lib/nonblock.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/nonblock.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/nonblock.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/tftpd-nonblock.Tpo" "$(DEPDIR)/tftpd-nonblock.Po"; else rm -f "$(DEPDIR)/tftpd-nonblock.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/nonblock.c' object='tftpd-nonblock.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o tftpd-nonblock.obj `if test -f '$(top_srcdir)/lib/nonblock.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/nonblock.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/nonblock.c'; fi`
+
+tftpd-strequal.o: $(top_srcdir)/lib/strequal.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT tftpd-strequal.o -MD -MP -MF "$(DEPDIR)/tftpd-strequal.Tpo" -c -o tftpd-strequal.o `test -f '$(top_srcdir)/lib/strequal.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/strequal.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/tftpd-strequal.Tpo" "$(DEPDIR)/tftpd-strequal.Po"; else rm -f "$(DEPDIR)/tftpd-strequal.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/strequal.c' object='tftpd-strequal.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o tftpd-strequal.o `test -f '$(top_srcdir)/lib/strequal.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/strequal.c
+
+tftpd-strequal.obj: $(top_srcdir)/lib/strequal.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT tftpd-strequal.obj -MD -MP -MF "$(DEPDIR)/tftpd-strequal.Tpo" -c -o tftpd-strequal.obj `if test -f '$(top_srcdir)/lib/strequal.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/strequal.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/strequal.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/tftpd-strequal.Tpo" "$(DEPDIR)/tftpd-strequal.Po"; else rm -f "$(DEPDIR)/tftpd-strequal.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/strequal.c' object='tftpd-strequal.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o tftpd-strequal.obj `if test -f '$(top_srcdir)/lib/strequal.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/strequal.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/strequal.c'; fi`
+
+tftpd-strtoofft.o: $(top_srcdir)/lib/strtoofft.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT tftpd-strtoofft.o -MD -MP -MF "$(DEPDIR)/tftpd-strtoofft.Tpo" -c -o tftpd-strtoofft.o `test -f '$(top_srcdir)/lib/strtoofft.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/strtoofft.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/tftpd-strtoofft.Tpo" "$(DEPDIR)/tftpd-strtoofft.Po"; else rm -f "$(DEPDIR)/tftpd-strtoofft.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/strtoofft.c' object='tftpd-strtoofft.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o tftpd-strtoofft.o `test -f '$(top_srcdir)/lib/strtoofft.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/strtoofft.c
+
+tftpd-strtoofft.obj: $(top_srcdir)/lib/strtoofft.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT tftpd-strtoofft.obj -MD -MP -MF "$(DEPDIR)/tftpd-strtoofft.Tpo" -c -o tftpd-strtoofft.obj `if test -f '$(top_srcdir)/lib/strtoofft.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/strtoofft.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/strtoofft.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/tftpd-strtoofft.Tpo" "$(DEPDIR)/tftpd-strtoofft.Po"; else rm -f "$(DEPDIR)/tftpd-strtoofft.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/strtoofft.c' object='tftpd-strtoofft.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o tftpd-strtoofft.obj `if test -f '$(top_srcdir)/lib/strtoofft.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/strtoofft.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/strtoofft.c'; fi`
+
+tftpd-timeval.o: $(top_srcdir)/lib/timeval.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT tftpd-timeval.o -MD -MP -MF "$(DEPDIR)/tftpd-timeval.Tpo" -c -o tftpd-timeval.o `test -f '$(top_srcdir)/lib/timeval.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/timeval.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/tftpd-timeval.Tpo" "$(DEPDIR)/tftpd-timeval.Po"; else rm -f "$(DEPDIR)/tftpd-timeval.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/timeval.c' object='tftpd-timeval.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o tftpd-timeval.o `test -f '$(top_srcdir)/lib/timeval.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/timeval.c
+
+tftpd-timeval.obj: $(top_srcdir)/lib/timeval.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT tftpd-timeval.obj -MD -MP -MF "$(DEPDIR)/tftpd-timeval.Tpo" -c -o tftpd-timeval.obj `if test -f '$(top_srcdir)/lib/timeval.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/timeval.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/timeval.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/tftpd-timeval.Tpo" "$(DEPDIR)/tftpd-timeval.Po"; else rm -f "$(DEPDIR)/tftpd-timeval.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/timeval.c' object='tftpd-timeval.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o tftpd-timeval.obj `if test -f '$(top_srcdir)/lib/timeval.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/timeval.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/timeval.c'; fi`
+
+tftpd-warnless.o: $(top_srcdir)/lib/warnless.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT tftpd-warnless.o -MD -MP -MF "$(DEPDIR)/tftpd-warnless.Tpo" -c -o tftpd-warnless.o `test -f '$(top_srcdir)/lib/warnless.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/warnless.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/tftpd-warnless.Tpo" "$(DEPDIR)/tftpd-warnless.Po"; else rm -f "$(DEPDIR)/tftpd-warnless.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/warnless.c' object='tftpd-warnless.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o tftpd-warnless.o `test -f '$(top_srcdir)/lib/warnless.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/warnless.c
+
+tftpd-warnless.obj: $(top_srcdir)/lib/warnless.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT tftpd-warnless.obj -MD -MP -MF "$(DEPDIR)/tftpd-warnless.Tpo" -c -o tftpd-warnless.obj `if test -f '$(top_srcdir)/lib/warnless.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/warnless.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/warnless.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/tftpd-warnless.Tpo" "$(DEPDIR)/tftpd-warnless.Po"; else rm -f "$(DEPDIR)/tftpd-warnless.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/warnless.c' object='tftpd-warnless.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o tftpd-warnless.obj `if test -f '$(top_srcdir)/lib/warnless.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/warnless.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/warnless.c'; fi`
+
+tftpd-getpart.o: getpart.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT tftpd-getpart.o -MD -MP -MF "$(DEPDIR)/tftpd-getpart.Tpo" -c -o tftpd-getpart.o `test -f 'getpart.c' || echo '$(srcdir)/'`getpart.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/tftpd-getpart.Tpo" "$(DEPDIR)/tftpd-getpart.Po"; else rm -f "$(DEPDIR)/tftpd-getpart.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='getpart.c' object='tftpd-getpart.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o tftpd-getpart.o `test -f 'getpart.c' || echo '$(srcdir)/'`getpart.c
+
+tftpd-getpart.obj: getpart.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT tftpd-getpart.obj -MD -MP -MF "$(DEPDIR)/tftpd-getpart.Tpo" -c -o tftpd-getpart.obj `if test -f 'getpart.c'; then $(CYGPATH_W) 'getpart.c'; else $(CYGPATH_W) '$(srcdir)/getpart.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/tftpd-getpart.Tpo" "$(DEPDIR)/tftpd-getpart.Po"; else rm -f "$(DEPDIR)/tftpd-getpart.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='getpart.c' object='tftpd-getpart.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o tftpd-getpart.obj `if test -f 'getpart.c'; then $(CYGPATH_W) 'getpart.c'; else $(CYGPATH_W) '$(srcdir)/getpart.c'; fi`
+
+tftpd-base64.o: $(top_srcdir)/lib/base64.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT tftpd-base64.o -MD -MP -MF "$(DEPDIR)/tftpd-base64.Tpo" -c -o tftpd-base64.o `test -f '$(top_srcdir)/lib/base64.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/base64.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/tftpd-base64.Tpo" "$(DEPDIR)/tftpd-base64.Po"; else rm -f "$(DEPDIR)/tftpd-base64.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/base64.c' object='tftpd-base64.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o tftpd-base64.o `test -f '$(top_srcdir)/lib/base64.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/base64.c
+
+tftpd-base64.obj: $(top_srcdir)/lib/base64.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT tftpd-base64.obj -MD -MP -MF "$(DEPDIR)/tftpd-base64.Tpo" -c -o tftpd-base64.obj `if test -f '$(top_srcdir)/lib/base64.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/base64.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/base64.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/tftpd-base64.Tpo" "$(DEPDIR)/tftpd-base64.Po"; else rm -f "$(DEPDIR)/tftpd-base64.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/base64.c' object='tftpd-base64.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o tftpd-base64.obj `if test -f '$(top_srcdir)/lib/base64.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/base64.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/base64.c'; fi`
+
+tftpd-memdebug.o: $(top_srcdir)/lib/memdebug.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT tftpd-memdebug.o -MD -MP -MF "$(DEPDIR)/tftpd-memdebug.Tpo" -c -o tftpd-memdebug.o `test -f '$(top_srcdir)/lib/memdebug.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/memdebug.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/tftpd-memdebug.Tpo" "$(DEPDIR)/tftpd-memdebug.Po"; else rm -f "$(DEPDIR)/tftpd-memdebug.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/memdebug.c' object='tftpd-memdebug.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o tftpd-memdebug.o `test -f '$(top_srcdir)/lib/memdebug.c' || echo '$(srcdir)/'`$(top_srcdir)/lib/memdebug.c
+
+tftpd-memdebug.obj: $(top_srcdir)/lib/memdebug.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT tftpd-memdebug.obj -MD -MP -MF "$(DEPDIR)/tftpd-memdebug.Tpo" -c -o tftpd-memdebug.obj `if test -f '$(top_srcdir)/lib/memdebug.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/memdebug.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/memdebug.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/tftpd-memdebug.Tpo" "$(DEPDIR)/tftpd-memdebug.Po"; else rm -f "$(DEPDIR)/tftpd-memdebug.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/lib/memdebug.c' object='tftpd-memdebug.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o tftpd-memdebug.obj `if test -f '$(top_srcdir)/lib/memdebug.c'; then $(CYGPATH_W) '$(top_srcdir)/lib/memdebug.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/lib/memdebug.c'; fi`
+
+tftpd-util.o: util.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT tftpd-util.o -MD -MP -MF "$(DEPDIR)/tftpd-util.Tpo" -c -o tftpd-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/tftpd-util.Tpo" "$(DEPDIR)/tftpd-util.Po"; else rm -f "$(DEPDIR)/tftpd-util.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util.c' object='tftpd-util.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o tftpd-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c
+
+tftpd-util.obj: util.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT tftpd-util.obj -MD -MP -MF "$(DEPDIR)/tftpd-util.Tpo" -c -o tftpd-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/tftpd-util.Tpo" "$(DEPDIR)/tftpd-util.Po"; else rm -f "$(DEPDIR)/tftpd-util.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util.c' object='tftpd-util.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o tftpd-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi`
+
+tftpd-tftpd.o: tftpd.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT tftpd-tftpd.o -MD -MP -MF "$(DEPDIR)/tftpd-tftpd.Tpo" -c -o tftpd-tftpd.o `test -f 'tftpd.c' || echo '$(srcdir)/'`tftpd.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/tftpd-tftpd.Tpo" "$(DEPDIR)/tftpd-tftpd.Po"; else rm -f "$(DEPDIR)/tftpd-tftpd.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tftpd.c' object='tftpd-tftpd.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o tftpd-tftpd.o `test -f 'tftpd.c' || echo '$(srcdir)/'`tftpd.c
+
+tftpd-tftpd.obj: tftpd.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT tftpd-tftpd.obj -MD -MP -MF "$(DEPDIR)/tftpd-tftpd.Tpo" -c -o tftpd-tftpd.obj `if test -f 'tftpd.c'; then $(CYGPATH_W) 'tftpd.c'; else $(CYGPATH_W) '$(srcdir)/tftpd.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/tftpd-tftpd.Tpo" "$(DEPDIR)/tftpd-tftpd.Po"; else rm -f "$(DEPDIR)/tftpd-tftpd.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tftpd.c' object='tftpd-tftpd.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o tftpd-tftpd.obj `if test -f 'tftpd.c'; then $(CYGPATH_W) 'tftpd.c'; else $(CYGPATH_W) '$(srcdir)/tftpd.c'; fi`
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstPROGRAMS ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags uninstall uninstall-am \
+ uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/tests/server/Makefile.inc b/tests/server/Makefile.inc
new file mode 100644
index 000000000..be3f06808
--- /dev/null
+++ b/tests/server/Makefile.inc
@@ -0,0 +1,65 @@
+noinst_PROGRAMS = getpart resolve rtspd sockfilt sws tftpd
+
+CURLX_SRCS = \
+ $(top_srcdir)/lib/mprintf.c \
+ $(top_srcdir)/lib/nonblock.c \
+ $(top_srcdir)/lib/strequal.c \
+ $(top_srcdir)/lib/strtoofft.c \
+ $(top_srcdir)/lib/timeval.c \
+ $(top_srcdir)/lib/warnless.c
+
+CURLX_HDRS = \
+ $(top_srcdir)/lib/curlx.h \
+ $(top_srcdir)/lib/nonblock.h \
+ $(top_srcdir)/lib/strequal.h \
+ $(top_srcdir)/lib/strtoofft.h \
+ $(top_srcdir)/lib/timeval.h \
+ $(top_srcdir)/lib/warnless.h
+
+USEFUL = \
+ getpart.c \
+ getpart.h \
+ $(top_srcdir)/lib/base64.c \
+ $(top_srcdir)/lib/curl_base64.h \
+ $(top_srcdir)/lib/memdebug.c \
+ $(top_srcdir)/lib/memdebug.h
+
+UTIL = \
+ util.c \
+ util.h
+
+getpart_SOURCES = $(CURLX_SRCS) $(CURLX_HDRS) $(USEFUL) \
+ testpart.c
+getpart_LDADD = @TEST_SERVER_LIBS@
+getpart_CFLAGS = $(AM_CFLAGS)
+
+resolve_SOURCES = $(CURLX_SRCS) $(CURLX_HDRS) $(USEFUL) $(UTIL) \
+ resolve.c
+resolve_LDADD = @TEST_SERVER_LIBS@
+resolve_CFLAGS = $(AM_CFLAGS)
+
+rtspd_SOURCES = $(CURLX_SRCS) $(CURLX_HDRS) $(USEFUL) $(UTIL) \
+ server_sockaddr.h \
+ rtspd.c
+rtspd_LDADD = @TEST_SERVER_LIBS@
+rtspd_CFLAGS = $(AM_CFLAGS)
+
+sockfilt_SOURCES = $(CURLX_SRCS) $(CURLX_HDRS) $(USEFUL) $(UTIL) \
+ server_sockaddr.h \
+ sockfilt.c \
+ $(top_srcdir)/lib/inet_pton.c
+sockfilt_LDADD = @TEST_SERVER_LIBS@
+sockfilt_CFLAGS = $(AM_CFLAGS)
+
+sws_SOURCES = $(CURLX_SRCS) $(CURLX_HDRS) $(USEFUL) $(UTIL) \
+ server_sockaddr.h \
+ sws.c
+sws_LDADD = @TEST_SERVER_LIBS@
+sws_CFLAGS = $(AM_CFLAGS)
+
+tftpd_SOURCES = $(CURLX_SRCS) $(CURLX_HDRS) $(USEFUL) $(UTIL) \
+ server_sockaddr.h \
+ tftpd.c \
+ tftp.h
+tftpd_LDADD = @TEST_SERVER_LIBS@
+tftpd_CFLAGS = $(AM_CFLAGS)
diff --git a/tests/server/getpart.c b/tests/server/getpart.c
new file mode 100644
index 000000000..a3b5f2fb1
--- /dev/null
+++ b/tests/server/getpart.c
@@ -0,0 +1,422 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+
+#define CURL_NO_OLDIES
+
+#include "setup.h"
+
+#include "getpart.h"
+
+#define ENABLE_CURLX_PRINTF
+/* make the curlx header define all printf() functions to use the curlx_*
+ versions instead */
+#include "curlx.h" /* from the private lib dir */
+
+/* just to please base64.h we create a fake struct */
+struct SessionHandle {
+ int fake;
+};
+
+#include "curl_base64.h"
+#include "curl_memory.h"
+
+/* include memdebug.h last */
+#include "memdebug.h"
+
+#define EAT_SPACE(p) while(*(p) && ISSPACE(*(p))) (p)++
+
+#define EAT_WORD(p) while(*(p) && !ISSPACE(*(p)) && ('>' != *(p))) (p)++
+
+#ifdef DEBUG_GETPART
+#define show(x) printf x
+#else
+#define show(x)
+#endif
+
+#if defined(_MSC_VER) && defined(_DLL)
+# pragma warning(disable:4232) /* MSVC extension, dllimport identity */
+#endif
+
+curl_malloc_callback Curl_cmalloc = (curl_malloc_callback)malloc;
+curl_free_callback Curl_cfree = (curl_free_callback)free;
+curl_realloc_callback Curl_crealloc = (curl_realloc_callback)realloc;
+curl_strdup_callback Curl_cstrdup = (curl_strdup_callback)strdup;
+curl_calloc_callback Curl_ccalloc = (curl_calloc_callback)calloc;
+
+#if defined(_MSC_VER) && defined(_DLL)
+# pragma warning(default:4232) /* MSVC extension, dllimport identity */
+#endif
+
+/*
+ * readline()
+ *
+ * Reads a complete line from a file into a dynamically allocated buffer.
+ *
+ * Calling function may call this multiple times with same 'buffer'
+ * and 'bufsize' pointers to avoid multiple buffer allocations. Buffer
+ * will be reallocated and 'bufsize' increased until whole line fits in
+ * buffer before returning it.
+ *
+ * Calling function is responsible to free allocated buffer.
+ *
+ * This function may return:
+ * GPE_OUT_OF_MEMORY
+ * GPE_END_OF_FILE
+ * GPE_OK
+ */
+
+static int readline(char **buffer, size_t *bufsize, FILE *stream)
+{
+ size_t offset = 0;
+ size_t length;
+ char *newptr;
+
+ if(!*buffer) {
+ *buffer = malloc(128);
+ if(!*buffer)
+ return GPE_OUT_OF_MEMORY;
+ *bufsize = 128;
+ }
+
+ for(;;) {
+ int bytestoread = curlx_uztosi(*bufsize - offset);
+
+ if(!fgets(*buffer + offset, bytestoread, stream))
+ return (offset != 0) ? GPE_OK : GPE_END_OF_FILE ;
+
+ length = offset + strlen(*buffer + offset);
+ if(*(*buffer + length - 1) == '\n')
+ break;
+ offset = length;
+ if(length < *bufsize - 1)
+ continue;
+
+ newptr = realloc(*buffer, *bufsize * 2);
+ if(!newptr)
+ return GPE_OUT_OF_MEMORY;
+ *buffer = newptr;
+ *bufsize *= 2;
+ }
+
+ return GPE_OK;
+}
+
+/*
+ * appenddata()
+ *
+ * This appends data from a given source buffer to the end of the used part of
+ * a destination buffer. Arguments relative to the destination buffer are, the
+ * address of a pointer to the destination buffer 'dst_buf', the length of data
+ * in destination buffer excluding potential null string termination 'dst_len',
+ * the allocated size of destination buffer 'dst_alloc'. All three destination
+ * buffer arguments may be modified by this function. Arguments relative to the
+ * source buffer are, a pointer to the source buffer 'src_buf' and indication
+ * whether the source buffer is base64 encoded or not 'src_b64'.
+ *
+ * If the source buffer is indicated to be base64 encoded, this appends the
+ * decoded data, binary or whatever, to the destination. The source buffer
+ * may not hold binary data, only a null terminated string is valid content.
+ *
+ * Destination buffer will be enlarged and relocated as needed.
+ *
+ * Calling function is responsible to provide preallocated destination
+ * buffer and also to deallocate it when no longer needed.
+ *
+ * This function may return:
+ * GPE_OUT_OF_MEMORY
+ * GPE_OK
+ */
+
+static int appenddata(char **dst_buf, /* dest buffer */
+ size_t *dst_len, /* dest buffer data length */
+ size_t *dst_alloc, /* dest buffer allocated size */
+ char *src_buf, /* source buffer */
+ int src_b64) /* != 0 if source is base64 encoded */
+{
+ size_t need_alloc, src_len;
+ union {
+ unsigned char *as_uchar;
+ char *as_char;
+ } buf64;
+
+ src_len = strlen(src_buf);
+ if(!src_len)
+ return GPE_OK;
+
+ buf64.as_char = NULL;
+
+ if(src_b64) {
+ /* base64 decode the given buffer */
+ src_len = Curl_base64_decode(src_buf, &buf64.as_uchar);
+ src_buf = buf64.as_char;
+ if(!src_len || !src_buf) {
+ /*
+ ** currently there is no way to tell apart an OOM condition in
+ ** Curl_base64_decode() from zero length decoded data. For now,
+ ** let's just assume it is an OOM condition, currently we have
+ ** no input for this function that decodes to zero length data.
+ */
+ if(buf64.as_char)
+ free(buf64.as_char);
+ return GPE_OUT_OF_MEMORY;
+ }
+ }
+
+ need_alloc = src_len + *dst_len + 1;
+
+ /* enlarge destination buffer if required */
+ if(need_alloc > *dst_alloc) {
+ size_t newsize = need_alloc * 2;
+ char *newptr = realloc(*dst_buf, newsize);
+ if(!newptr) {
+ if(buf64.as_char)
+ free(buf64.as_char);
+ return GPE_OUT_OF_MEMORY;
+ }
+ *dst_alloc = newsize;
+ *dst_buf = newptr;
+ }
+
+ /* memcpy to support binary blobs */
+ memcpy(*dst_buf + *dst_len, src_buf, src_len);
+ *dst_len += src_len;
+ *(*dst_buf + *dst_len) = '\0';
+
+ if(buf64.as_char)
+ free(buf64.as_char);
+
+ return GPE_OK;
+}
+
+/*
+ * getpart()
+ *
+ * This returns whole contents of specified XML-like section and subsection
+ * from the given file. This is mostly used to retrieve a specific part from
+ * a test definition file for consumption by test suite servers.
+ *
+ * Data is returned in a dynamically allocated buffer, a pointer to this data
+ * and the size of the data is stored at the addresses that caller specifies.
+ *
+ * If the returned data is a string the returned size will be the length of
+ * the string excluding null termination. Otherwise it will just be the size
+ * of the returned binary data.
+ *
+ * Calling function is responsible to free returned buffer.
+ *
+ * This function may return:
+ * GPE_NO_BUFFER_SPACE
+ * GPE_OUT_OF_MEMORY
+ * GPE_OK
+ */
+
+int getpart(char **outbuf, size_t *outlen,
+ const char *main, const char *sub, FILE *stream)
+{
+# define MAX_TAG_LEN 79
+ char couter[MAX_TAG_LEN+1]; /* current outermost section */
+ char cmain[MAX_TAG_LEN+1]; /* current main section */
+ char csub[MAX_TAG_LEN+1]; /* current sub section */
+ char ptag[MAX_TAG_LEN+1]; /* potential tag */
+ char patt[MAX_TAG_LEN+1]; /* potential attributes */
+ char *buffer = NULL;
+ char *ptr;
+ char *end;
+ union {
+ ssize_t sig;
+ size_t uns;
+ } len;
+ size_t bufsize = 0;
+ size_t outalloc = 256;
+ int in_wanted_part = 0;
+ int base64 = 0;
+ int error;
+
+ enum {
+ STATE_OUTSIDE = 0,
+ STATE_OUTER = 1,
+ STATE_INMAIN = 2,
+ STATE_INSUB = 3,
+ STATE_ILLEGAL = 4
+ } state = STATE_OUTSIDE;
+
+ *outlen = 0;
+ *outbuf = malloc(outalloc);
+ if(!*outbuf)
+ return GPE_OUT_OF_MEMORY;
+ *(*outbuf) = '\0';
+
+ couter[0] = cmain[0] = csub[0] = ptag[0] = patt[0] = '\0';
+
+ while((error = readline(&buffer, &bufsize, stream)) == GPE_OK) {
+
+ ptr = buffer;
+ EAT_SPACE(ptr);
+
+ if('<' != *ptr) {
+ if(in_wanted_part) {
+ show(("=> %s", buffer));
+ error = appenddata(outbuf, outlen, &outalloc, buffer, base64);
+ if(error)
+ break;
+ }
+ continue;
+ }
+
+ ptr++;
+
+ if('/' == *ptr) {
+ /*
+ ** closing section tag
+ */
+
+ ptr++;
+ end = ptr;
+ EAT_WORD(end);
+ if((len.sig = end - ptr) > MAX_TAG_LEN) {
+ error = GPE_NO_BUFFER_SPACE;
+ break;
+ }
+ memcpy(ptag, ptr, len.uns);
+ ptag[len.uns] = '\0';
+
+ if((STATE_INSUB == state) && !strcmp(csub, ptag)) {
+ /* end of current sub section */
+ state = STATE_INMAIN;
+ csub[0] = '\0';
+ if(in_wanted_part) {
+ /* end of wanted part */
+ in_wanted_part = 0;
+ break;
+ }
+ }
+ else if((STATE_INMAIN == state) && !strcmp(cmain, ptag)) {
+ /* end of current main section */
+ state = STATE_OUTER;
+ cmain[0] = '\0';
+ if(in_wanted_part) {
+ /* end of wanted part */
+ in_wanted_part = 0;
+ break;
+ }
+ }
+ else if((STATE_OUTER == state) && !strcmp(couter, ptag)) {
+ /* end of outermost file section */
+ state = STATE_OUTSIDE;
+ couter[0] = '\0';
+ if(in_wanted_part) {
+ /* end of wanted part */
+ in_wanted_part = 0;
+ break;
+ }
+ }
+
+ }
+ else if(!in_wanted_part) {
+ /*
+ ** opening section tag
+ */
+
+ /* get potential tag */
+ end = ptr;
+ EAT_WORD(end);
+ if((len.sig = end - ptr) > MAX_TAG_LEN) {
+ error = GPE_NO_BUFFER_SPACE;
+ break;
+ }
+ memcpy(ptag, ptr, len.uns);
+ ptag[len.uns] = '\0';
+
+ /* ignore comments, doctypes and xml declarations */
+ if(('!' == ptag[0]) || ('?' == ptag[0])) {
+ show(("* ignoring (%s)", buffer));
+ continue;
+ }
+
+ /* get all potential attributes */
+ ptr = end;
+ EAT_SPACE(ptr);
+ end = ptr;
+ while(*end && ('>' != *end))
+ end++;
+ if((len.sig = end - ptr) > MAX_TAG_LEN) {
+ error = GPE_NO_BUFFER_SPACE;
+ break;
+ }
+ memcpy(patt, ptr, len.uns);
+ patt[len.uns] = '\0';
+
+ if(STATE_OUTSIDE == state) {
+ /* outermost element (<testcase>) */
+ strcpy(couter, ptag);
+ state = STATE_OUTER;
+ continue;
+ }
+ else if(STATE_OUTER == state) {
+ /* start of a main section */
+ strcpy(cmain, ptag);
+ state = STATE_INMAIN;
+ continue;
+ }
+ else if(STATE_INMAIN == state) {
+ /* start of a sub section */
+ strcpy(csub, ptag);
+ state = STATE_INSUB;
+ if(!strcmp(cmain, main) && !strcmp(csub, sub)) {
+ /* start of wanted part */
+ in_wanted_part = 1;
+ if(strstr(patt, "base64="))
+ /* bit rough test, but "mostly" functional, */
+ /* treat wanted part data as base64 encoded */
+ base64 = 1;
+ }
+ continue;
+ }
+
+ }
+
+ if(in_wanted_part) {
+ show(("=> %s", buffer));
+ error = appenddata(outbuf, outlen, &outalloc, buffer, base64);
+ if(error)
+ break;
+ }
+
+ } /* while */
+
+ if(buffer)
+ free(buffer);
+
+ if(error != GPE_OK) {
+ if(error == GPE_END_OF_FILE)
+ error = GPE_OK;
+ else {
+ if(*outbuf)
+ free(*outbuf);
+ *outbuf = NULL;
+ *outlen = 0;
+ }
+ }
+
+ return error;
+}
+
diff --git a/tests/server/getpart.h b/tests/server/getpart.h
new file mode 100644
index 000000000..78a0be2cd
--- /dev/null
+++ b/tests/server/getpart.h
@@ -0,0 +1,33 @@
+#ifndef HEADER_SERVER_GETPART_H
+#define HEADER_SERVER_GETPART_H
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+
+#define GPE_NO_BUFFER_SPACE -2
+#define GPE_OUT_OF_MEMORY -1
+#define GPE_OK 0
+#define GPE_END_OF_FILE 1
+
+int getpart(char **outbuf, size_t *outlen,
+ const char *main, const char *sub, FILE *stream);
+
+#endif /* HEADER_SERVER_GETPART_H */
diff --git a/tests/server/resolve.c b/tests/server/resolve.c
new file mode 100644
index 000000000..26ad85300
--- /dev/null
+++ b/tests/server/resolve.c
@@ -0,0 +1,164 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+
+/* Purpose
+ *
+ * Resolve the given name, using system name resolve functions (NOT any
+ * function provided by libcurl). Used to see if the name exists and thus if
+ * we can allow a test case to use it for testing.
+ *
+ * Like if 'localhost' actual exists etc.
+ *
+ */
+
+#define CURL_NO_OLDIES
+
+#include "setup.h" /* portability help from the lib directory */
+
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef _XOPEN_SOURCE_EXTENDED
+/* This define is "almost" required to build on HPUX 11 */
+#include <arpa/inet.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+
+#define ENABLE_CURLX_PRINTF
+/* make the curlx header define all printf() functions to use the curlx_*
+ versions instead */
+#include "curlx.h" /* from the private lib dir */
+#include "util.h"
+
+/* include memdebug.h last */
+#include "memdebug.h"
+
+static bool use_ipv6 = FALSE;
+static const char *ipv_inuse = "IPv4";
+
+const char *serverlogfile=""; /* for a util.c function we don't use */
+
+int main(int argc, char *argv[])
+{
+ int arg=1;
+ const char *host = NULL;
+ int rc = 0;
+
+ while(argc>arg) {
+ if(!strcmp("--version", argv[arg])) {
+ printf("resolve IPv4%s\n",
+#ifdef ENABLE_IPV6
+ "/IPv6"
+#else
+ ""
+#endif
+ );
+ return 0;
+ }
+ else if(!strcmp("--ipv6", argv[arg])) {
+ ipv_inuse = "IPv6";
+ use_ipv6 = TRUE;
+ arg++;
+ }
+ else if(!strcmp("--ipv4", argv[arg])) {
+ /* for completeness, we support this option as well */
+ ipv_inuse = "IPv4";
+ use_ipv6 = FALSE;
+ arg++;
+ }
+ else {
+ host = argv[arg++];
+ }
+ }
+ if(!host) {
+ puts("Usage: resolve [option] <host>\n"
+ " --version\n"
+ " --ipv4"
+#ifdef ENABLE_IPV6
+ "\n --ipv6"
+#endif
+ );
+ return 1;
+ }
+
+#ifdef WIN32
+ win32_init();
+ atexit(win32_cleanup);
+#endif
+
+ if(!use_ipv6) {
+ /* gethostbyname() resolve */
+ struct hostent *he;
+
+ he = gethostbyname(host);
+
+ rc = !he;
+ }
+ else {
+#ifdef ENABLE_IPV6
+ /* Check that the system has IPv6 enabled before checking the resolver */
+ curl_socket_t s = socket(PF_INET6, SOCK_DGRAM, 0);
+ if(s == CURL_SOCKET_BAD)
+ /* an ipv6 address was requested and we can't get/use one */
+ rc = -1;
+ else {
+ sclose(s);
+ }
+
+ if (rc == 0) {
+ /* getaddrinfo() resolve */
+ struct addrinfo *ai;
+ struct addrinfo hints;
+
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = PF_INET6;
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_flags = AI_CANONNAME;
+ /* Use parenthesis around function to stop it from being replaced by
+ the macro in memdebug.h */
+ rc = (getaddrinfo)(host, "80", &hints, &ai);
+ }
+
+#else
+ puts("IPv6 support has been disabled in this program");
+ return 1;
+#endif
+ }
+ if(rc)
+ printf("Resolving %s '%s' didn't work\n", ipv_inuse, host);
+
+ return !!rc;
+}
diff --git a/tests/server/rtspd.c b/tests/server/rtspd.c
new file mode 100644
index 000000000..5c06729ea
--- /dev/null
+++ b/tests/server/rtspd.c
@@ -0,0 +1,1469 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+
+/*
+ * curl's test suite Real Time Streaming Protocol (RTSP) server.
+ *
+ * This source file was started based on curl's HTTP test suite server.
+ */
+
+#define CURL_NO_OLDIES
+
+#include "setup.h" /* portability help from the lib directory */
+
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_NETINET_TCP_H
+#include <netinet/tcp.h> /* for TCP_NODELAY */
+#endif
+
+#define ENABLE_CURLX_PRINTF
+/* make the curlx header define all printf() functions to use the curlx_*
+ versions instead */
+#include "curlx.h" /* from the private lib dir */
+#include "getpart.h"
+#include "util.h"
+#include "server_sockaddr.h"
+
+/* include memdebug.h last */
+#include "memdebug.h"
+
+#ifdef ENABLE_IPV6
+static bool use_ipv6 = FALSE;
+#endif
+static const char *ipv_inuse = "IPv4";
+static int serverlogslocked = 0;
+
+#define REQBUFSIZ 150000
+#define REQBUFSIZ_TXT "149999"
+
+static long prevtestno=-1; /* previous test number we served */
+static long prevpartno=-1; /* previous part number we served */
+static bool prevbounce=FALSE; /* instructs the server to increase the part
+ number for a test in case the identical
+ testno+partno request shows up again */
+
+#define RCMD_NORMALREQ 0 /* default request, use the tests file normally */
+#define RCMD_IDLE 1 /* told to sit idle */
+#define RCMD_STREAM 2 /* told to stream */
+
+typedef enum {
+ RPROT_NONE = 0,
+ RPROT_RTSP = 1,
+ RPROT_HTTP = 2
+} reqprot_t;
+
+#define SET_RTP_PKT_CHN(p,c) ((p)[1] = (unsigned char)((c) & 0xFF))
+
+#define SET_RTP_PKT_LEN(p,l) (((p)[2] = (unsigned char)(((l) >> 8) & 0xFF)), \
+ ((p)[3] = (unsigned char)((l) & 0xFF)))
+
+struct httprequest {
+ char reqbuf[REQBUFSIZ]; /* buffer area for the incoming request */
+ size_t checkindex; /* where to start checking of the request */
+ size_t offset; /* size of the incoming request */
+ long testno; /* test number found in the request */
+ long partno; /* part number found in the request */
+ bool open; /* keep connection open info, as found in the request */
+ bool auth_req; /* authentication required, don't wait for body unless
+ there's an Authorization header */
+ bool auth; /* Authorization header present in the incoming request */
+ size_t cl; /* Content-Length of the incoming request */
+ bool digest; /* Authorization digest header found */
+ bool ntlm; /* Authorization ntlm header found */
+ int pipe; /* if non-zero, expect this many requests to do a "piped"
+ request/response */
+ int skip; /* if non-zero, the server is instructed to not read this
+ many bytes from a PUT/POST request. Ie the client sends N
+ bytes said in Content-Length, but the server only reads N
+ - skip bytes. */
+ int rcmd; /* doing a special command, see defines above */
+ reqprot_t protocol; /* request protocol, HTTP or RTSP */
+ int prot_version; /* HTTP or RTSP version (major*10 + minor) */
+ bool pipelining; /* true if request is pipelined */
+ char *rtp_buffer;
+ size_t rtp_buffersize;
+};
+
+static int ProcessRequest(struct httprequest *req);
+static void storerequest(char *reqbuf, size_t totalsize);
+
+#define DEFAULT_PORT 8999
+
+#ifndef DEFAULT_LOGFILE
+#define DEFAULT_LOGFILE "log/rtspd.log"
+#endif
+
+const char *serverlogfile = DEFAULT_LOGFILE;
+
+#define RTSPDVERSION "cURL test suite RTSP server/0.1"
+
+#define REQUEST_DUMP "log/server.input"
+#define RESPONSE_DUMP "log/server.response"
+
+/* very-big-path support */
+#define MAXDOCNAMELEN 140000
+#define MAXDOCNAMELEN_TXT "139999"
+
+#define REQUEST_KEYWORD_SIZE 256
+#define REQUEST_KEYWORD_SIZE_TXT "255"
+
+#define CMD_AUTH_REQUIRED "auth_required"
+
+/* 'idle' means that it will accept the request fine but never respond
+ any data. Just keep the connection alive. */
+#define CMD_IDLE "idle"
+
+/* 'stream' means to send a never-ending stream of data */
+#define CMD_STREAM "stream"
+
+#define END_OF_HEADERS "\r\n\r\n"
+
+enum {
+ DOCNUMBER_NOTHING = -7,
+ DOCNUMBER_QUIT = -6,
+ DOCNUMBER_BADCONNECT = -5,
+ DOCNUMBER_INTERNAL= -4,
+ DOCNUMBER_CONNECT = -3,
+ DOCNUMBER_WERULEZ = -2,
+ DOCNUMBER_404 = -1
+};
+
+
+/* sent as reply to a QUIT */
+static const char *docquit =
+"HTTP/1.1 200 Goodbye" END_OF_HEADERS;
+
+/* sent as reply to a CONNECT */
+static const char *docconnect =
+"HTTP/1.1 200 Mighty fine indeed" END_OF_HEADERS;
+
+/* sent as reply to a "bad" CONNECT */
+static const char *docbadconnect =
+"HTTP/1.1 501 Forbidden you fool" END_OF_HEADERS;
+
+/* send back this on HTTP 404 file not found */
+static const char *doc404_HTTP = "HTTP/1.1 404 Not Found\r\n"
+ "Server: " RTSPDVERSION "\r\n"
+ "Connection: close\r\n"
+ "Content-Type: text/html"
+ END_OF_HEADERS
+ "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n"
+ "<HTML><HEAD>\n"
+ "<TITLE>404 Not Found</TITLE>\n"
+ "</HEAD><BODY>\n"
+ "<H1>Not Found</H1>\n"
+ "The requested URL was not found on this server.\n"
+ "<P><HR><ADDRESS>" RTSPDVERSION "</ADDRESS>\n" "</BODY></HTML>\n";
+
+/* send back this on RTSP 404 file not found */
+static const char *doc404_RTSP = "RTSP/1.0 404 Not Found\r\n"
+ "Server: " RTSPDVERSION
+ END_OF_HEADERS;
+
+/* Default size to send away fake RTP data */
+#define RTP_DATA_SIZE 12
+static const char *RTP_DATA = "$_1234\n\0asdf";
+
+/* do-nothing macro replacement for systems which lack siginterrupt() */
+
+#ifndef HAVE_SIGINTERRUPT
+#define siginterrupt(x,y) do {} while(0)
+#endif
+
+/* vars used to keep around previous signal handlers */
+
+typedef RETSIGTYPE (*SIGHANDLER_T)(int);
+
+#ifdef SIGHUP
+static SIGHANDLER_T old_sighup_handler = SIG_ERR;
+#endif
+
+#ifdef SIGPIPE
+static SIGHANDLER_T old_sigpipe_handler = SIG_ERR;
+#endif
+
+#ifdef SIGALRM
+static SIGHANDLER_T old_sigalrm_handler = SIG_ERR;
+#endif
+
+#ifdef SIGINT
+static SIGHANDLER_T old_sigint_handler = SIG_ERR;
+#endif
+
+#ifdef SIGTERM
+static SIGHANDLER_T old_sigterm_handler = SIG_ERR;
+#endif
+
+/* var which if set indicates that the program should finish execution */
+
+SIG_ATOMIC_T got_exit_signal = 0;
+
+/* if next is set indicates the first signal handled in exit_signal_handler */
+
+static volatile int exit_signal = 0;
+
+/* signal handler that will be triggered to indicate that the program
+ should finish its execution in a controlled manner as soon as possible.
+ The first time this is called it will set got_exit_signal to one and
+ store in exit_signal the signal that triggered its execution. */
+
+static RETSIGTYPE exit_signal_handler(int signum)
+{
+ int old_errno = ERRNO;
+ if(got_exit_signal == 0) {
+ got_exit_signal = 1;
+ exit_signal = signum;
+ }
+ (void)signal(signum, exit_signal_handler);
+ SET_ERRNO(old_errno);
+}
+
+static void install_signal_handlers(void)
+{
+#ifdef SIGHUP
+ /* ignore SIGHUP signal */
+ if((old_sighup_handler = signal(SIGHUP, SIG_IGN)) == SIG_ERR)
+ logmsg("cannot install SIGHUP handler: %s", strerror(ERRNO));
+#endif
+#ifdef SIGPIPE
+ /* ignore SIGPIPE signal */
+ if((old_sigpipe_handler = signal(SIGPIPE, SIG_IGN)) == SIG_ERR)
+ logmsg("cannot install SIGPIPE handler: %s", strerror(ERRNO));
+#endif
+#ifdef SIGALRM
+ /* ignore SIGALRM signal */
+ if((old_sigalrm_handler = signal(SIGALRM, SIG_IGN)) == SIG_ERR)
+ logmsg("cannot install SIGALRM handler: %s", strerror(ERRNO));
+#endif
+#ifdef SIGINT
+ /* handle SIGINT signal with our exit_signal_handler */
+ if((old_sigint_handler = signal(SIGINT, exit_signal_handler)) == SIG_ERR)
+ logmsg("cannot install SIGINT handler: %s", strerror(ERRNO));
+ else
+ siginterrupt(SIGINT, 1);
+#endif
+#ifdef SIGTERM
+ /* handle SIGTERM signal with our exit_signal_handler */
+ if((old_sigterm_handler = signal(SIGTERM, exit_signal_handler)) == SIG_ERR)
+ logmsg("cannot install SIGTERM handler: %s", strerror(ERRNO));
+ else
+ siginterrupt(SIGTERM, 1);
+#endif
+}
+
+static void restore_signal_handlers(void)
+{
+#ifdef SIGHUP
+ if(SIG_ERR != old_sighup_handler)
+ (void)signal(SIGHUP, old_sighup_handler);
+#endif
+#ifdef SIGPIPE
+ if(SIG_ERR != old_sigpipe_handler)
+ (void)signal(SIGPIPE, old_sigpipe_handler);
+#endif
+#ifdef SIGALRM
+ if(SIG_ERR != old_sigalrm_handler)
+ (void)signal(SIGALRM, old_sigalrm_handler);
+#endif
+#ifdef SIGINT
+ if(SIG_ERR != old_sigint_handler)
+ (void)signal(SIGINT, old_sigint_handler);
+#endif
+#ifdef SIGTERM
+ if(SIG_ERR != old_sigterm_handler)
+ (void)signal(SIGTERM, old_sigterm_handler);
+#endif
+}
+
+static int ProcessRequest(struct httprequest *req)
+{
+ char *line=&req->reqbuf[req->checkindex];
+ bool chunked = FALSE;
+ static char request[REQUEST_KEYWORD_SIZE];
+ static char doc[MAXDOCNAMELEN];
+ static char prot_str[5];
+ char logbuf[256];
+ int prot_major, prot_minor;
+ char *end;
+ int error;
+ end = strstr(line, END_OF_HEADERS);
+
+ logmsg("ProcessRequest() called with testno %ld and line [%s]",
+ req->testno, line);
+
+ /* try to figure out the request characteristics as soon as possible, but
+ only once! */
+ if((req->testno == DOCNUMBER_NOTHING) &&
+ sscanf(line,
+ "%" REQUEST_KEYWORD_SIZE_TXT"s %" MAXDOCNAMELEN_TXT "s %4s/%d.%d",
+ request,
+ doc,
+ prot_str,
+ &prot_major,
+ &prot_minor) == 5) {
+ char *ptr;
+
+ if(!strcmp(prot_str, "HTTP")) {
+ req->protocol = RPROT_HTTP;
+ }
+ else if(!strcmp(prot_str, "RTSP")) {
+ req->protocol = RPROT_RTSP;
+ }
+ else {
+ req->protocol = RPROT_NONE;
+ logmsg("got unknown protocol %s", prot_str);
+ return 1;
+ }
+
+ req->prot_version = prot_major*10 + prot_minor;
+
+ /* find the last slash */
+ ptr = strrchr(doc, '/');
+
+ /* get the number after it */
+ if(ptr) {
+ FILE *stream;
+ char *filename;
+
+ if((strlen(doc) + strlen(request)) < 200)
+ sprintf(logbuf, "Got request: %s %s %s/%d.%d",
+ request, doc, prot_str, prot_major, prot_minor);
+ else
+ sprintf(logbuf, "Got a *HUGE* request %s/%d.%d",
+ prot_str, prot_major, prot_minor);
+ logmsg("%s", logbuf);
+
+ if(!strncmp("/verifiedserver", ptr, 15)) {
+ logmsg("Are-we-friendly question received");
+ req->testno = DOCNUMBER_WERULEZ;
+ return 1; /* done */
+ }
+
+ if(!strncmp("/quit", ptr, 5)) {
+ logmsg("Request-to-quit received");
+ req->testno = DOCNUMBER_QUIT;
+ return 1; /* done */
+ }
+
+ ptr++; /* skip the slash */
+
+ /* skip all non-numericals following the slash */
+ while(*ptr && !ISDIGIT(*ptr))
+ ptr++;
+
+ req->testno = strtol(ptr, &ptr, 10);
+
+ if(req->testno > 10000) {
+ req->partno = req->testno % 10000;
+ req->testno /= 10000;
+ }
+ else
+ req->partno = 0;
+
+ sprintf(logbuf, "Requested test number %ld part %ld",
+ req->testno, req->partno);
+ logmsg("%s", logbuf);
+
+ filename = test2file(req->testno);
+
+ stream=fopen(filename, "rb");
+ if(!stream) {
+ error = ERRNO;
+ logmsg("fopen() failed with error: %d %s", error, strerror(error));
+ logmsg("Error opening file: %s", filename);
+ logmsg("Couldn't open test file %ld", req->testno);
+ req->open = FALSE; /* closes connection */
+ return 1; /* done */
+ }
+ else {
+ char *cmd = NULL;
+ size_t cmdsize = 0;
+ int num=0;
+
+ int rtp_channel = 0;
+ int rtp_size = 0;
+ int rtp_partno = -1;
+ int i = 0;
+ char *rtp_scratch = NULL;
+
+ /* get the custom server control "commands" */
+ error = getpart(&cmd, &cmdsize, "reply", "servercmd", stream);
+ fclose(stream);
+ if(error) {
+ logmsg("getpart() failed with error: %d", error);
+ req->open = FALSE; /* closes connection */
+ return 1; /* done */
+ }
+ ptr = cmd;
+
+ if(cmdsize) {
+ logmsg("Found a reply-servercmd section!");
+ do {
+ if(!strncmp(CMD_AUTH_REQUIRED, ptr, strlen(CMD_AUTH_REQUIRED))) {
+ logmsg("instructed to require authorization header");
+ req->auth_req = TRUE;
+ }
+ else if(!strncmp(CMD_IDLE, ptr, strlen(CMD_IDLE))) {
+ logmsg("instructed to idle");
+ req->rcmd = RCMD_IDLE;
+ req->open = TRUE;
+ }
+ else if(!strncmp(CMD_STREAM, ptr, strlen(CMD_STREAM))) {
+ logmsg("instructed to stream");
+ req->rcmd = RCMD_STREAM;
+ }
+ else if(1 == sscanf(ptr, "pipe: %d", &num)) {
+ logmsg("instructed to allow a pipe size of %d", num);
+ if(num < 0)
+ logmsg("negative pipe size ignored");
+ else if(num > 0)
+ req->pipe = num-1; /* decrease by one since we don't count the
+ first request in this number */
+ }
+ else if(1 == sscanf(ptr, "skip: %d", &num)) {
+ logmsg("instructed to skip this number of bytes %d", num);
+ req->skip = num;
+ }
+ else if(3 == sscanf(ptr, "rtp: part %d channel %d size %d",
+ &rtp_partno, &rtp_channel, &rtp_size)) {
+
+ if(rtp_partno == req->partno) {
+ logmsg("RTP: part %d channel %d size %d",
+ rtp_partno, rtp_channel, rtp_size);
+
+ /* Make our scratch buffer enough to fit all the
+ * desired data and one for padding */
+ rtp_scratch = malloc(rtp_size + 4 + RTP_DATA_SIZE);
+
+ /* RTP is signalled with a $ */
+ rtp_scratch[0] = '$';
+
+ /* The channel follows and is one byte */
+ SET_RTP_PKT_CHN(rtp_scratch ,rtp_channel);
+
+ /* Length follows and is a two byte short in network order */
+ SET_RTP_PKT_LEN(rtp_scratch, rtp_size);
+
+ /* Fill it with junk data */
+ for(i = 0; i < rtp_size; i+= RTP_DATA_SIZE) {
+ memcpy(rtp_scratch + 4 + i, RTP_DATA, RTP_DATA_SIZE);
+ }
+
+ if(req->rtp_buffer == NULL) {
+ req->rtp_buffer = rtp_scratch;
+ req->rtp_buffersize = rtp_size + 4;
+ } else {
+ req->rtp_buffer = realloc(req->rtp_buffer, req->rtp_buffersize + rtp_size + 4);
+ memcpy(req->rtp_buffer + req->rtp_buffersize, rtp_scratch, rtp_size + 4);
+ req->rtp_buffersize += rtp_size + 4;
+ free(rtp_scratch);
+ }
+ logmsg("rtp_buffersize is %zu, rtp_size is %d.", req->rtp_buffersize, rtp_size);
+
+ }
+ }
+ else {
+ logmsg("funny instruction found: %s", ptr);
+ }
+
+ ptr = strchr(ptr, '\n');
+ if(ptr)
+ ptr++;
+ else
+ ptr = NULL;
+ } while(ptr && *ptr);
+ logmsg("Done parsing server commands");
+ }
+ if(cmd)
+ free(cmd);
+ }
+ }
+ else {
+ if(sscanf(req->reqbuf, "CONNECT %" MAXDOCNAMELEN_TXT "s HTTP/%d.%d",
+ doc, &prot_major, &prot_minor) == 3) {
+ sprintf(logbuf, "Received a CONNECT %s HTTP/%d.%d request",
+ doc, prot_major, prot_minor);
+ logmsg("%s", logbuf);
+
+ if(req->prot_version == 10)
+ req->open = FALSE; /* HTTP 1.0 closes connection by default */
+
+ if(!strncmp(doc, "bad", 3))
+ /* if the host name starts with bad, we fake an error here */
+ req->testno = DOCNUMBER_BADCONNECT;
+ else if(!strncmp(doc, "test", 4)) {
+ /* if the host name starts with test, the port number used in the
+ CONNECT line will be used as test number! */
+ char *portp = strchr(doc, ':');
+ if(portp && (*(portp+1) != '\0') && ISDIGIT(*(portp+1)))
+ req->testno = strtol(portp+1, NULL, 10);
+ else
+ req->testno = DOCNUMBER_CONNECT;
+ }
+ else
+ req->testno = DOCNUMBER_CONNECT;
+ }
+ else {
+ logmsg("Did not find test number in PATH");
+ req->testno = DOCNUMBER_404;
+ }
+ }
+ }
+
+ if(!end) {
+ /* we don't have a complete request yet! */
+ logmsg("ProcessRequest returned without a complete request");
+ return 0; /* not complete yet */
+ }
+ logmsg("ProcessRequest found a complete request");
+
+ if(req->pipe)
+ /* we do have a full set, advance the checkindex to after the end of the
+ headers, for the pipelining case mostly */
+ req->checkindex += (end - line) + strlen(END_OF_HEADERS);
+
+ /* **** Persistence ****
+ *
+ * If the request is a HTTP/1.0 one, we close the connection unconditionally
+ * when we're done.
+ *
+ * If the request is a HTTP/1.1 one, we MUST check for a "Connection:"
+ * header that might say "close". If it does, we close a connection when
+ * this request is processed. Otherwise, we keep the connection alive for X
+ * seconds.
+ */
+
+ do {
+ if(got_exit_signal)
+ return 1; /* done */
+
+ if((req->cl==0) && curlx_strnequal("Content-Length:", line, 15)) {
+ /* If we don't ignore content-length, we read it and we read the whole
+ request including the body before we return. If we've been told to
+ ignore the content-length, we will return as soon as all headers
+ have been received */
+ char *endptr;
+ char *ptr = line + 15;
+ unsigned long clen = 0;
+ while(*ptr && ISSPACE(*ptr))
+ ptr++;
+ endptr = ptr;
+ SET_ERRNO(0);
+ clen = strtoul(ptr, &endptr, 10);
+ if((ptr == endptr) || !ISSPACE(*endptr) || (ERANGE == ERRNO)) {
+ /* this assumes that a zero Content-Length is valid */
+ logmsg("Found invalid Content-Length: (%s) in the request", ptr);
+ req->open = FALSE; /* closes connection */
+ return 1; /* done */
+ }
+ req->cl = clen - req->skip;
+
+ logmsg("Found Content-Length: %lu in the request", clen);
+ if(req->skip)
+ logmsg("... but will abort after %zu bytes", req->cl);
+ break;
+ }
+ else if(curlx_strnequal("Transfer-Encoding: chunked", line,
+ strlen("Transfer-Encoding: chunked"))) {
+ /* chunked data coming in */
+ chunked = TRUE;
+ }
+
+ if(chunked) {
+ if(strstr(req->reqbuf, "\r\n0\r\n\r\n"))
+ /* end of chunks reached */
+ return 1; /* done */
+ else
+ return 0; /* not done */
+ }
+
+ line = strchr(line, '\n');
+ if(line)
+ line++;
+
+ } while(line);
+
+ if(!req->auth && strstr(req->reqbuf, "Authorization:")) {
+ req->auth = TRUE; /* Authorization: header present! */
+ if(req->auth_req)
+ logmsg("Authorization header found, as required");
+ }
+
+ if(!req->digest && strstr(req->reqbuf, "Authorization: Digest")) {
+ /* If the client is passing this Digest-header, we set the part number
+ to 1000. Not only to spice up the complexity of this, but to make
+ Digest stuff to work in the test suite. */
+ req->partno += 1000;
+ req->digest = TRUE; /* header found */
+ logmsg("Received Digest request, sending back data %ld", req->partno);
+ }
+ else if(!req->ntlm &&
+ strstr(req->reqbuf, "Authorization: NTLM TlRMTVNTUAAD")) {
+ /* If the client is passing this type-3 NTLM header */
+ req->partno += 1002;
+ req->ntlm = TRUE; /* NTLM found */
+ logmsg("Received NTLM type-3, sending back data %ld", req->partno);
+ if(req->cl) {
+ logmsg(" Expecting %zu POSTed bytes", req->cl);
+ }
+ }
+ else if(!req->ntlm &&
+ strstr(req->reqbuf, "Authorization: NTLM TlRMTVNTUAAB")) {
+ /* If the client is passing this type-1 NTLM header */
+ req->partno += 1001;
+ req->ntlm = TRUE; /* NTLM found */
+ logmsg("Received NTLM type-1, sending back data %ld", req->partno);
+ }
+ else if((req->partno >= 1000) && strstr(req->reqbuf, "Authorization: Basic")) {
+ /* If the client is passing this Basic-header and the part number is already
+ >=1000, we add 1 to the part number. This allows simple Basic authentication
+ negotiation to work in the test suite. */
+ req->partno += 1;
+ logmsg("Received Basic request, sending back data %ld", req->partno);
+ }
+ if(strstr(req->reqbuf, "Connection: close"))
+ req->open = FALSE; /* close connection after this request */
+
+ if(!req->pipe &&
+ req->open &&
+ req->prot_version >= 11 &&
+ end &&
+ req->reqbuf + req->offset > end + strlen(END_OF_HEADERS) &&
+ (!strncmp(req->reqbuf, "GET", strlen("GET")) ||
+ !strncmp(req->reqbuf, "HEAD", strlen("HEAD")))) {
+ /* If we have a persistent connection, HTTP version >= 1.1
+ and GET/HEAD request, enable pipelining. */
+ req->checkindex = (end - req->reqbuf) + strlen(END_OF_HEADERS);
+ req->pipelining = TRUE;
+ }
+
+ while(req->pipe) {
+ if(got_exit_signal)
+ return 1; /* done */
+ /* scan for more header ends within this chunk */
+ line = &req->reqbuf[req->checkindex];
+ end = strstr(line, END_OF_HEADERS);
+ if(!end)
+ break;
+ req->checkindex += (end - line) + strlen(END_OF_HEADERS);
+ req->pipe--;
+ }
+
+ /* If authentication is required and no auth was provided, end now. This
+ makes the server NOT wait for PUT/POST data and you can then make the
+ test case send a rejection before any such data has been sent. Test case
+ 154 uses this.*/
+ if(req->auth_req && !req->auth)
+ return 1; /* done */
+
+ if(req->cl > 0) {
+ if(req->cl <= req->offset - (end - req->reqbuf) - strlen(END_OF_HEADERS))
+ return 1; /* done */
+ else
+ return 0; /* not complete yet */
+ }
+
+ return 1; /* done */
+}
+
+/* store the entire request in a file */
+static void storerequest(char *reqbuf, size_t totalsize)
+{
+ int res;
+ int error = 0;
+ size_t written;
+ size_t writeleft;
+ FILE *dump;
+
+ if (reqbuf == NULL)
+ return;
+ if (totalsize == 0)
+ return;
+
+ do {
+ dump = fopen(REQUEST_DUMP, "ab");
+ } while ((dump == NULL) && ((error = ERRNO) == EINTR));
+ if (dump == NULL) {
+ logmsg("Error opening file %s error: %d %s",
+ REQUEST_DUMP, error, strerror(error));
+ logmsg("Failed to write request input to " REQUEST_DUMP);
+ return;
+ }
+
+ writeleft = totalsize;
+ do {
+ written = fwrite(&reqbuf[totalsize-writeleft],
+ 1, writeleft, dump);
+ if(got_exit_signal)
+ goto storerequest_cleanup;
+ if(written > 0)
+ writeleft -= written;
+ } while ((writeleft > 0) && ((error = ERRNO) == EINTR));
+
+ if(writeleft == 0)
+ logmsg("Wrote request (%zu bytes) input to " REQUEST_DUMP, totalsize);
+ else if(writeleft > 0) {
+ logmsg("Error writing file %s error: %d %s",
+ REQUEST_DUMP, error, strerror(error));
+ logmsg("Wrote only (%zu bytes) of (%zu bytes) request input to %s",
+ totalsize-writeleft, totalsize, REQUEST_DUMP);
+ }
+
+storerequest_cleanup:
+
+ do {
+ res = fclose(dump);
+ } while(res && ((error = ERRNO) == EINTR));
+ if(res)
+ logmsg("Error closing file %s error: %d %s",
+ REQUEST_DUMP, error, strerror(error));
+}
+
+/* return 0 on success, non-zero on failure */
+static int get_request(curl_socket_t sock, struct httprequest *req)
+{
+ int error;
+ int fail = 0;
+ int done_processing = 0;
+ char *reqbuf = req->reqbuf;
+ ssize_t got = 0;
+
+ char *pipereq = NULL;
+ size_t pipereq_length = 0;
+
+ if(req->pipelining) {
+ pipereq = reqbuf + req->checkindex;
+ pipereq_length = req->offset - req->checkindex;
+ }
+
+ /*** Init the httprequest structure properly for the upcoming request ***/
+
+ req->checkindex = 0;
+ req->offset = 0;
+ req->testno = DOCNUMBER_NOTHING;
+ req->partno = 0;
+ req->open = TRUE;
+ req->auth_req = FALSE;
+ req->auth = FALSE;
+ req->cl = 0;
+ req->digest = FALSE;
+ req->ntlm = FALSE;
+ req->pipe = 0;
+ req->skip = 0;
+ req->rcmd = RCMD_NORMALREQ;
+ req->protocol = RPROT_NONE;
+ req->prot_version = 0;
+ req->pipelining = FALSE;
+ req->rtp_buffer = NULL;
+ req->rtp_buffersize = 0;
+
+ /*** end of httprequest init ***/
+
+ while(!done_processing && (req->offset < REQBUFSIZ-1)) {
+ if(pipereq_length && pipereq) {
+ memmove(reqbuf, pipereq, pipereq_length);
+ got = curlx_uztosz(pipereq_length);
+ pipereq_length = 0;
+ }
+ else {
+ if(req->skip)
+ /* we are instructed to not read the entire thing, so we make sure to only
+ read what we're supposed to and NOT read the enire thing the client
+ wants to send! */
+ got = sread(sock, reqbuf + req->offset, req->cl);
+ else
+ got = sread(sock, reqbuf + req->offset, REQBUFSIZ-1 - req->offset);
+ }
+ if(got_exit_signal)
+ return 1;
+ if(got == 0) {
+ logmsg("Connection closed by client");
+ fail = 1;
+ }
+ else if(got < 0) {
+ error = SOCKERRNO;
+ logmsg("recv() returned error: (%d) %s", error, strerror(error));
+ fail = 1;
+ }
+ if(fail) {
+ /* dump the request received so far to the external file */
+ reqbuf[req->offset] = '\0';
+ storerequest(reqbuf, req->offset);
+ return 1;
+ }
+
+ logmsg("Read %zd bytes", got);
+
+ req->offset += (size_t)got;
+ reqbuf[req->offset] = '\0';
+
+ done_processing = ProcessRequest(req);
+ if(got_exit_signal)
+ return 1;
+ if(done_processing && req->pipe) {
+ logmsg("Waiting for another piped request");
+ done_processing = 0;
+ req->pipe--;
+ }
+ }
+
+ if((req->offset == REQBUFSIZ-1) && (got > 0)) {
+ logmsg("Request would overflow buffer, closing connection");
+ /* dump request received so far to external file anyway */
+ reqbuf[REQBUFSIZ-1] = '\0';
+ fail = 1;
+ }
+ else if(req->offset > REQBUFSIZ-1) {
+ logmsg("Request buffer overflow, closing connection");
+ /* dump request received so far to external file anyway */
+ reqbuf[REQBUFSIZ-1] = '\0';
+ fail = 1;
+ }
+ else
+ reqbuf[req->offset] = '\0';
+
+ /* dump the request to an external file */
+ storerequest(reqbuf, req->pipelining ? req->checkindex : req->offset);
+ if(got_exit_signal)
+ return 1;
+
+ return fail; /* return 0 on success */
+}
+
+/* returns -1 on failure */
+static int send_doc(curl_socket_t sock, struct httprequest *req)
+{
+ ssize_t written;
+ size_t count;
+ const char *buffer;
+ char *ptr=NULL;
+ FILE *stream;
+ char *cmd=NULL;
+ size_t cmdsize=0;
+ FILE *dump;
+ bool persistant = TRUE;
+ bool sendfailure = FALSE;
+ size_t responsesize;
+ int error = 0;
+ int res;
+
+ static char weare[256];
+
+ char partbuf[80]="data";
+
+ logmsg("Send response number %ld part %ld", req->testno, req->partno);
+
+ switch(req->rcmd) {
+ default:
+ case RCMD_NORMALREQ:
+ break; /* continue with business as usual */
+ case RCMD_STREAM:
+#define STREAMTHIS "a string to stream 01234567890\n"
+ count = strlen(STREAMTHIS);
+ for (;;) {
+ written = swrite(sock, STREAMTHIS, count);
+ if(got_exit_signal)
+ return -1;
+ if(written != (ssize_t)count) {
+ logmsg("Stopped streaming");
+ break;
+ }
+ }
+ return -1;
+ case RCMD_IDLE:
+ /* Do nothing. Sit idle. Pretend it rains. */
+ return 0;
+ }
+
+ req->open = FALSE;
+
+ if(req->testno < 0) {
+ size_t msglen;
+ char msgbuf[64];
+
+ switch(req->testno) {
+ case DOCNUMBER_QUIT:
+ logmsg("Replying to QUIT");
+ buffer = docquit;
+ break;
+ case DOCNUMBER_WERULEZ:
+ /* we got a "friends?" question, reply back that we sure are */
+ logmsg("Identifying ourselves as friends");
+ sprintf(msgbuf, "RTSP_SERVER WE ROOLZ: %ld\r\n", (long)getpid());
+ msglen = strlen(msgbuf);
+ sprintf(weare, "HTTP/1.1 200 OK\r\nContent-Length: %zu\r\n\r\n%s",
+ msglen, msgbuf);
+ buffer = weare;
+ break;
+ case DOCNUMBER_INTERNAL:
+ logmsg("Bailing out due to internal error");
+ return -1;
+ case DOCNUMBER_CONNECT:
+ logmsg("Replying to CONNECT");
+ buffer = docconnect;
+ break;
+ case DOCNUMBER_BADCONNECT:
+ logmsg("Replying to a bad CONNECT");
+ buffer = docbadconnect;
+ break;
+ case DOCNUMBER_404:
+ default:
+ logmsg("Replying to with a 404");
+ if(req->protocol == RPROT_HTTP) {
+ buffer = doc404_HTTP;
+ } else {
+ buffer = doc404_RTSP;
+ }
+ break;
+ }
+
+ count = strlen(buffer);
+ }
+ else {
+ char *filename = test2file(req->testno);
+
+ if(0 != req->partno)
+ sprintf(partbuf, "data%ld", req->partno);
+
+ stream=fopen(filename, "rb");
+ if(!stream) {
+ error = ERRNO;
+ logmsg("fopen() failed with error: %d %s", error, strerror(error));
+ logmsg("Error opening file: %s", filename);
+ logmsg("Couldn't open test file");
+ return 0;
+ }
+ else {
+ error = getpart(&ptr, &count, "reply", partbuf, stream);
+ fclose(stream);
+ if(error) {
+ logmsg("getpart() failed with error: %d", error);
+ return 0;
+ }
+ buffer = ptr;
+ }
+
+ if(got_exit_signal) {
+ if(ptr)
+ free(ptr);
+ return -1;
+ }
+
+ /* re-open the same file again */
+ stream=fopen(filename, "rb");
+ if(!stream) {
+ error = ERRNO;
+ logmsg("fopen() failed with error: %d %s", error, strerror(error));
+ logmsg("Error opening file: %s", filename);
+ logmsg("Couldn't open test file");
+ if(ptr)
+ free(ptr);
+ return 0;
+ }
+ else {
+ /* get the custom server control "commands" */
+ error = getpart(&cmd, &cmdsize, "reply", "postcmd", stream);
+ fclose(stream);
+ if(error) {
+ logmsg("getpart() failed with error: %d", error);
+ if(ptr)
+ free(ptr);
+ return 0;
+ }
+ }
+ }
+
+ if(got_exit_signal) {
+ if(ptr)
+ free(ptr);
+ if(cmd)
+ free(cmd);
+ return -1;
+ }
+
+ /* If the word 'swsclose' is present anywhere in the reply chunk, the
+ connection will be closed after the data has been sent to the requesting
+ client... */
+ if(strstr(buffer, "swsclose") || !count) {
+ persistant = FALSE;
+ logmsg("connection close instruction \"swsclose\" found in response");
+ }
+ if(strstr(buffer, "swsbounce")) {
+ prevbounce = TRUE;
+ logmsg("enable \"swsbounce\" in the next request");
+ }
+ else
+ prevbounce = FALSE;
+
+ dump = fopen(RESPONSE_DUMP, "ab");
+ if(!dump) {
+ error = ERRNO;
+ logmsg("fopen() failed with error: %d %s", error, strerror(error));
+ logmsg("Error opening file: %s", RESPONSE_DUMP);
+ logmsg("couldn't create logfile: " RESPONSE_DUMP);
+ if(ptr)
+ free(ptr);
+ if(cmd)
+ free(cmd);
+ return -1;
+ }
+
+ responsesize = count;
+ do {
+ /* Ok, we send no more than 200 bytes at a time, just to make sure that
+ larger chunks are split up so that the client will need to do multiple
+ recv() calls to get it and thus we exercise that code better */
+ size_t num = count;
+ if(num > 200)
+ num = 200;
+ written = swrite(sock, buffer, num);
+ if (written < 0) {
+ sendfailure = TRUE;
+ break;
+ }
+ else {
+ logmsg("Sent off %zd bytes", written);
+ }
+ /* write to file as well */
+ fwrite(buffer, 1, (size_t)written, dump);
+ if(got_exit_signal)
+ break;
+
+ count -= written;
+ buffer += written;
+ } while(count>0);
+
+ /* Send out any RTP data */
+ if(req->rtp_buffer) {
+ logmsg("About to write %zu RTP bytes", req->rtp_buffersize);
+ count = req->rtp_buffersize;
+ do {
+ size_t num = count;
+ if(num > 200)
+ num = 200;
+ written = swrite(sock, req->rtp_buffer + (req->rtp_buffersize - count), num);
+ if(written < 0) {
+ sendfailure = TRUE;
+ break;
+ }
+ count -= written;
+ } while(count > 0);
+
+ free(req->rtp_buffer);
+ req->rtp_buffersize = 0;
+ }
+
+ do {
+ res = fclose(dump);
+ } while(res && ((error = ERRNO) == EINTR));
+ if(res)
+ logmsg("Error closing file %s error: %d %s",
+ RESPONSE_DUMP, error, strerror(error));
+
+ if(got_exit_signal) {
+ if(ptr)
+ free(ptr);
+ if(cmd)
+ free(cmd);
+ return -1;
+ }
+
+ if(sendfailure) {
+ logmsg("Sending response failed. Only (%zu bytes) of (%zu bytes) were sent",
+ responsesize-count, responsesize);
+ if(ptr)
+ free(ptr);
+ if(cmd)
+ free(cmd);
+ return -1;
+ }
+
+ logmsg("Response sent (%zu bytes) and written to " RESPONSE_DUMP,
+ responsesize);
+
+ if(ptr)
+ free(ptr);
+
+ if(cmdsize > 0 ) {
+ char command[32];
+ int quarters;
+ int num;
+ ptr=cmd;
+ do {
+ if(2 == sscanf(ptr, "%31s %d", command, &num)) {
+ if(!strcmp("wait", command)) {
+ logmsg("Told to sleep for %d seconds", num);
+ quarters = num * 4;
+ while(quarters > 0) {
+ quarters--;
+ res = wait_ms(250);
+ if(got_exit_signal)
+ break;
+ if(res) {
+ /* should not happen */
+ error = SOCKERRNO;
+ logmsg("wait_ms() failed with error: (%d) %s",
+ error, strerror(error));
+ break;
+ }
+ }
+ if(!quarters)
+ logmsg("Continuing after sleeping %d seconds", num);
+ }
+ else
+ logmsg("Unknown command in reply command section");
+ }
+ ptr = strchr(ptr, '\n');
+ if(ptr)
+ ptr++;
+ else
+ ptr = NULL;
+ } while(ptr && *ptr);
+ }
+ if(cmd)
+ free(cmd);
+
+ req->open = persistant;
+
+ prevtestno = req->testno;
+ prevpartno = req->partno;
+
+ return 0;
+}
+
+
+int main(int argc, char *argv[])
+{
+ srvr_sockaddr_union_t me;
+ curl_socket_t sock = CURL_SOCKET_BAD;
+ curl_socket_t msgsock = CURL_SOCKET_BAD;
+ int wrotepidfile = 0;
+ int flag;
+ unsigned short port = DEFAULT_PORT;
+ char *pidname= (char *)".rtsp.pid";
+ struct httprequest req;
+ int rc;
+ int error;
+ int arg=1;
+ long pid;
+
+ while(argc>arg) {
+ if(!strcmp("--version", argv[arg])) {
+ printf("rtspd IPv4%s"
+ "\n"
+ ,
+#ifdef ENABLE_IPV6
+ "/IPv6"
+#else
+ ""
+#endif
+ );
+ return 0;
+ }
+ else if(!strcmp("--pidfile", argv[arg])) {
+ arg++;
+ if(argc>arg)
+ pidname = argv[arg++];
+ }
+ else if(!strcmp("--logfile", argv[arg])) {
+ arg++;
+ if(argc>arg)
+ serverlogfile = argv[arg++];
+ }
+ else if(!strcmp("--ipv4", argv[arg])) {
+#ifdef ENABLE_IPV6
+ ipv_inuse = "IPv4";
+ use_ipv6 = FALSE;
+#endif
+ arg++;
+ }
+ else if(!strcmp("--ipv6", argv[arg])) {
+#ifdef ENABLE_IPV6
+ ipv_inuse = "IPv6";
+ use_ipv6 = TRUE;
+#endif
+ arg++;
+ }
+ else if(!strcmp("--port", argv[arg])) {
+ arg++;
+ if(argc>arg) {
+ char *endptr;
+ unsigned long ulnum = strtoul(argv[arg], &endptr, 10);
+ if((endptr != argv[arg] + strlen(argv[arg])) ||
+ (ulnum < 1025UL) || (ulnum > 65535UL)) {
+ fprintf(stderr, "rtspd: invalid --port argument (%s)\n",
+ argv[arg]);
+ return 0;
+ }
+ port = curlx_ultous(ulnum);
+ arg++;
+ }
+ }
+ else if(!strcmp("--srcdir", argv[arg])) {
+ arg++;
+ if(argc>arg) {
+ path = argv[arg];
+ arg++;
+ }
+ }
+ else {
+ puts("Usage: rtspd [option]\n"
+ " --version\n"
+ " --logfile [file]\n"
+ " --pidfile [file]\n"
+ " --ipv4\n"
+ " --ipv6\n"
+ " --port [port]\n"
+ " --srcdir [path]");
+ return 0;
+ }
+ }
+
+#ifdef WIN32
+ win32_init();
+ atexit(win32_cleanup);
+#endif
+
+ install_signal_handlers();
+
+ pid = (long)getpid();
+
+#ifdef ENABLE_IPV6
+ if(!use_ipv6)
+#endif
+ sock = socket(AF_INET, SOCK_STREAM, 0);
+#ifdef ENABLE_IPV6
+ else
+ sock = socket(AF_INET6, SOCK_STREAM, 0);
+#endif
+
+ if(CURL_SOCKET_BAD == sock) {
+ error = SOCKERRNO;
+ logmsg("Error creating socket: (%d) %s",
+ error, strerror(error));
+ goto server_cleanup;
+ }
+
+ flag = 1;
+ if (0 != setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
+ (void *)&flag, sizeof(flag))) {
+ error = SOCKERRNO;
+ logmsg("setsockopt(SO_REUSEADDR) failed with error: (%d) %s",
+ error, strerror(error));
+ goto server_cleanup;
+ }
+
+#ifdef ENABLE_IPV6
+ if(!use_ipv6) {
+#endif
+ memset(&me.sa4, 0, sizeof(me.sa4));
+ me.sa4.sin_family = AF_INET;
+ me.sa4.sin_addr.s_addr = INADDR_ANY;
+ me.sa4.sin_port = htons(port);
+ rc = bind(sock, &me.sa, sizeof(me.sa4));
+#ifdef ENABLE_IPV6
+ }
+ else {
+ memset(&me.sa6, 0, sizeof(me.sa6));
+ me.sa6.sin6_family = AF_INET6;
+ me.sa6.sin6_addr = in6addr_any;
+ me.sa6.sin6_port = htons(port);
+ rc = bind(sock, &me.sa, sizeof(me.sa6));
+ }
+#endif /* ENABLE_IPV6 */
+ if(0 != rc) {
+ error = SOCKERRNO;
+ logmsg("Error binding socket on port %hu: (%d) %s",
+ port, error, strerror(error));
+ goto server_cleanup;
+ }
+
+ logmsg("Running %s version on port %d", ipv_inuse, (int)port);
+
+ /* start accepting connections */
+ rc = listen(sock, 5);
+ if(0 != rc) {
+ error = SOCKERRNO;
+ logmsg("listen() failed with error: (%d) %s",
+ error, strerror(error));
+ goto server_cleanup;
+ }
+
+ /*
+ ** As soon as this server writes its pid file the test harness will
+ ** attempt to connect to this server and initiate its verification.
+ */
+
+ wrotepidfile = write_pidfile(pidname);
+ if(!wrotepidfile)
+ goto server_cleanup;
+
+ for (;;) {
+ msgsock = accept(sock, NULL, NULL);
+
+ if(got_exit_signal)
+ break;
+ if (CURL_SOCKET_BAD == msgsock) {
+ error = SOCKERRNO;
+ logmsg("MAJOR ERROR: accept() failed with error: (%d) %s",
+ error, strerror(error));
+ break;
+ }
+
+ /*
+ ** As soon as this server acepts a connection from the test harness it
+ ** must set the server logs advisor read lock to indicate that server
+ ** logs should not be read until this lock is removed by this server.
+ */
+
+ set_advisor_read_lock(SERVERLOGS_LOCK);
+ serverlogslocked = 1;
+
+ logmsg("====> Client connect");
+
+#ifdef TCP_NODELAY
+ /*
+ * Disable the Nagle algorithm to make it easier to send out a large
+ * response in many small segments to torture the clients more.
+ */
+ flag = 1;
+ if (setsockopt(msgsock, IPPROTO_TCP, TCP_NODELAY,
+ (void *)&flag, sizeof(flag)) == -1) {
+ logmsg("====> TCP_NODELAY failed");
+ }
+#endif
+
+ /* initialization of httprequest struct is done in get_request(), but due
+ to pipelining treatment the pipelining struct field must be initialized
+ previously to FALSE every time a new connection arrives. */
+
+ req.pipelining = FALSE;
+
+ do {
+ if(got_exit_signal)
+ break;
+
+ if(get_request(msgsock, &req))
+ /* non-zero means error, break out of loop */
+ break;
+
+ if(prevbounce) {
+ /* bounce treatment requested */
+ if((req.testno == prevtestno) &&
+ (req.partno == prevpartno)) {
+ req.partno++;
+ logmsg("BOUNCE part number to %ld", req.partno);
+ }
+ else {
+ prevbounce = FALSE;
+ prevtestno = -1;
+ prevpartno = -1;
+ }
+ }
+
+ send_doc(msgsock, &req);
+ if(got_exit_signal)
+ break;
+
+ if((req.testno < 0) && (req.testno != DOCNUMBER_CONNECT)) {
+ logmsg("special request received, no persistency");
+ break;
+ }
+ if(!req.open) {
+ logmsg("instructed to close connection after server-reply");
+ break;
+ }
+
+ if(req.open)
+ logmsg("=> persistant connection request ended, awaits new request");
+ /* if we got a CONNECT, loop and get another request as well! */
+ } while(req.open || (req.testno == DOCNUMBER_CONNECT));
+
+ if(got_exit_signal)
+ break;
+
+ logmsg("====> Client disconnect");
+ sclose(msgsock);
+ msgsock = CURL_SOCKET_BAD;
+
+ if(serverlogslocked) {
+ serverlogslocked = 0;
+ clear_advisor_read_lock(SERVERLOGS_LOCK);
+ }
+
+ if (req.testno == DOCNUMBER_QUIT)
+ break;
+ }
+
+server_cleanup:
+
+ if((msgsock != sock) && (msgsock != CURL_SOCKET_BAD))
+ sclose(msgsock);
+
+ if(sock != CURL_SOCKET_BAD)
+ sclose(sock);
+
+ if(got_exit_signal)
+ logmsg("signalled to die");
+
+ if(wrotepidfile)
+ unlink(pidname);
+
+ if(serverlogslocked) {
+ serverlogslocked = 0;
+ clear_advisor_read_lock(SERVERLOGS_LOCK);
+ }
+
+ restore_signal_handlers();
+
+ if(got_exit_signal) {
+ logmsg("========> %s rtspd (port: %d pid: %ld) exits with signal (%d)",
+ ipv_inuse, (int)port, pid, exit_signal);
+ /*
+ * To properly set the return status of the process we
+ * must raise the same signal SIGINT or SIGTERM that we
+ * caught and let the old handler take care of it.
+ */
+ raise(exit_signal);
+ }
+
+ logmsg("========> rtspd quits");
+ return 0;
+}
+
diff --git a/tests/server/server_sockaddr.h b/tests/server/server_sockaddr.h
new file mode 100644
index 000000000..e2c059a24
--- /dev/null
+++ b/tests/server/server_sockaddr.h
@@ -0,0 +1,33 @@
+#ifndef HEADER_SERVER_SOCKADDR_H
+#define HEADER_SERVER_SOCKADDR_H
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+
+typedef union {
+ struct sockaddr sa;
+ struct sockaddr_in sa4;
+#ifdef ENABLE_IPV6
+ struct sockaddr_in6 sa6;
+#endif
+} srvr_sockaddr_union_t;
+
+#endif /* HEADER_SERVER_SOCKADDR_H */
diff --git a/tests/server/sockfilt.c b/tests/server/sockfilt.c
new file mode 100644
index 000000000..90ce9d919
--- /dev/null
+++ b/tests/server/sockfilt.c
@@ -0,0 +1,1042 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+
+/* Purpose
+ *
+ * 1. Accept a TCP connection on a custom port (ipv4 or ipv6), or connect
+ * to a given (localhost) port.
+ *
+ * 2. Get commands on STDIN. Pass data on to the TCP stream.
+ * Get data from TCP stream and pass on to STDOUT.
+ *
+ * This program is made to perform all the socket/stream/connection stuff for
+ * the test suite's (perl) FTP server. Previously the perl code did all of
+ * this by its own, but I decided to let this program do the socket layer
+ * because of several things:
+ *
+ * o We want the perl code to work with rather old perl installations, thus
+ * we cannot use recent perl modules or features.
+ *
+ * o We want IPv6 support for systems that provide it, and doing optional IPv6
+ * support in perl seems if not impossible so at least awkward.
+ *
+ * o We want FTP-SSL support, which means that a connection that starts with
+ * plain sockets needs to be able to "go SSL" in the midst. This would also
+ * require some nasty perl stuff I'd rather avoid.
+ *
+ * (Source originally based on sws.c)
+ */
+
+/*
+ * Signal handling notes for sockfilt
+ * ----------------------------------
+ *
+ * This program is a single-threaded process.
+ *
+ * This program is intended to be highly portable and as such it must be kept as
+ * simple as possible, due to this the only signal handling mechanisms used will
+ * be those of ANSI C, and used only in the most basic form which is good enough
+ * for the purpose of this program.
+ *
+ * For the above reason and the specific needs of this program signals SIGHUP,
+ * SIGPIPE and SIGALRM will be simply ignored on systems where this can be done.
+ * If possible, signals SIGINT and SIGTERM will be handled by this program as an
+ * indication to cleanup and finish execution as soon as possible. This will be
+ * achieved with a single signal handler 'exit_signal_handler' for both signals.
+ *
+ * The 'exit_signal_handler' upon the first SIGINT or SIGTERM received signal
+ * will just set to one the global var 'got_exit_signal' storing in global var
+ * 'exit_signal' the signal that triggered this change.
+ *
+ * Nothing fancy that could introduce problems is used, the program at certain
+ * points in its normal flow checks if var 'got_exit_signal' is set and in case
+ * this is true it just makes its way out of loops and functions in structured
+ * and well behaved manner to achieve proper program cleanup and termination.
+ *
+ * Even with the above mechanism implemented it is worthwile to note that other
+ * signals might still be received, or that there might be systems on which it
+ * is not possible to trap and ignore some of the above signals. This implies
+ * that for increased portability and reliability the program must be coded as
+ * if no signal was being ignored or handled at all. Enjoy it!
+ */
+
+#define CURL_NO_OLDIES
+
+#include "setup.h" /* portability help from the lib directory */
+
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+
+#define ENABLE_CURLX_PRINTF
+/* make the curlx header define all printf() functions to use the curlx_*
+ versions instead */
+#include "curlx.h" /* from the private lib dir */
+#include "getpart.h"
+#include "inet_pton.h"
+#include "util.h"
+#include "server_sockaddr.h"
+
+/* include memdebug.h last */
+#include "memdebug.h"
+
+#define DEFAULT_PORT 8999
+
+#ifndef DEFAULT_LOGFILE
+#define DEFAULT_LOGFILE "log/sockfilt.log"
+#endif
+
+const char *serverlogfile = DEFAULT_LOGFILE;
+
+static bool verbose = FALSE;
+#ifdef ENABLE_IPV6
+static bool use_ipv6 = FALSE;
+#endif
+static const char *ipv_inuse = "IPv4";
+static unsigned short port = DEFAULT_PORT;
+static unsigned short connectport = 0; /* if non-zero, we activate this mode */
+
+enum sockmode {
+ PASSIVE_LISTEN, /* as a server waiting for connections */
+ PASSIVE_CONNECT, /* as a server, connected to a client */
+ ACTIVE, /* as a client, connected to a server */
+ ACTIVE_DISCONNECT /* as a client, disconnected from server */
+};
+
+/* do-nothing macro replacement for systems which lack siginterrupt() */
+
+#ifndef HAVE_SIGINTERRUPT
+#define siginterrupt(x,y) do {} while(0)
+#endif
+
+/* vars used to keep around previous signal handlers */
+
+typedef RETSIGTYPE (*SIGHANDLER_T)(int);
+
+#ifdef SIGHUP
+static SIGHANDLER_T old_sighup_handler = SIG_ERR;
+#endif
+
+#ifdef SIGPIPE
+static SIGHANDLER_T old_sigpipe_handler = SIG_ERR;
+#endif
+
+#ifdef SIGALRM
+static SIGHANDLER_T old_sigalrm_handler = SIG_ERR;
+#endif
+
+#ifdef SIGINT
+static SIGHANDLER_T old_sigint_handler = SIG_ERR;
+#endif
+
+#ifdef SIGTERM
+static SIGHANDLER_T old_sigterm_handler = SIG_ERR;
+#endif
+
+/* var which if set indicates that the program should finish execution */
+
+SIG_ATOMIC_T got_exit_signal = 0;
+
+/* if next is set indicates the first signal handled in exit_signal_handler */
+
+static volatile int exit_signal = 0;
+
+/* signal handler that will be triggered to indicate that the program
+ should finish its execution in a controlled manner as soon as possible.
+ The first time this is called it will set got_exit_signal to one and
+ store in exit_signal the signal that triggered its execution. */
+
+static RETSIGTYPE exit_signal_handler(int signum)
+{
+ int old_errno = ERRNO;
+ if(got_exit_signal == 0) {
+ got_exit_signal = 1;
+ exit_signal = signum;
+ }
+ (void)signal(signum, exit_signal_handler);
+ SET_ERRNO(old_errno);
+}
+
+static void install_signal_handlers(void)
+{
+#ifdef SIGHUP
+ /* ignore SIGHUP signal */
+ if((old_sighup_handler = signal(SIGHUP, SIG_IGN)) == SIG_ERR)
+ logmsg("cannot install SIGHUP handler: %s", strerror(ERRNO));
+#endif
+#ifdef SIGPIPE
+ /* ignore SIGPIPE signal */
+ if((old_sigpipe_handler = signal(SIGPIPE, SIG_IGN)) == SIG_ERR)
+ logmsg("cannot install SIGPIPE handler: %s", strerror(ERRNO));
+#endif
+#ifdef SIGALRM
+ /* ignore SIGALRM signal */
+ if((old_sigalrm_handler = signal(SIGALRM, SIG_IGN)) == SIG_ERR)
+ logmsg("cannot install SIGALRM handler: %s", strerror(ERRNO));
+#endif
+#ifdef SIGINT
+ /* handle SIGINT signal with our exit_signal_handler */
+ if((old_sigint_handler = signal(SIGINT, exit_signal_handler)) == SIG_ERR)
+ logmsg("cannot install SIGINT handler: %s", strerror(ERRNO));
+ else
+ siginterrupt(SIGINT, 1);
+#endif
+#ifdef SIGTERM
+ /* handle SIGTERM signal with our exit_signal_handler */
+ if((old_sigterm_handler = signal(SIGTERM, exit_signal_handler)) == SIG_ERR)
+ logmsg("cannot install SIGTERM handler: %s", strerror(ERRNO));
+ else
+ siginterrupt(SIGTERM, 1);
+#endif
+}
+
+static void restore_signal_handlers(void)
+{
+#ifdef SIGHUP
+ if(SIG_ERR != old_sighup_handler)
+ (void)signal(SIGHUP, old_sighup_handler);
+#endif
+#ifdef SIGPIPE
+ if(SIG_ERR != old_sigpipe_handler)
+ (void)signal(SIGPIPE, old_sigpipe_handler);
+#endif
+#ifdef SIGALRM
+ if(SIG_ERR != old_sigalrm_handler)
+ (void)signal(SIGALRM, old_sigalrm_handler);
+#endif
+#ifdef SIGINT
+ if(SIG_ERR != old_sigint_handler)
+ (void)signal(SIGINT, old_sigint_handler);
+#endif
+#ifdef SIGTERM
+ if(SIG_ERR != old_sigterm_handler)
+ (void)signal(SIGTERM, old_sigterm_handler);
+#endif
+}
+
+/*
+ * fullread is a wrapper around the read() function. This will repeat the call
+ * to read() until it actually has read the complete number of bytes indicated
+ * in nbytes or it fails with a condition that cannot be handled with a simple
+ * retry of the read call.
+ */
+
+static ssize_t fullread(int filedes, void *buffer, size_t nbytes)
+{
+ int error;
+ ssize_t rc;
+ ssize_t nread = 0;
+
+ do {
+ rc = read(filedes, (unsigned char *)buffer + nread, nbytes - nread);
+
+ if(got_exit_signal) {
+ logmsg("signalled to die");
+ return -1;
+ }
+
+ if(rc < 0) {
+ error = ERRNO;
+ if((error == EINTR) || (error == EAGAIN))
+ continue;
+ logmsg("unrecoverable read() failure: %s", strerror(error));
+ return -1;
+ }
+
+ if(rc == 0) {
+ logmsg("got 0 reading from stdin");
+ return 0;
+ }
+
+ nread += rc;
+
+ } while((size_t)nread < nbytes);
+
+ if(verbose)
+ logmsg("read %zd bytes", nread);
+
+ return nread;
+}
+
+/*
+ * fullwrite is a wrapper around the write() function. This will repeat the
+ * call to write() until it actually has written the complete number of bytes
+ * indicated in nbytes or it fails with a condition that cannot be handled
+ * with a simple retry of the write call.
+ */
+
+static ssize_t fullwrite(int filedes, const void *buffer, size_t nbytes)
+{
+ int error;
+ ssize_t wc;
+ ssize_t nwrite = 0;
+
+ do {
+ wc = write(filedes, (unsigned char *)buffer + nwrite, nbytes - nwrite);
+
+ if(got_exit_signal) {
+ logmsg("signalled to die");
+ return -1;
+ }
+
+ if(wc < 0) {
+ error = ERRNO;
+ if((error == EINTR) || (error == EAGAIN))
+ continue;
+ logmsg("unrecoverable write() failure: %s", strerror(error));
+ return -1;
+ }
+
+ if(wc == 0) {
+ logmsg("put 0 writing to stdout");
+ return 0;
+ }
+
+ nwrite += wc;
+
+ } while((size_t)nwrite < nbytes);
+
+ if(verbose)
+ logmsg("wrote %zd bytes", nwrite);
+
+ return nwrite;
+}
+
+/*
+ * read_stdin tries to read from stdin nbytes into the given buffer. This is a
+ * blocking function that will only return TRUE when nbytes have actually been
+ * read or FALSE when an unrecoverable error has been detected. Failure of this
+ * function is an indication that the sockfilt process should terminate.
+ */
+
+static bool read_stdin(void *buffer, size_t nbytes)
+{
+ ssize_t nread = fullread(fileno(stdin), buffer, nbytes);
+ if(nread != (ssize_t)nbytes) {
+ logmsg("exiting...");
+ return FALSE;
+ }
+ return TRUE;
+}
+
+/*
+ * write_stdout tries to write to stdio nbytes from the given buffer. This is a
+ * blocking function that will only return TRUE when nbytes have actually been
+ * written or FALSE when an unrecoverable error has been detected. Failure of
+ * this function is an indication that the sockfilt process should terminate.
+ */
+
+static bool write_stdout(const void *buffer, size_t nbytes)
+{
+ ssize_t nwrite = fullwrite(fileno(stdout), buffer, nbytes);
+ if(nwrite != (ssize_t)nbytes) {
+ logmsg("exiting...");
+ return FALSE;
+ }
+ return TRUE;
+}
+
+static void lograw(unsigned char *buffer, ssize_t len)
+{
+ char data[120];
+ ssize_t i;
+ unsigned char *ptr = buffer;
+ char *optr = data;
+ ssize_t width=0;
+
+ for(i=0; i<len; i++) {
+ switch(ptr[i]) {
+ case '\n':
+ sprintf(optr, "\\n");
+ width += 2;
+ optr += 2;
+ break;
+ case '\r':
+ sprintf(optr, "\\r");
+ width += 2;
+ optr += 2;
+ break;
+ default:
+ sprintf(optr, "%c", (ISGRAPH(ptr[i]) || ptr[i]==0x20) ?ptr[i]:'.');
+ width++;
+ optr++;
+ break;
+ }
+
+ if(width>60) {
+ logmsg("'%s'", data);
+ width = 0;
+ optr = data;
+ }
+ }
+ if(width)
+ logmsg("'%s'", data);
+}
+
+/*
+ sockfdp is a pointer to an established stream or CURL_SOCKET_BAD
+
+ if sockfd is CURL_SOCKET_BAD, listendfd is a listening socket we must
+ accept()
+*/
+static bool juggle(curl_socket_t *sockfdp,
+ curl_socket_t listenfd,
+ enum sockmode *mode)
+{
+ struct timeval timeout;
+ fd_set fds_read;
+ fd_set fds_write;
+ fd_set fds_err;
+ curl_socket_t sockfd = CURL_SOCKET_BAD;
+ curl_socket_t maxfd = CURL_SOCKET_BAD;
+ ssize_t rc;
+ ssize_t nread_socket;
+ ssize_t bytes_written;
+ ssize_t buffer_len;
+ int error = 0;
+
+ /* 'buffer' is this excessively large only to be able to support things like
+ test 1003 which tests exceedingly large server response lines */
+ unsigned char buffer[17010];
+ char data[16];
+
+ if(got_exit_signal) {
+ logmsg("signalled to die, exiting...");
+ return FALSE;
+ }
+
+#ifdef HAVE_GETPPID
+ /* As a last resort, quit if sockfilt process becomes orphan. Just in case
+ parent ftpserver process has died without killing its sockfilt children */
+ if(getppid() <= 1) {
+ logmsg("process becomes orphan, exiting");
+ return FALSE;
+ }
+#endif
+
+ timeout.tv_sec = 120;
+ timeout.tv_usec = 0;
+
+ FD_ZERO(&fds_read);
+ FD_ZERO(&fds_write);
+ FD_ZERO(&fds_err);
+
+#ifdef USE_WINSOCK
+ /*
+ ** WinSock select() does not support standard file descriptors,
+ ** it can only check SOCKETs. Since this program in its current
+ ** state will not work on WinSock based systems, next line is
+ ** commented out to allow warning-free compilation awaiting the
+ ** day it will be fixed to also run on WinSock systems.
+ */
+#else
+ FD_SET(fileno(stdin), &fds_read);
+#endif
+
+ switch(*mode) {
+
+ case PASSIVE_LISTEN:
+
+ /* server mode */
+ sockfd = listenfd;
+ /* there's always a socket to wait for */
+ FD_SET(sockfd, &fds_read);
+ maxfd = sockfd;
+ break;
+
+ case PASSIVE_CONNECT:
+
+ sockfd = *sockfdp;
+ if(CURL_SOCKET_BAD == sockfd) {
+ /* eeek, we are supposedly connected and then this cannot be -1 ! */
+ logmsg("socket is -1! on %s:%d", __FILE__, __LINE__);
+ maxfd = 0; /* stdin */
+ }
+ else {
+ /* there's always a socket to wait for */
+ FD_SET(sockfd, &fds_read);
+ maxfd = sockfd;
+ }
+ break;
+
+ case ACTIVE:
+
+ sockfd = *sockfdp;
+ /* sockfd turns CURL_SOCKET_BAD when our connection has been closed */
+ if(CURL_SOCKET_BAD != sockfd) {
+ FD_SET(sockfd, &fds_read);
+ maxfd = sockfd;
+ }
+ else {
+ logmsg("No socket to read on");
+ maxfd = 0;
+ }
+ break;
+
+ case ACTIVE_DISCONNECT:
+
+ logmsg("disconnected, no socket to read on");
+ maxfd = 0;
+ sockfd = CURL_SOCKET_BAD;
+ break;
+
+ } /* switch(*mode) */
+
+
+ do {
+
+ rc = select((int)maxfd + 1, &fds_read, &fds_write, &fds_err, &timeout);
+
+ if(got_exit_signal) {
+ logmsg("signalled to die, exiting...");
+ return FALSE;
+ }
+
+ } while((rc == -1) && ((error = SOCKERRNO) == EINTR));
+
+ if(rc < 0) {
+ logmsg("select() failed with error: (%d) %s",
+ error, strerror(error));
+ return FALSE;
+ }
+
+ if(rc == 0)
+ /* timeout */
+ return TRUE;
+
+
+ if(FD_ISSET(fileno(stdin), &fds_read)) {
+ /* read from stdin, commands/data to be dealt with and possibly passed on
+ to the socket
+
+ protocol:
+
+ 4 letter command + LF [mandatory]
+
+ 4-digit hexadecimal data length + LF [if the command takes data]
+ data [the data being as long as set above]
+
+ Commands:
+
+ DATA - plain pass-thru data
+ */
+
+ if(!read_stdin(buffer, 5))
+ return FALSE;
+
+ logmsg("Received %c%c%c%c (on stdin)",
+ buffer[0], buffer[1], buffer[2], buffer[3] );
+
+ if(!memcmp("PING", buffer, 4)) {
+ /* send reply on stdout, just proving we are alive */
+ if(!write_stdout("PONG\n", 5))
+ return FALSE;
+ }
+
+ else if(!memcmp("PORT", buffer, 4)) {
+ /* Question asking us what PORT number we are listening to.
+ Replies to PORT with "IPv[num]/[port]" */
+ sprintf((char *)buffer, "%s/%hu\n", ipv_inuse, port);
+ buffer_len = (ssize_t)strlen((char *)buffer);
+ snprintf(data, sizeof(data), "PORT\n%04zx\n", buffer_len);
+ if(!write_stdout(data, 10))
+ return FALSE;
+ if(!write_stdout(buffer, buffer_len))
+ return FALSE;
+ }
+ else if(!memcmp("QUIT", buffer, 4)) {
+ /* just die */
+ logmsg("quits");
+ return FALSE;
+ }
+ else if(!memcmp("DATA", buffer, 4)) {
+ /* data IN => data OUT */
+
+ if(!read_stdin(buffer, 5))
+ return FALSE;
+
+ buffer[5] = '\0';
+
+ buffer_len = (ssize_t)strtol((char *)buffer, NULL, 16);
+ if (buffer_len > (ssize_t)sizeof(buffer)) {
+ logmsg("ERROR: Buffer size (%zu bytes) too small for data size "
+ "(%zd bytes)", sizeof(buffer), buffer_len);
+ return FALSE;
+ }
+ logmsg("> %zd bytes data, server => client", buffer_len);
+
+ if(!read_stdin(buffer, buffer_len))
+ return FALSE;
+
+ lograw(buffer, buffer_len);
+
+ if(*mode == PASSIVE_LISTEN) {
+ logmsg("*** We are disconnected!");
+ if(!write_stdout("DISC\n", 5))
+ return FALSE;
+ }
+ else {
+ /* send away on the socket */
+ bytes_written = swrite(sockfd, buffer, buffer_len);
+ if(bytes_written != buffer_len) {
+ logmsg("Not all data was sent. Bytes to send: %zd sent: %zd",
+ buffer_len, bytes_written);
+ }
+ }
+ }
+ else if(!memcmp("DISC", buffer, 4)) {
+ /* disconnect! */
+ if(!write_stdout("DISC\n", 5))
+ return FALSE;
+ if(sockfd != CURL_SOCKET_BAD) {
+ logmsg("====> Client forcibly disconnected");
+ sclose(sockfd);
+ *sockfdp = CURL_SOCKET_BAD;
+ if(*mode == PASSIVE_CONNECT)
+ *mode = PASSIVE_LISTEN;
+ else
+ *mode = ACTIVE_DISCONNECT;
+ }
+ else
+ logmsg("attempt to close already dead connection");
+ return TRUE;
+ }
+ }
+
+
+ if((sockfd != CURL_SOCKET_BAD) && (FD_ISSET(sockfd, &fds_read)) ) {
+
+ if(*mode == PASSIVE_LISTEN) {
+ /* there's no stream set up yet, this is an indication that there's a
+ client connecting. */
+ sockfd = accept(sockfd, NULL, NULL);
+ if(CURL_SOCKET_BAD == sockfd)
+ logmsg("accept() failed");
+ else {
+ logmsg("====> Client connect");
+ if(!write_stdout("CNCT\n", 5))
+ return FALSE;
+ *sockfdp = sockfd; /* store the new socket */
+ *mode = PASSIVE_CONNECT; /* we have connected */
+ }
+ return TRUE;
+ }
+
+ /* read from socket, pass on data to stdout */
+ nread_socket = sread(sockfd, buffer, sizeof(buffer));
+
+ if(nread_socket <= 0) {
+ logmsg("====> Client disconnect");
+ if(!write_stdout("DISC\n", 5))
+ return FALSE;
+ sclose(sockfd);
+ *sockfdp = CURL_SOCKET_BAD;
+ if(*mode == PASSIVE_CONNECT)
+ *mode = PASSIVE_LISTEN;
+ else
+ *mode = ACTIVE_DISCONNECT;
+ return TRUE;
+ }
+
+ snprintf(data, sizeof(data), "DATA\n%04zx\n", nread_socket);
+ if(!write_stdout(data, 10))
+ return FALSE;
+ if(!write_stdout(buffer, nread_socket))
+ return FALSE;
+
+ logmsg("< %zd bytes data, client => server", nread_socket);
+ lograw(buffer, nread_socket);
+ }
+
+ return TRUE;
+}
+
+static curl_socket_t sockdaemon(curl_socket_t sock,
+ unsigned short *listenport)
+{
+ /* passive daemon style */
+ srvr_sockaddr_union_t listener;
+ int flag;
+ int rc;
+ int totdelay = 0;
+ int maxretr = 10;
+ int delay= 20;
+ int attempt = 0;
+ int error = 0;
+
+ do {
+ attempt++;
+ flag = 1;
+ rc = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
+ (void *)&flag, sizeof(flag));
+ if(rc) {
+ error = SOCKERRNO;
+ logmsg("setsockopt(SO_REUSEADDR) failed with error: (%d) %s",
+ error, strerror(error));
+ if(maxretr) {
+ rc = wait_ms(delay);
+ if(rc) {
+ /* should not happen */
+ error = SOCKERRNO;
+ logmsg("wait_ms() failed with error: (%d) %s",
+ error, strerror(error));
+ sclose(sock);
+ return CURL_SOCKET_BAD;
+ }
+ if(got_exit_signal) {
+ logmsg("signalled to die, exiting...");
+ sclose(sock);
+ return CURL_SOCKET_BAD;
+ }
+ totdelay += delay;
+ delay *= 2; /* double the sleep for next attempt */
+ }
+ }
+ } while(rc && maxretr--);
+
+ if(rc) {
+ logmsg("setsockopt(SO_REUSEADDR) failed %d times in %d ms. Error: (%d) %s",
+ attempt, totdelay, error, strerror(error));
+ logmsg("Continuing anyway...");
+ }
+
+ /* When the specified listener port is zero, it is actually a
+ request to let the system choose a non-zero available port. */
+
+#ifdef ENABLE_IPV6
+ if(!use_ipv6) {
+#endif
+ memset(&listener.sa4, 0, sizeof(listener.sa4));
+ listener.sa4.sin_family = AF_INET;
+ listener.sa4.sin_addr.s_addr = INADDR_ANY;
+ listener.sa4.sin_port = htons(*listenport);
+ rc = bind(sock, &listener.sa, sizeof(listener.sa4));
+#ifdef ENABLE_IPV6
+ }
+ else {
+ memset(&listener.sa6, 0, sizeof(listener.sa6));
+ listener.sa6.sin6_family = AF_INET6;
+ listener.sa6.sin6_addr = in6addr_any;
+ listener.sa6.sin6_port = htons(*listenport);
+ rc = bind(sock, &listener.sa, sizeof(listener.sa6));
+ }
+#endif /* ENABLE_IPV6 */
+ if(rc) {
+ error = SOCKERRNO;
+ logmsg("Error binding socket on port %hu: (%d) %s",
+ *listenport, error, strerror(error));
+ sclose(sock);
+ return CURL_SOCKET_BAD;
+ }
+
+ if(!*listenport) {
+ /* The system was supposed to choose a port number, figure out which
+ port we actually got and update the listener port value with it. */
+ curl_socklen_t la_size;
+ srvr_sockaddr_union_t localaddr;
+#ifdef ENABLE_IPV6
+ if(!use_ipv6)
+#endif
+ la_size = sizeof(localaddr.sa4);
+#ifdef ENABLE_IPV6
+ else
+ la_size = sizeof(localaddr.sa6);
+#endif
+ memset(&localaddr.sa, 0, (size_t)la_size);
+ if(getsockname(sock, &localaddr.sa, &la_size) < 0) {
+ error = SOCKERRNO;
+ logmsg("getsockname() failed with error: (%d) %s",
+ error, strerror(error));
+ sclose(sock);
+ return CURL_SOCKET_BAD;
+ }
+ switch (localaddr.sa.sa_family) {
+ case AF_INET:
+ *listenport = ntohs(localaddr.sa4.sin_port);
+ break;
+#ifdef ENABLE_IPV6
+ case AF_INET6:
+ *listenport = ntohs(localaddr.sa6.sin6_port);
+ break;
+#endif
+ default:
+ break;
+ }
+ if(!*listenport) {
+ /* Real failure, listener port shall not be zero beyond this point. */
+ logmsg("Apparently getsockname() succeeded, with listener port zero.");
+ logmsg("A valid reason for this failure is a binary built without");
+ logmsg("proper network library linkage. This might not be the only");
+ logmsg("reason, but double check it before anything else.");
+ sclose(sock);
+ return CURL_SOCKET_BAD;
+ }
+ }
+
+ /* start accepting connections */
+ rc = listen(sock, 5);
+ if(0 != rc) {
+ error = SOCKERRNO;
+ logmsg("listen() failed with error: (%d) %s",
+ error, strerror(error));
+ sclose(sock);
+ return CURL_SOCKET_BAD;
+ }
+
+ return sock;
+}
+
+
+int main(int argc, char *argv[])
+{
+ srvr_sockaddr_union_t me;
+ curl_socket_t sock = CURL_SOCKET_BAD;
+ curl_socket_t msgsock = CURL_SOCKET_BAD;
+ int wrotepidfile = 0;
+ char *pidname= (char *)".sockfilt.pid";
+ bool juggle_again;
+ int rc;
+ int error;
+ int arg=1;
+ enum sockmode mode = PASSIVE_LISTEN; /* default */
+ const char *addr = NULL;
+
+ while(argc>arg) {
+ if(!strcmp("--version", argv[arg])) {
+ printf("sockfilt IPv4%s\n",
+#ifdef ENABLE_IPV6
+ "/IPv6"
+#else
+ ""
+#endif
+ );
+ return 0;
+ }
+ else if(!strcmp("--verbose", argv[arg])) {
+ verbose = TRUE;
+ arg++;
+ }
+ else if(!strcmp("--pidfile", argv[arg])) {
+ arg++;
+ if(argc>arg)
+ pidname = argv[arg++];
+ }
+ else if(!strcmp("--logfile", argv[arg])) {
+ arg++;
+ if(argc>arg)
+ serverlogfile = argv[arg++];
+ }
+ else if(!strcmp("--ipv6", argv[arg])) {
+#ifdef ENABLE_IPV6
+ ipv_inuse = "IPv6";
+ use_ipv6 = TRUE;
+#endif
+ arg++;
+ }
+ else if(!strcmp("--ipv4", argv[arg])) {
+ /* for completeness, we support this option as well */
+#ifdef ENABLE_IPV6
+ ipv_inuse = "IPv4";
+ use_ipv6 = FALSE;
+#endif
+ arg++;
+ }
+ else if(!strcmp("--port", argv[arg])) {
+ arg++;
+ if(argc>arg) {
+ char *endptr;
+ unsigned long ulnum = strtoul(argv[arg], &endptr, 10);
+ if((endptr != argv[arg] + strlen(argv[arg])) ||
+ ((ulnum != 0UL) && ((ulnum < 1025UL) || (ulnum > 65535UL)))) {
+ fprintf(stderr, "sockfilt: invalid --port argument (%s)\n",
+ argv[arg]);
+ return 0;
+ }
+ port = curlx_ultous(ulnum);
+ arg++;
+ }
+ }
+ else if(!strcmp("--connect", argv[arg])) {
+ /* Asked to actively connect to the specified local port instead of
+ doing a passive server-style listening. */
+ arg++;
+ if(argc>arg) {
+ char *endptr;
+ unsigned long ulnum = strtoul(argv[arg], &endptr, 10);
+ if((endptr != argv[arg] + strlen(argv[arg])) ||
+ (ulnum < 1025UL) || (ulnum > 65535UL)) {
+ fprintf(stderr, "sockfilt: invalid --connect argument (%s)\n",
+ argv[arg]);
+ return 0;
+ }
+ connectport = curlx_ultous(ulnum);
+ arg++;
+ }
+ }
+ else if(!strcmp("--addr", argv[arg])) {
+ /* Set an IP address to use with --connect; otherwise use localhost */
+ arg++;
+ if(argc>arg) {
+ addr = argv[arg];
+ arg++;
+ }
+ }
+ else {
+ puts("Usage: sockfilt [option]\n"
+ " --version\n"
+ " --verbose\n"
+ " --logfile [file]\n"
+ " --pidfile [file]\n"
+ " --ipv4\n"
+ " --ipv6\n"
+ " --port [port]\n"
+ " --connect [port]\n"
+ " --addr [address]");
+ return 0;
+ }
+ }
+
+#ifdef WIN32
+ win32_init();
+ atexit(win32_cleanup);
+#endif
+
+ install_signal_handlers();
+
+#ifdef ENABLE_IPV6
+ if(!use_ipv6)
+#endif
+ sock = socket(AF_INET, SOCK_STREAM, 0);
+#ifdef ENABLE_IPV6
+ else
+ sock = socket(AF_INET6, SOCK_STREAM, 0);
+#endif
+
+ if(CURL_SOCKET_BAD == sock) {
+ error = SOCKERRNO;
+ logmsg("Error creating socket: (%d) %s",
+ error, strerror(error));
+ goto sockfilt_cleanup;
+ }
+
+ if(connectport) {
+ /* Active mode, we should connect to the given port number */
+ mode = ACTIVE;
+#ifdef ENABLE_IPV6
+ if(!use_ipv6) {
+#endif
+ memset(&me.sa4, 0, sizeof(me.sa4));
+ me.sa4.sin_family = AF_INET;
+ me.sa4.sin_port = htons(connectport);
+ me.sa4.sin_addr.s_addr = INADDR_ANY;
+ if (!addr)
+ addr = "127.0.0.1";
+ Curl_inet_pton(AF_INET, addr, &me.sa4.sin_addr);
+
+ rc = connect(sock, &me.sa, sizeof(me.sa4));
+#ifdef ENABLE_IPV6
+ }
+ else {
+ memset(&me.sa6, 0, sizeof(me.sa6));
+ me.sa6.sin6_family = AF_INET6;
+ me.sa6.sin6_port = htons(connectport);
+ if (!addr)
+ addr = "::1";
+ Curl_inet_pton(AF_INET6, addr, &me.sa6.sin6_addr);
+
+ rc = connect(sock, &me.sa, sizeof(me.sa6));
+ }
+#endif /* ENABLE_IPV6 */
+ if(rc) {
+ error = SOCKERRNO;
+ logmsg("Error connecting to port %hu: (%d) %s",
+ connectport, error, strerror(error));
+ goto sockfilt_cleanup;
+ }
+ logmsg("====> Client connect");
+ msgsock = sock; /* use this as stream */
+ }
+ else {
+ /* passive daemon style */
+ sock = sockdaemon(sock, &port);
+ if(CURL_SOCKET_BAD == sock)
+ goto sockfilt_cleanup;
+ msgsock = CURL_SOCKET_BAD; /* no stream socket yet */
+ }
+
+ logmsg("Running %s version", ipv_inuse);
+
+ if(connectport)
+ logmsg("Connected to port %hu", connectport);
+ else
+ logmsg("Listening on port %hu", port);
+
+ wrotepidfile = write_pidfile(pidname);
+ if(!wrotepidfile)
+ goto sockfilt_cleanup;
+
+ do {
+ juggle_again = juggle(&msgsock, sock, &mode);
+ } while(juggle_again);
+
+sockfilt_cleanup:
+
+ if((msgsock != sock) && (msgsock != CURL_SOCKET_BAD))
+ sclose(msgsock);
+
+ if(sock != CURL_SOCKET_BAD)
+ sclose(sock);
+
+ if(wrotepidfile)
+ unlink(pidname);
+
+ restore_signal_handlers();
+
+ if(got_exit_signal) {
+ logmsg("============> sockfilt exits with signal (%d)", exit_signal);
+ /*
+ * To properly set the return status of the process we
+ * must raise the same signal SIGINT or SIGTERM that we
+ * caught and let the old handler take care of it.
+ */
+ raise(exit_signal);
+ }
+
+ logmsg("============> sockfilt quits");
+ return 0;
+}
+
diff --git a/tests/server/sws.c b/tests/server/sws.c
new file mode 100644
index 000000000..949831d6c
--- /dev/null
+++ b/tests/server/sws.c
@@ -0,0 +1,1456 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+
+/* sws.c: simple (silly?) web server
+
+ This code was originally graciously donated to the project by Juergen
+ Wilke. Thanks a bunch!
+
+ */
+
+#define CURL_NO_OLDIES
+
+#include "setup.h" /* portability help from the lib directory */
+
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_NETINET_TCP_H
+#include <netinet/tcp.h> /* for TCP_NODELAY */
+#endif
+
+#define ENABLE_CURLX_PRINTF
+/* make the curlx header define all printf() functions to use the curlx_*
+ versions instead */
+#include "curlx.h" /* from the private lib dir */
+#include "getpart.h"
+#include "util.h"
+#include "server_sockaddr.h"
+
+/* include memdebug.h last */
+#include "memdebug.h"
+
+#if !defined(CURL_SWS_FORK_ENABLED) && defined(HAVE_FORK)
+/*
+ * The normal sws build for the plain standard curl test suite has no use for
+ * fork(), but if you feel wild and crazy and want to setup some more exotic
+ * tests. Define this and run...
+ */
+#define CURL_SWS_FORK_ENABLED
+#endif
+
+#ifdef ENABLE_IPV6
+static bool use_ipv6 = FALSE;
+#endif
+static bool use_gopher = FALSE;
+static const char *ipv_inuse = "IPv4";
+static int serverlogslocked = 0;
+
+#define REQBUFSIZ 150000
+#define REQBUFSIZ_TXT "149999"
+
+static long prevtestno=-1; /* previous test number we served */
+static long prevpartno=-1; /* previous part number we served */
+static bool prevbounce=FALSE; /* instructs the server to increase the part
+ number for a test in case the identical
+ testno+partno request shows up again */
+
+#define RCMD_NORMALREQ 0 /* default request, use the tests file normally */
+#define RCMD_IDLE 1 /* told to sit idle */
+#define RCMD_STREAM 2 /* told to stream */
+
+struct httprequest {
+ char reqbuf[REQBUFSIZ]; /* buffer area for the incoming request */
+ size_t checkindex; /* where to start checking of the request */
+ size_t offset; /* size of the incoming request */
+ long testno; /* test number found in the request */
+ long partno; /* part number found in the request */
+ bool open; /* keep connection open info, as found in the request */
+ bool auth_req; /* authentication required, don't wait for body unless
+ there's an Authorization header */
+ bool auth; /* Authorization header present in the incoming request */
+ size_t cl; /* Content-Length of the incoming request */
+ bool digest; /* Authorization digest header found */
+ bool ntlm; /* Authorization ntlm header found */
+ int writedelay; /* if non-zero, delay this number of seconds between
+ writes in the response */
+ int pipe; /* if non-zero, expect this many requests to do a "piped"
+ request/response */
+ int skip; /* if non-zero, the server is instructed to not read this
+ many bytes from a PUT/POST request. Ie the client sends N
+ bytes said in Content-Length, but the server only reads N
+ - skip bytes. */
+ int rcmd; /* doing a special command, see defines above */
+ int prot_version; /* HTTP version * 10 */
+ bool pipelining; /* true if request is pipelined */
+};
+
+static int ProcessRequest(struct httprequest *req);
+static void storerequest(char *reqbuf, size_t totalsize);
+
+#define DEFAULT_PORT 8999
+
+#ifndef DEFAULT_LOGFILE
+#define DEFAULT_LOGFILE "log/sws.log"
+#endif
+
+const char *serverlogfile = DEFAULT_LOGFILE;
+
+#define SWSVERSION "cURL test suite HTTP server/0.1"
+
+#define REQUEST_DUMP "log/server.input"
+#define RESPONSE_DUMP "log/server.response"
+
+/* very-big-path support */
+#define MAXDOCNAMELEN 140000
+#define MAXDOCNAMELEN_TXT "139999"
+
+#define REQUEST_KEYWORD_SIZE 256
+#define REQUEST_KEYWORD_SIZE_TXT "255"
+
+#define CMD_AUTH_REQUIRED "auth_required"
+
+/* 'idle' means that it will accept the request fine but never respond
+ any data. Just keep the connection alive. */
+#define CMD_IDLE "idle"
+
+/* 'stream' means to send a never-ending stream of data */
+#define CMD_STREAM "stream"
+
+#define END_OF_HEADERS "\r\n\r\n"
+
+enum {
+ DOCNUMBER_NOTHING = -7,
+ DOCNUMBER_QUIT = -6,
+ DOCNUMBER_BADCONNECT = -5,
+ DOCNUMBER_INTERNAL= -4,
+ DOCNUMBER_CONNECT = -3,
+ DOCNUMBER_WERULEZ = -2,
+ DOCNUMBER_404 = -1
+};
+
+static const char *end_of_headers = END_OF_HEADERS;
+
+/* sent as reply to a QUIT */
+static const char *docquit =
+"HTTP/1.1 200 Goodbye" END_OF_HEADERS;
+
+/* sent as reply to a CONNECT */
+static const char *docconnect =
+"HTTP/1.1 200 Mighty fine indeed" END_OF_HEADERS;
+
+/* sent as reply to a "bad" CONNECT */
+static const char *docbadconnect =
+"HTTP/1.1 501 Forbidden you fool" END_OF_HEADERS;
+
+/* send back this on 404 file not found */
+static const char *doc404 = "HTTP/1.1 404 Not Found\r\n"
+ "Server: " SWSVERSION "\r\n"
+ "Connection: close\r\n"
+ "Content-Type: text/html"
+ END_OF_HEADERS
+ "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n"
+ "<HTML><HEAD>\n"
+ "<TITLE>404 Not Found</TITLE>\n"
+ "</HEAD><BODY>\n"
+ "<H1>Not Found</H1>\n"
+ "The requested URL was not found on this server.\n"
+ "<P><HR><ADDRESS>" SWSVERSION "</ADDRESS>\n" "</BODY></HTML>\n";
+
+/* do-nothing macro replacement for systems which lack siginterrupt() */
+
+#ifndef HAVE_SIGINTERRUPT
+#define siginterrupt(x,y) do {} while(0)
+#endif
+
+/* vars used to keep around previous signal handlers */
+
+typedef RETSIGTYPE (*SIGHANDLER_T)(int);
+
+#ifdef SIGHUP
+static SIGHANDLER_T old_sighup_handler = SIG_ERR;
+#endif
+
+#ifdef SIGPIPE
+static SIGHANDLER_T old_sigpipe_handler = SIG_ERR;
+#endif
+
+#ifdef SIGALRM
+static SIGHANDLER_T old_sigalrm_handler = SIG_ERR;
+#endif
+
+#ifdef SIGINT
+static SIGHANDLER_T old_sigint_handler = SIG_ERR;
+#endif
+
+#ifdef SIGTERM
+static SIGHANDLER_T old_sigterm_handler = SIG_ERR;
+#endif
+
+/* var which if set indicates that the program should finish execution */
+
+SIG_ATOMIC_T got_exit_signal = 0;
+
+/* if next is set indicates the first signal handled in exit_signal_handler */
+
+static volatile int exit_signal = 0;
+
+/* signal handler that will be triggered to indicate that the program
+ should finish its execution in a controlled manner as soon as possible.
+ The first time this is called it will set got_exit_signal to one and
+ store in exit_signal the signal that triggered its execution. */
+
+static RETSIGTYPE exit_signal_handler(int signum)
+{
+ int old_errno = ERRNO;
+ if(got_exit_signal == 0) {
+ got_exit_signal = 1;
+ exit_signal = signum;
+ }
+ (void)signal(signum, exit_signal_handler);
+ SET_ERRNO(old_errno);
+}
+
+static void install_signal_handlers(void)
+{
+#ifdef SIGHUP
+ /* ignore SIGHUP signal */
+ if((old_sighup_handler = signal(SIGHUP, SIG_IGN)) == SIG_ERR)
+ logmsg("cannot install SIGHUP handler: %s", strerror(ERRNO));
+#endif
+#ifdef SIGPIPE
+ /* ignore SIGPIPE signal */
+ if((old_sigpipe_handler = signal(SIGPIPE, SIG_IGN)) == SIG_ERR)
+ logmsg("cannot install SIGPIPE handler: %s", strerror(ERRNO));
+#endif
+#ifdef SIGALRM
+ /* ignore SIGALRM signal */
+ if((old_sigalrm_handler = signal(SIGALRM, SIG_IGN)) == SIG_ERR)
+ logmsg("cannot install SIGALRM handler: %s", strerror(ERRNO));
+#endif
+#ifdef SIGINT
+ /* handle SIGINT signal with our exit_signal_handler */
+ if((old_sigint_handler = signal(SIGINT, exit_signal_handler)) == SIG_ERR)
+ logmsg("cannot install SIGINT handler: %s", strerror(ERRNO));
+ else
+ siginterrupt(SIGINT, 1);
+#endif
+#ifdef SIGTERM
+ /* handle SIGTERM signal with our exit_signal_handler */
+ if((old_sigterm_handler = signal(SIGTERM, exit_signal_handler)) == SIG_ERR)
+ logmsg("cannot install SIGTERM handler: %s", strerror(ERRNO));
+ else
+ siginterrupt(SIGTERM, 1);
+#endif
+}
+
+static void restore_signal_handlers(void)
+{
+#ifdef SIGHUP
+ if(SIG_ERR != old_sighup_handler)
+ (void)signal(SIGHUP, old_sighup_handler);
+#endif
+#ifdef SIGPIPE
+ if(SIG_ERR != old_sigpipe_handler)
+ (void)signal(SIGPIPE, old_sigpipe_handler);
+#endif
+#ifdef SIGALRM
+ if(SIG_ERR != old_sigalrm_handler)
+ (void)signal(SIGALRM, old_sigalrm_handler);
+#endif
+#ifdef SIGINT
+ if(SIG_ERR != old_sigint_handler)
+ (void)signal(SIGINT, old_sigint_handler);
+#endif
+#ifdef SIGTERM
+ if(SIG_ERR != old_sigterm_handler)
+ (void)signal(SIGTERM, old_sigterm_handler);
+#endif
+}
+
+static int ProcessRequest(struct httprequest *req)
+{
+ char *line=&req->reqbuf[req->checkindex];
+ bool chunked = FALSE;
+ static char request[REQUEST_KEYWORD_SIZE];
+ static char doc[MAXDOCNAMELEN];
+ char logbuf[256];
+ int prot_major, prot_minor;
+ char *end;
+ int error;
+ end = strstr(line, end_of_headers);
+
+ logmsg("ProcessRequest() called");
+
+ /* try to figure out the request characteristics as soon as possible, but
+ only once! */
+
+ if(use_gopher &&
+ (req->testno == DOCNUMBER_NOTHING) &&
+ !strncmp("/verifiedserver", line, 15)) {
+ logmsg("Are-we-friendly question received");
+ req->testno = DOCNUMBER_WERULEZ;
+ return 1; /* done */
+ }
+
+ else if((req->testno == DOCNUMBER_NOTHING) &&
+ sscanf(line,
+ "%" REQUEST_KEYWORD_SIZE_TXT"s %" MAXDOCNAMELEN_TXT "s HTTP/%d.%d",
+ request,
+ doc,
+ &prot_major,
+ &prot_minor) == 4) {
+ char *ptr;
+
+ req->prot_version = prot_major*10 + prot_minor;
+
+ /* find the last slash */
+ ptr = strrchr(doc, '/');
+
+ /* get the number after it */
+ if(ptr) {
+ FILE *stream;
+ char *filename;
+
+ if((strlen(doc) + strlen(request)) < 200)
+ sprintf(logbuf, "Got request: %s %s HTTP/%d.%d",
+ request, doc, prot_major, prot_minor);
+ else
+ sprintf(logbuf, "Got a *HUGE* request HTTP/%d.%d",
+ prot_major, prot_minor);
+ logmsg("%s", logbuf);
+
+ if(!strncmp("/verifiedserver", ptr, 15)) {
+ logmsg("Are-we-friendly question received");
+ req->testno = DOCNUMBER_WERULEZ;
+ return 1; /* done */
+ }
+
+ if(!strncmp("/quit", ptr, 5)) {
+ logmsg("Request-to-quit received");
+ req->testno = DOCNUMBER_QUIT;
+ return 1; /* done */
+ }
+
+ ptr++; /* skip the slash */
+
+ /* skip all non-numericals following the slash */
+ while(*ptr && !ISDIGIT(*ptr))
+ ptr++;
+
+ req->testno = strtol(ptr, &ptr, 10);
+
+ if(req->testno > 10000) {
+ req->partno = req->testno % 10000;
+ req->testno /= 10000;
+ }
+ else
+ req->partno = 0;
+
+ sprintf(logbuf, "Requested test number %ld part %ld",
+ req->testno, req->partno);
+ logmsg("%s", logbuf);
+
+ filename = test2file(req->testno);
+
+ stream=fopen(filename, "rb");
+ if(!stream) {
+ error = ERRNO;
+ logmsg("fopen() failed with error: %d %s", error, strerror(error));
+ logmsg("Error opening file: %s", filename);
+ logmsg("Couldn't open test file %ld", req->testno);
+ req->open = FALSE; /* closes connection */
+ return 1; /* done */
+ }
+ else {
+ char *cmd = NULL;
+ size_t cmdsize = 0;
+ int num=0;
+
+ /* get the custom server control "commands" */
+ error = getpart(&cmd, &cmdsize, "reply", "servercmd", stream);
+ fclose(stream);
+ if(error) {
+ logmsg("getpart() failed with error: %d", error);
+ req->open = FALSE; /* closes connection */
+ return 1; /* done */
+ }
+
+ if(cmdsize) {
+ logmsg("Found a reply-servercmd section!");
+
+ if(!strncmp(CMD_AUTH_REQUIRED, cmd, strlen(CMD_AUTH_REQUIRED))) {
+ logmsg("instructed to require authorization header");
+ req->auth_req = TRUE;
+ }
+ else if(!strncmp(CMD_IDLE, cmd, strlen(CMD_IDLE))) {
+ logmsg("instructed to idle");
+ req->rcmd = RCMD_IDLE;
+ req->open = TRUE;
+ }
+ else if(!strncmp(CMD_STREAM, cmd, strlen(CMD_STREAM))) {
+ logmsg("instructed to stream");
+ req->rcmd = RCMD_STREAM;
+ }
+ else if(1 == sscanf(cmd, "pipe: %d", &num)) {
+ logmsg("instructed to allow a pipe size of %d", num);
+ if(num < 0)
+ logmsg("negative pipe size ignored");
+ else if(num > 0)
+ req->pipe = num-1; /* decrease by one since we don't count the
+ first request in this number */
+ }
+ else if(1 == sscanf(cmd, "skip: %d", &num)) {
+ logmsg("instructed to skip this number of bytes %d", num);
+ req->skip = num;
+ }
+ else if(1 == sscanf(cmd, "writedelay: %d", &num)) {
+ logmsg("instructed to delay %d secs between packets", num);
+ req->writedelay = num;
+ }
+ else {
+ logmsg("funny instruction found: %s", cmd);
+ }
+ }
+ if(cmd)
+ free(cmd);
+ }
+ }
+ else {
+ if(sscanf(req->reqbuf, "CONNECT %" MAXDOCNAMELEN_TXT "s HTTP/%d.%d",
+ doc, &prot_major, &prot_minor) == 3) {
+ sprintf(logbuf, "Received a CONNECT %s HTTP/%d.%d request",
+ doc, prot_major, prot_minor);
+ logmsg("%s", logbuf);
+
+ if(req->prot_version == 10)
+ req->open = FALSE; /* HTTP 1.0 closes connection by default */
+
+ if(!strncmp(doc, "bad", 3))
+ /* if the host name starts with bad, we fake an error here */
+ req->testno = DOCNUMBER_BADCONNECT;
+ else if(!strncmp(doc, "test", 4)) {
+ /* if the host name starts with test, the port number used in the
+ CONNECT line will be used as test number! */
+ char *portp = strchr(doc, ':');
+ if(portp && (*(portp+1) != '\0') && ISDIGIT(*(portp+1)))
+ req->testno = strtol(portp+1, NULL, 10);
+ else
+ req->testno = DOCNUMBER_CONNECT;
+ }
+ else
+ req->testno = DOCNUMBER_CONNECT;
+ }
+ else {
+ logmsg("Did not find test number in PATH");
+ req->testno = DOCNUMBER_404;
+ }
+ }
+ }
+
+ if(!end) {
+ /* we don't have a complete request yet! */
+ logmsg("ProcessRequest returned without a complete request");
+ return 0; /* not complete yet */
+ }
+ logmsg("ProcessRequest found a complete request");
+
+ if(use_gopher) {
+ /* when using gopher we cannot check the request until the entire
+ thing has been received */
+ char *ptr;
+
+ /* find the last slash in the line */
+ ptr = strrchr(line, '/');
+
+ if(ptr) {
+ ptr++; /* skip the slash */
+
+ /* skip all non-numericals following the slash */
+ while(*ptr && !ISDIGIT(*ptr))
+ ptr++;
+
+ req->testno = strtol(ptr, &ptr, 10);
+
+ if(req->testno > 10000) {
+ req->partno = req->testno % 10000;
+ req->testno /= 10000;
+ }
+ else
+ req->partno = 0;
+
+ sprintf(logbuf, "Requested GOPHER test number %ld part %ld",
+ req->testno, req->partno);
+ logmsg("%s", logbuf);
+ }
+ }
+
+ if(req->pipe)
+ /* we do have a full set, advance the checkindex to after the end of the
+ headers, for the pipelining case mostly */
+ req->checkindex += (end - line) + strlen(end_of_headers);
+
+ /* **** Persistence ****
+ *
+ * If the request is a HTTP/1.0 one, we close the connection unconditionally
+ * when we're done.
+ *
+ * If the request is a HTTP/1.1 one, we MUST check for a "Connection:"
+ * header that might say "close". If it does, we close a connection when
+ * this request is processed. Otherwise, we keep the connection alive for X
+ * seconds.
+ */
+
+ do {
+ if(got_exit_signal)
+ return 1; /* done */
+
+ if((req->cl==0) && curlx_strnequal("Content-Length:", line, 15)) {
+ /* If we don't ignore content-length, we read it and we read the whole
+ request including the body before we return. If we've been told to
+ ignore the content-length, we will return as soon as all headers
+ have been received */
+ char *endptr;
+ char *ptr = line + 15;
+ unsigned long clen = 0;
+ while(*ptr && ISSPACE(*ptr))
+ ptr++;
+ endptr = ptr;
+ SET_ERRNO(0);
+ clen = strtoul(ptr, &endptr, 10);
+ if((ptr == endptr) || !ISSPACE(*endptr) || (ERANGE == ERRNO)) {
+ /* this assumes that a zero Content-Length is valid */
+ logmsg("Found invalid Content-Length: (%s) in the request", ptr);
+ req->open = FALSE; /* closes connection */
+ return 1; /* done */
+ }
+ req->cl = clen - req->skip;
+
+ logmsg("Found Content-Length: %lu in the request", clen);
+ if(req->skip)
+ logmsg("... but will abort after %zu bytes", req->cl);
+ break;
+ }
+ else if(curlx_strnequal("Transfer-Encoding: chunked", line,
+ strlen("Transfer-Encoding: chunked"))) {
+ /* chunked data coming in */
+ chunked = TRUE;
+ }
+
+ if(chunked) {
+ if(strstr(req->reqbuf, "\r\n0\r\n\r\n"))
+ /* end of chunks reached */
+ return 1; /* done */
+ else
+ return 0; /* not done */
+ }
+
+ line = strchr(line, '\n');
+ if(line)
+ line++;
+
+ } while(line);
+
+ if(!req->auth && strstr(req->reqbuf, "Authorization:")) {
+ req->auth = TRUE; /* Authorization: header present! */
+ if(req->auth_req)
+ logmsg("Authorization header found, as required");
+ }
+
+ if(!req->digest && strstr(req->reqbuf, "Authorization: Digest")) {
+ /* If the client is passing this Digest-header, we set the part number
+ to 1000. Not only to spice up the complexity of this, but to make
+ Digest stuff to work in the test suite. */
+ req->partno += 1000;
+ req->digest = TRUE; /* header found */
+ logmsg("Received Digest request, sending back data %ld", req->partno);
+ }
+ else if(!req->ntlm &&
+ strstr(req->reqbuf, "Authorization: NTLM TlRMTVNTUAAD")) {
+ /* If the client is passing this type-3 NTLM header */
+ req->partno += 1002;
+ req->ntlm = TRUE; /* NTLM found */
+ logmsg("Received NTLM type-3, sending back data %ld", req->partno);
+ if(req->cl) {
+ logmsg(" Expecting %zu POSTed bytes", req->cl);
+ }
+ }
+ else if(!req->ntlm &&
+ strstr(req->reqbuf, "Authorization: NTLM TlRMTVNTUAAB")) {
+ /* If the client is passing this type-1 NTLM header */
+ req->partno += 1001;
+ req->ntlm = TRUE; /* NTLM found */
+ logmsg("Received NTLM type-1, sending back data %ld", req->partno);
+ }
+ else if((req->partno >= 1000) && strstr(req->reqbuf, "Authorization: Basic")) {
+ /* If the client is passing this Basic-header and the part number is already
+ >=1000, we add 1 to the part number. This allows simple Basic authentication
+ negotiation to work in the test suite. */
+ req->partno += 1;
+ logmsg("Received Basic request, sending back data %ld", req->partno);
+ }
+ if(strstr(req->reqbuf, "Connection: close"))
+ req->open = FALSE; /* close connection after this request */
+
+ if(!req->pipe &&
+ req->open &&
+ req->prot_version >= 11 &&
+ end &&
+ req->reqbuf + req->offset > end + strlen(end_of_headers) &&
+ (!strncmp(req->reqbuf, "GET", strlen("GET")) ||
+ !strncmp(req->reqbuf, "HEAD", strlen("HEAD")))) {
+ /* If we have a persistent connection, HTTP version >= 1.1
+ and GET/HEAD request, enable pipelining. */
+ req->checkindex = (end - req->reqbuf) + strlen(end_of_headers);
+ req->pipelining = TRUE;
+ }
+
+ while(req->pipe) {
+ if(got_exit_signal)
+ return 1; /* done */
+ /* scan for more header ends within this chunk */
+ line = &req->reqbuf[req->checkindex];
+ end = strstr(line, end_of_headers);
+ if(!end)
+ break;
+ req->checkindex += (end - line) + strlen(end_of_headers);
+ req->pipe--;
+ }
+
+ /* If authentication is required and no auth was provided, end now. This
+ makes the server NOT wait for PUT/POST data and you can then make the
+ test case send a rejection before any such data has been sent. Test case
+ 154 uses this.*/
+ if(req->auth_req && !req->auth)
+ return 1; /* done */
+
+ if(req->cl > 0) {
+ if(req->cl <= req->offset - (end - req->reqbuf) - strlen(end_of_headers))
+ return 1; /* done */
+ else
+ return 0; /* not complete yet */
+ }
+
+ return 1; /* done */
+}
+
+/* store the entire request in a file */
+static void storerequest(char *reqbuf, size_t totalsize)
+{
+ int res;
+ int error = 0;
+ size_t written;
+ size_t writeleft;
+ FILE *dump;
+
+ if (reqbuf == NULL)
+ return;
+ if (totalsize == 0)
+ return;
+
+ do {
+ dump = fopen(REQUEST_DUMP, "ab");
+ } while ((dump == NULL) && ((error = ERRNO) == EINTR));
+ if (dump == NULL) {
+ logmsg("Error opening file %s error: %d %s",
+ REQUEST_DUMP, error, strerror(error));
+ logmsg("Failed to write request input to " REQUEST_DUMP);
+ return;
+ }
+
+ writeleft = totalsize;
+ do {
+ written = fwrite(&reqbuf[totalsize-writeleft],
+ 1, writeleft, dump);
+ if(got_exit_signal)
+ goto storerequest_cleanup;
+ if(written > 0)
+ writeleft -= written;
+ } while ((writeleft > 0) && ((error = ERRNO) == EINTR));
+
+ if(writeleft == 0)
+ logmsg("Wrote request (%zu bytes) input to " REQUEST_DUMP, totalsize);
+ else if(writeleft > 0) {
+ logmsg("Error writing file %s error: %d %s",
+ REQUEST_DUMP, error, strerror(error));
+ logmsg("Wrote only (%zu bytes) of (%zu bytes) request input to %s",
+ totalsize-writeleft, totalsize, REQUEST_DUMP);
+ }
+
+storerequest_cleanup:
+
+ do {
+ res = fclose(dump);
+ } while(res && ((error = ERRNO) == EINTR));
+ if(res)
+ logmsg("Error closing file %s error: %d %s",
+ REQUEST_DUMP, error, strerror(error));
+}
+
+/* return 0 on success, non-zero on failure */
+static int get_request(curl_socket_t sock, struct httprequest *req)
+{
+ int error;
+ int fail = 0;
+ int done_processing = 0;
+ char *reqbuf = req->reqbuf;
+ ssize_t got = 0;
+
+ char *pipereq = NULL;
+ size_t pipereq_length = 0;
+
+ if(req->pipelining) {
+ pipereq = reqbuf + req->checkindex;
+ pipereq_length = req->offset - req->checkindex;
+ }
+
+ /*** Init the httprequest structure properly for the upcoming request ***/
+
+ req->checkindex = 0;
+ req->offset = 0;
+ req->testno = DOCNUMBER_NOTHING;
+ req->partno = 0;
+ req->open = TRUE;
+ req->auth_req = FALSE;
+ req->auth = FALSE;
+ req->cl = 0;
+ req->digest = FALSE;
+ req->ntlm = FALSE;
+ req->pipe = 0;
+ req->skip = 0;
+ req->writedelay = 0;
+ req->rcmd = RCMD_NORMALREQ;
+ req->prot_version = 0;
+ req->pipelining = FALSE;
+
+ /*** end of httprequest init ***/
+
+ while(!done_processing && (req->offset < REQBUFSIZ-1)) {
+ if(pipereq_length && pipereq) {
+ memmove(reqbuf, pipereq, pipereq_length);
+ got = curlx_uztosz(pipereq_length);
+ pipereq_length = 0;
+ }
+ else {
+ if(req->skip)
+ /* we are instructed to not read the entire thing, so we make sure to only
+ read what we're supposed to and NOT read the enire thing the client
+ wants to send! */
+ got = sread(sock, reqbuf + req->offset, req->cl);
+ else
+ got = sread(sock, reqbuf + req->offset, REQBUFSIZ-1 - req->offset);
+ }
+ if(got_exit_signal)
+ return 1;
+ if(got == 0) {
+ logmsg("Connection closed by client");
+ fail = 1;
+ }
+ else if(got < 0) {
+ error = SOCKERRNO;
+ logmsg("recv() returned error: (%d) %s", error, strerror(error));
+ fail = 1;
+ }
+ if(fail) {
+ /* dump the request received so far to the external file */
+ reqbuf[req->offset] = '\0';
+ storerequest(reqbuf, req->offset);
+ return 1;
+ }
+
+ logmsg("Read %zd bytes", got);
+
+ req->offset += (size_t)got;
+ reqbuf[req->offset] = '\0';
+
+ done_processing = ProcessRequest(req);
+ if(got_exit_signal)
+ return 1;
+ if(done_processing && req->pipe) {
+ logmsg("Waiting for another piped request");
+ done_processing = 0;
+ req->pipe--;
+ }
+ }
+
+ if((req->offset == REQBUFSIZ-1) && (got > 0)) {
+ logmsg("Request would overflow buffer, closing connection");
+ /* dump request received so far to external file anyway */
+ reqbuf[REQBUFSIZ-1] = '\0';
+ fail = 1;
+ }
+ else if(req->offset > REQBUFSIZ-1) {
+ logmsg("Request buffer overflow, closing connection");
+ /* dump request received so far to external file anyway */
+ reqbuf[REQBUFSIZ-1] = '\0';
+ fail = 1;
+ }
+ else
+ reqbuf[req->offset] = '\0';
+
+ /* dump the request to an external file */
+ storerequest(reqbuf, req->pipelining ? req->checkindex : req->offset);
+ if(got_exit_signal)
+ return 1;
+
+ return fail; /* return 0 on success */
+}
+
+/* returns -1 on failure */
+static int send_doc(curl_socket_t sock, struct httprequest *req)
+{
+ ssize_t written;
+ size_t count;
+ const char *buffer;
+ char *ptr=NULL;
+ FILE *stream;
+ char *cmd=NULL;
+ size_t cmdsize=0;
+ FILE *dump;
+ bool persistant = TRUE;
+ bool sendfailure = FALSE;
+ size_t responsesize;
+ int error = 0;
+ int res;
+
+ static char weare[256];
+
+ char partbuf[80]="data";
+
+ logmsg("Send response number %ld part %ld", req->testno, req->partno);
+
+ switch(req->rcmd) {
+ default:
+ case RCMD_NORMALREQ:
+ break; /* continue with business as usual */
+ case RCMD_STREAM:
+#define STREAMTHIS "a string to stream 01234567890\n"
+ count = strlen(STREAMTHIS);
+ for (;;) {
+ written = swrite(sock, STREAMTHIS, count);
+ if(got_exit_signal)
+ return -1;
+ if(written != (ssize_t)count) {
+ logmsg("Stopped streaming");
+ break;
+ }
+ }
+ return -1;
+ case RCMD_IDLE:
+ /* Do nothing. Sit idle. Pretend it rains. */
+ return 0;
+ }
+
+ req->open = FALSE;
+
+ if(req->testno < 0) {
+ size_t msglen;
+ char msgbuf[64];
+
+ switch(req->testno) {
+ case DOCNUMBER_QUIT:
+ logmsg("Replying to QUIT");
+ buffer = docquit;
+ break;
+ case DOCNUMBER_WERULEZ:
+ /* we got a "friends?" question, reply back that we sure are */
+ logmsg("Identifying ourselves as friends");
+ sprintf(msgbuf, "WE ROOLZ: %ld\r\n", (long)getpid());
+ msglen = strlen(msgbuf);
+ if(use_gopher)
+ sprintf(weare, "%s", msgbuf);
+ else
+ sprintf(weare, "HTTP/1.1 200 OK\r\nContent-Length: %zu\r\n\r\n%s",
+ msglen, msgbuf);
+ buffer = weare;
+ break;
+ case DOCNUMBER_INTERNAL:
+ logmsg("Bailing out due to internal error");
+ return -1;
+ case DOCNUMBER_CONNECT:
+ logmsg("Replying to CONNECT");
+ buffer = docconnect;
+ break;
+ case DOCNUMBER_BADCONNECT:
+ logmsg("Replying to a bad CONNECT");
+ buffer = docbadconnect;
+ break;
+ case DOCNUMBER_404:
+ default:
+ logmsg("Replying to with a 404");
+ buffer = doc404;
+ break;
+ }
+
+ count = strlen(buffer);
+ }
+ else {
+ char *filename = test2file(req->testno);
+
+ if(0 != req->partno)
+ sprintf(partbuf, "data%ld", req->partno);
+
+ stream=fopen(filename, "rb");
+ if(!stream) {
+ error = ERRNO;
+ logmsg("fopen() failed with error: %d %s", error, strerror(error));
+ logmsg("Error opening file: %s", filename);
+ logmsg("Couldn't open test file");
+ return 0;
+ }
+ else {
+ error = getpart(&ptr, &count, "reply", partbuf, stream);
+ fclose(stream);
+ if(error) {
+ logmsg("getpart() failed with error: %d", error);
+ return 0;
+ }
+ buffer = ptr;
+ }
+
+ if(got_exit_signal) {
+ if(ptr)
+ free(ptr);
+ return -1;
+ }
+
+ /* re-open the same file again */
+ stream=fopen(filename, "rb");
+ if(!stream) {
+ error = ERRNO;
+ logmsg("fopen() failed with error: %d %s", error, strerror(error));
+ logmsg("Error opening file: %s", filename);
+ logmsg("Couldn't open test file");
+ if(ptr)
+ free(ptr);
+ return 0;
+ }
+ else {
+ /* get the custom server control "commands" */
+ error = getpart(&cmd, &cmdsize, "reply", "postcmd", stream);
+ fclose(stream);
+ if(error) {
+ logmsg("getpart() failed with error: %d", error);
+ if(ptr)
+ free(ptr);
+ return 0;
+ }
+ }
+ }
+
+ if(got_exit_signal) {
+ if(ptr)
+ free(ptr);
+ if(cmd)
+ free(cmd);
+ return -1;
+ }
+
+ /* If the word 'swsclose' is present anywhere in the reply chunk, the
+ connection will be closed after the data has been sent to the requesting
+ client... */
+ if(strstr(buffer, "swsclose") || !count) {
+ persistant = FALSE;
+ logmsg("connection close instruction \"swsclose\" found in response");
+ }
+ if(strstr(buffer, "swsbounce")) {
+ prevbounce = TRUE;
+ logmsg("enable \"swsbounce\" in the next request");
+ }
+ else
+ prevbounce = FALSE;
+
+ dump = fopen(RESPONSE_DUMP, "ab");
+ if(!dump) {
+ error = ERRNO;
+ logmsg("fopen() failed with error: %d %s", error, strerror(error));
+ logmsg("Error opening file: %s", RESPONSE_DUMP);
+ logmsg("couldn't create logfile: " RESPONSE_DUMP);
+ if(ptr)
+ free(ptr);
+ if(cmd)
+ free(cmd);
+ return -1;
+ }
+
+ responsesize = count;
+ do {
+ /* Ok, we send no more than 200 bytes at a time, just to make sure that
+ larger chunks are split up so that the client will need to do multiple
+ recv() calls to get it and thus we exercise that code better */
+ size_t num = count;
+ if(num > 200)
+ num = 200;
+ written = swrite(sock, buffer, num);
+ if (written < 0) {
+ sendfailure = TRUE;
+ break;
+ }
+ else {
+ logmsg("Sent off %zd bytes", written);
+ }
+ if (req->writedelay) {
+ logmsg("Pausing %d seconds", req->writedelay);
+ sleep(req->writedelay);
+ }
+ /* write to file as well */
+ fwrite(buffer, 1, (size_t)written, dump);
+ if(got_exit_signal)
+ break;
+
+ count -= written;
+ buffer += written;
+ } while(count>0);
+
+ do {
+ res = fclose(dump);
+ } while(res && ((error = ERRNO) == EINTR));
+ if(res)
+ logmsg("Error closing file %s error: %d %s",
+ RESPONSE_DUMP, error, strerror(error));
+
+ if(got_exit_signal) {
+ if(ptr)
+ free(ptr);
+ if(cmd)
+ free(cmd);
+ return -1;
+ }
+
+ if(sendfailure) {
+ logmsg("Sending response failed. Only (%zu bytes) of (%zu bytes) were sent",
+ responsesize-count, responsesize);
+ if(ptr)
+ free(ptr);
+ if(cmd)
+ free(cmd);
+ return -1;
+ }
+
+ logmsg("Response sent (%zu bytes) and written to " RESPONSE_DUMP,
+ responsesize);
+
+ if(ptr)
+ free(ptr);
+
+ if(cmdsize > 0 ) {
+ char command[32];
+ int quarters;
+ int num;
+ ptr=cmd;
+ do {
+ if(2 == sscanf(ptr, "%31s %d", command, &num)) {
+ if(!strcmp("wait", command)) {
+ logmsg("Told to sleep for %d seconds", num);
+ quarters = num * 4;
+ while(quarters > 0) {
+ quarters--;
+ res = wait_ms(250);
+ if(got_exit_signal)
+ break;
+ if(res) {
+ /* should not happen */
+ error = SOCKERRNO;
+ logmsg("wait_ms() failed with error: (%d) %s",
+ error, strerror(error));
+ break;
+ }
+ }
+ if(!quarters)
+ logmsg("Continuing after sleeping %d seconds", num);
+ }
+ else
+ logmsg("Unknown command in reply command section");
+ }
+ ptr = strchr(ptr, '\n');
+ if(ptr)
+ ptr++;
+ else
+ ptr = NULL;
+ } while(ptr && *ptr);
+ }
+ if(cmd)
+ free(cmd);
+
+ req->open = use_gopher?FALSE:persistant;
+
+ prevtestno = req->testno;
+ prevpartno = req->partno;
+
+ return 0;
+}
+
+
+int main(int argc, char *argv[])
+{
+ srvr_sockaddr_union_t me;
+ curl_socket_t sock = CURL_SOCKET_BAD;
+ curl_socket_t msgsock = CURL_SOCKET_BAD;
+ int wrotepidfile = 0;
+ int flag;
+ unsigned short port = DEFAULT_PORT;
+ char *pidname= (char *)".http.pid";
+ struct httprequest req;
+ int rc;
+ int error;
+ int arg=1;
+ long pid;
+#ifdef CURL_SWS_FORK_ENABLED
+ bool use_fork = FALSE;
+#endif
+
+ while(argc>arg) {
+ if(!strcmp("--version", argv[arg])) {
+ printf("sws IPv4%s"
+#ifdef CURL_SWS_FORK_ENABLED
+ " FORK"
+#endif
+ "\n"
+ ,
+#ifdef ENABLE_IPV6
+ "/IPv6"
+#else
+ ""
+#endif
+ );
+ return 0;
+ }
+ else if(!strcmp("--pidfile", argv[arg])) {
+ arg++;
+ if(argc>arg)
+ pidname = argv[arg++];
+ }
+ else if(!strcmp("--logfile", argv[arg])) {
+ arg++;
+ if(argc>arg)
+ serverlogfile = argv[arg++];
+ }
+ else if(!strcmp("--gopher", argv[arg])) {
+ arg++;
+ use_gopher = TRUE;
+ end_of_headers = "\r\n"; /* gopher style is much simpler */
+ }
+ else if(!strcmp("--ipv4", argv[arg])) {
+#ifdef ENABLE_IPV6
+ ipv_inuse = "IPv4";
+ use_ipv6 = FALSE;
+#endif
+ arg++;
+ }
+ else if(!strcmp("--ipv6", argv[arg])) {
+#ifdef ENABLE_IPV6
+ ipv_inuse = "IPv6";
+ use_ipv6 = TRUE;
+#endif
+ arg++;
+ }
+#ifdef CURL_SWS_FORK_ENABLED
+ else if(!strcmp("--fork", argv[arg])) {
+ use_fork=TRUE;
+ arg++;
+ }
+#endif
+ else if(!strcmp("--port", argv[arg])) {
+ arg++;
+ if(argc>arg) {
+ char *endptr;
+ unsigned long ulnum = strtoul(argv[arg], &endptr, 10);
+ if((endptr != argv[arg] + strlen(argv[arg])) ||
+ (ulnum < 1025UL) || (ulnum > 65535UL)) {
+ fprintf(stderr, "sws: invalid --port argument (%s)\n",
+ argv[arg]);
+ return 0;
+ }
+ port = curlx_ultous(ulnum);
+ arg++;
+ }
+ }
+ else if(!strcmp("--srcdir", argv[arg])) {
+ arg++;
+ if(argc>arg) {
+ path = argv[arg];
+ arg++;
+ }
+ }
+ else {
+ puts("Usage: sws [option]\n"
+ " --version\n"
+ " --logfile [file]\n"
+ " --pidfile [file]\n"
+ " --ipv4\n"
+ " --ipv6\n"
+ " --port [port]\n"
+ " --srcdir [path]\n"
+ " --gopher\n"
+ " --fork");
+ return 0;
+ }
+ }
+
+#ifdef WIN32
+ win32_init();
+ atexit(win32_cleanup);
+#endif
+
+ install_signal_handlers();
+
+ pid = (long)getpid();
+
+#ifdef ENABLE_IPV6
+ if(!use_ipv6)
+#endif
+ sock = socket(AF_INET, SOCK_STREAM, 0);
+#ifdef ENABLE_IPV6
+ else
+ sock = socket(AF_INET6, SOCK_STREAM, 0);
+#endif
+
+ if(CURL_SOCKET_BAD == sock) {
+ error = SOCKERRNO;
+ logmsg("Error creating socket: (%d) %s",
+ error, strerror(error));
+ goto sws_cleanup;
+ }
+
+ flag = 1;
+ if (0 != setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
+ (void *)&flag, sizeof(flag))) {
+ error = SOCKERRNO;
+ logmsg("setsockopt(SO_REUSEADDR) failed with error: (%d) %s",
+ error, strerror(error));
+ goto sws_cleanup;
+ }
+
+#ifdef ENABLE_IPV6
+ if(!use_ipv6) {
+#endif
+ memset(&me.sa4, 0, sizeof(me.sa4));
+ me.sa4.sin_family = AF_INET;
+ me.sa4.sin_addr.s_addr = INADDR_ANY;
+ me.sa4.sin_port = htons(port);
+ rc = bind(sock, &me.sa, sizeof(me.sa4));
+#ifdef ENABLE_IPV6
+ }
+ else {
+ memset(&me.sa6, 0, sizeof(me.sa6));
+ me.sa6.sin6_family = AF_INET6;
+ me.sa6.sin6_addr = in6addr_any;
+ me.sa6.sin6_port = htons(port);
+ rc = bind(sock, &me.sa, sizeof(me.sa6));
+ }
+#endif /* ENABLE_IPV6 */
+ if(0 != rc) {
+ error = SOCKERRNO;
+ logmsg("Error binding socket on port %hu: (%d) %s",
+ port, error, strerror(error));
+ goto sws_cleanup;
+ }
+
+ logmsg("Running %s %s version on port %d",
+ use_gopher?"GOPHER":"HTTP", ipv_inuse, (int)port);
+
+ /* start accepting connections */
+ rc = listen(sock, 5);
+ if(0 != rc) {
+ error = SOCKERRNO;
+ logmsg("listen() failed with error: (%d) %s",
+ error, strerror(error));
+ goto sws_cleanup;
+ }
+
+ /*
+ ** As soon as this server writes its pid file the test harness will
+ ** attempt to connect to this server and initiate its verification.
+ */
+
+ wrotepidfile = write_pidfile(pidname);
+ if(!wrotepidfile)
+ goto sws_cleanup;
+
+ for (;;) {
+ msgsock = accept(sock, NULL, NULL);
+
+ if(got_exit_signal)
+ break;
+ if (CURL_SOCKET_BAD == msgsock) {
+ error = SOCKERRNO;
+ logmsg("MAJOR ERROR: accept() failed with error: (%d) %s",
+ error, strerror(error));
+ break;
+ }
+
+ /*
+ ** As soon as this server acepts a connection from the test harness it
+ ** must set the server logs advisor read lock to indicate that server
+ ** logs should not be read until this lock is removed by this server.
+ */
+
+ set_advisor_read_lock(SERVERLOGS_LOCK);
+ serverlogslocked = 1;
+
+#ifdef CURL_SWS_FORK_ENABLED
+ if(use_fork) {
+ /* The fork enabled version just forks off the child and don't care
+ about it anymore, so don't assume otherwise. Beware and don't do
+ this at home. */
+ rc = fork();
+ if(-1 == rc) {
+ printf("MAJOR ERROR: fork() failed!\n");
+ break;
+ }
+ }
+ else
+ /* not a fork, just set rc so the following proceeds nicely */
+ rc = 0;
+ /* 0 is returned to the child */
+ if(0 == rc) {
+#endif
+ logmsg("====> Client connect");
+
+#ifdef TCP_NODELAY
+ /*
+ * Disable the Nagle algorithm to make it easier to send out a large
+ * response in many small segments to torture the clients more.
+ */
+ flag = 1;
+ if (setsockopt(msgsock, IPPROTO_TCP, TCP_NODELAY,
+ (void *)&flag, sizeof(flag)) == -1) {
+ logmsg("====> TCP_NODELAY failed");
+ }
+#endif
+
+ /* initialization of httprequest struct is done in get_request(), but due
+ to pipelining treatment the pipelining struct field must be initialized
+ previously to FALSE every time a new connection arrives. */
+
+ req.pipelining = FALSE;
+
+ do {
+ if(got_exit_signal)
+ break;
+
+ if(get_request(msgsock, &req))
+ /* non-zero means error, break out of loop */
+ break;
+
+ if(prevbounce) {
+ /* bounce treatment requested */
+ if((req.testno == prevtestno) &&
+ (req.partno == prevpartno)) {
+ req.partno++;
+ logmsg("BOUNCE part number to %ld", req.partno);
+ }
+ else {
+ prevbounce = FALSE;
+ prevtestno = -1;
+ prevpartno = -1;
+ }
+ }
+
+ send_doc(msgsock, &req);
+ if(got_exit_signal)
+ break;
+
+ if((req.testno < 0) && (req.testno != DOCNUMBER_CONNECT)) {
+ logmsg("special request received, no persistency");
+ break;
+ }
+ if(!req.open) {
+ logmsg("instructed to close connection after server-reply");
+ break;
+ }
+
+ if(req.open)
+ logmsg("=> persistant connection request ended, awaits new request");
+ /* if we got a CONNECT, loop and get another request as well! */
+ } while(req.open || (req.testno == DOCNUMBER_CONNECT));
+
+ if(got_exit_signal)
+ break;
+
+ logmsg("====> Client disconnect");
+ sclose(msgsock);
+ msgsock = CURL_SOCKET_BAD;
+
+ if(serverlogslocked) {
+ serverlogslocked = 0;
+ clear_advisor_read_lock(SERVERLOGS_LOCK);
+ }
+
+ if (req.testno == DOCNUMBER_QUIT)
+ break;
+#ifdef CURL_SWS_FORK_ENABLED
+ }
+#endif
+ }
+
+sws_cleanup:
+
+ if((msgsock != sock) && (msgsock != CURL_SOCKET_BAD))
+ sclose(msgsock);
+
+ if(sock != CURL_SOCKET_BAD)
+ sclose(sock);
+
+ if(got_exit_signal)
+ logmsg("signalled to die");
+
+ if(wrotepidfile)
+ unlink(pidname);
+
+ if(serverlogslocked) {
+ serverlogslocked = 0;
+ clear_advisor_read_lock(SERVERLOGS_LOCK);
+ }
+
+ restore_signal_handlers();
+
+ if(got_exit_signal) {
+ logmsg("========> %s sws (port: %d pid: %ld) exits with signal (%d)",
+ ipv_inuse, (int)port, pid, exit_signal);
+ /*
+ * To properly set the return status of the process we
+ * must raise the same signal SIGINT or SIGTERM that we
+ * caught and let the old handler take care of it.
+ */
+ raise(exit_signal);
+ }
+
+ logmsg("========> sws quits");
+ return 0;
+}
+
diff --git a/tests/server/testpart.c b/tests/server/testpart.c
new file mode 100644
index 000000000..940971450
--- /dev/null
+++ b/tests/server/testpart.c
@@ -0,0 +1,54 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+
+#define CURL_NO_OLDIES
+
+#include "setup.h"
+
+#include "getpart.h"
+
+#define _MPRINTF_REPLACE /* use our functions only */
+#include <curl/mprintf.h>
+
+/* include memdebug.h last */
+#include "memdebug.h"
+
+int main(int argc, char **argv)
+{
+ int rc;
+ char *part;
+ size_t partlen, i;
+
+ if(argc< 3) {
+ printf("./testpart main sub\n");
+ }
+ else {
+ rc = getpart(&part, &partlen, argv[1], argv[2], stdin);
+ if(rc)
+ return(rc);
+ for(i = 0; i < partlen; i++)
+ printf("%c", part[i]);
+ free(part);
+ }
+ return 0;
+}
+
diff --git a/tests/server/tftp.h b/tests/server/tftp.h
new file mode 100644
index 000000000..f60f12257
--- /dev/null
+++ b/tests/server/tftp.h
@@ -0,0 +1,57 @@
+#ifndef __SERVER_TFTP_H
+#define __SERVER_TFTP_H
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+
+/* This file is a rewrite/clone of the arpa/tftp.h file for systems without
+ it. */
+
+#define SEGSIZE 512 /* data segment size */
+
+#ifndef __GNUC__
+#define __attribute__(x)
+#endif
+
+/* Using a packed struct as binary in a program is begging for problems, but
+ the tftpd server was written like this so we have this struct here to make
+ things build. */
+
+struct tftphdr {
+ short th_opcode; /* packet type */
+ unsigned short th_block; /* all sorts of things */
+ char th_data[1]; /* data or error string */
+} __attribute__ ((__packed__));
+
+#define th_stuff th_block
+#define th_code th_block
+#define th_msg th_data
+
+#define EUNDEF 0
+#define ENOTFOUND 1
+#define EACCESS 2
+#define ENOSPACE 3
+#define EBADOP 4
+#define EBADID 5
+#define EEXISTS 6
+#define ENOUSER 7
+
+#endif /* __SERVER_TFTP_H */
diff --git a/tests/server/tftpd.c b/tests/server/tftpd.c
new file mode 100644
index 000000000..b9a0562ee
--- /dev/null
+++ b/tests/server/tftpd.c
@@ -0,0 +1,1300 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ *
+ * Trivial file transfer protocol server.
+ *
+ * This code includes many modifications by Jim Guyton <guyton@rand-unix>
+ *
+ * This source file was started based on netkit-tftpd 0.17
+ * Heavily modified for curl's test suite
+ */
+
+/*
+ * Copyright (c) 1983 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#define CURL_NO_OLDIES
+
+#include "setup.h" /* portability help from the lib directory */
+
+#ifdef HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
+#endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#ifdef HAVE_ARPA_TFTP_H
+#include <arpa/tftp.h>
+#else
+#include "tftp.h"
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_SYS_FILIO_H
+/* FIONREAD on Solaris 7 */
+#include <sys/filio.h>
+#endif
+
+#include <setjmp.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_PWD_H
+#include <pwd.h>
+#endif
+
+#define ENABLE_CURLX_PRINTF
+/* make the curlx header define all printf() functions to use the curlx_*
+ versions instead */
+#include "curlx.h" /* from the private lib dir */
+#include "getpart.h"
+#include "util.h"
+#include "server_sockaddr.h"
+
+/* include memdebug.h last */
+#include "memdebug.h"
+
+/*****************************************************************************
+* STRUCT DECLARATIONS AND DEFINES *
+*****************************************************************************/
+
+#ifndef PKTSIZE
+#define PKTSIZE (SEGSIZE + 4) /* SEGSIZE defined in arpa/tftp.h */
+#endif
+
+struct testcase {
+ char *buffer; /* holds the file data to send to the client */
+ size_t bufsize; /* size of the data in buffer */
+ char *rptr; /* read pointer into the buffer */
+ size_t rcount; /* amount of data left to read of the file */
+ long num; /* test case number */
+ int ofile; /* file descriptor for output file when uploading to us */
+};
+
+struct formats {
+ const char *f_mode;
+ int f_convert;
+};
+
+struct errmsg {
+ int e_code;
+ const char *e_msg;
+};
+
+typedef union {
+ struct tftphdr hdr;
+ char storage[PKTSIZE];
+} tftphdr_storage_t;
+
+/*
+ * bf.counter values in range [-1 .. SEGSIZE] represents size of data in the
+ * bf.buf buffer. Additionally it can also hold flags BF_ALLOC or BF_FREE.
+ */
+
+struct bf {
+ int counter; /* size of data in buffer, or flag */
+ tftphdr_storage_t buf; /* room for data packet */
+};
+
+#define BF_ALLOC -3 /* alloc'd but not yet filled */
+#define BF_FREE -2 /* free */
+
+#define opcode_RRQ 1
+#define opcode_WRQ 2
+#define opcode_DATA 3
+#define opcode_ACK 4
+#define opcode_ERROR 5
+
+#define TIMEOUT 5
+
+#undef MIN
+#define MIN(x,y) ((x)<(y)?(x):(y))
+
+#ifndef DEFAULT_LOGFILE
+#define DEFAULT_LOGFILE "log/tftpd.log"
+#endif
+
+#define REQUEST_DUMP "log/server.input"
+
+#define DEFAULT_PORT 8999 /* UDP */
+
+/*****************************************************************************
+* GLOBAL VARIABLES *
+*****************************************************************************/
+
+static struct errmsg errmsgs[] = {
+ { EUNDEF, "Undefined error code" },
+ { ENOTFOUND, "File not found" },
+ { EACCESS, "Access violation" },
+ { ENOSPACE, "Disk full or allocation exceeded" },
+ { EBADOP, "Illegal TFTP operation" },
+ { EBADID, "Unknown transfer ID" },
+ { EEXISTS, "File already exists" },
+ { ENOUSER, "No such user" },
+ { -1, 0 }
+};
+
+static struct formats formata[] = {
+ { "netascii", 1 },
+ { "octet", 0 },
+ { NULL, 0 }
+};
+
+static struct bf bfs[2];
+
+static int nextone; /* index of next buffer to use */
+static int current; /* index of buffer in use */
+
+ /* control flags for crlf conversions */
+static int newline = 0; /* fillbuf: in middle of newline expansion */
+static int prevchar = -1; /* putbuf: previous char (cr check) */
+
+static tftphdr_storage_t buf;
+static tftphdr_storage_t ackbuf;
+
+static srvr_sockaddr_union_t from;
+static curl_socklen_t fromlen;
+
+static curl_socket_t peer = CURL_SOCKET_BAD;
+
+static int timeout;
+static int maxtimeout = 5 * TIMEOUT;
+
+static unsigned short sendblock; /* block count used by sendtftp() */
+static struct tftphdr *sdp; /* data buffer used by sendtftp() */
+static struct tftphdr *sap; /* ack buffer used by sendtftp() */
+
+static unsigned short recvblock; /* block count used by recvtftp() */
+static struct tftphdr *rdp; /* data buffer used by recvtftp() */
+static struct tftphdr *rap; /* ack buffer used by recvtftp() */
+
+#ifdef ENABLE_IPV6
+static bool use_ipv6 = FALSE;
+#endif
+static const char *ipv_inuse = "IPv4";
+
+const char *serverlogfile = DEFAULT_LOGFILE;
+static char *pidname= (char *)".tftpd.pid";
+static int serverlogslocked = 0;
+static int wrotepidfile = 0;
+
+#ifdef HAVE_SIGSETJMP
+static sigjmp_buf timeoutbuf;
+#endif
+
+#if defined(HAVE_ALARM) && defined(SIGALRM)
+static int rexmtval = TIMEOUT;
+#endif
+
+/* do-nothing macro replacement for systems which lack siginterrupt() */
+
+#ifndef HAVE_SIGINTERRUPT
+#define siginterrupt(x,y) do {} while(0)
+#endif
+
+/* vars used to keep around previous signal handlers */
+
+typedef RETSIGTYPE (*SIGHANDLER_T)(int);
+
+#ifdef SIGHUP
+static SIGHANDLER_T old_sighup_handler = SIG_ERR;
+#endif
+
+#ifdef SIGPIPE
+static SIGHANDLER_T old_sigpipe_handler = SIG_ERR;
+#endif
+
+#ifdef SIGINT
+static SIGHANDLER_T old_sigint_handler = SIG_ERR;
+#endif
+
+#ifdef SIGTERM
+static SIGHANDLER_T old_sigterm_handler = SIG_ERR;
+#endif
+
+/* var which if set indicates that the program should finish execution */
+
+SIG_ATOMIC_T got_exit_signal = 0;
+
+/* if next is set indicates the first signal handled in exit_signal_handler */
+
+static volatile int exit_signal = 0;
+
+/*****************************************************************************
+* FUNCTION PROTOTYPES *
+*****************************************************************************/
+
+static struct tftphdr *rw_init(int);
+
+static struct tftphdr *w_init(void);
+
+static struct tftphdr *r_init(void);
+
+static int readit(struct testcase *test,
+ struct tftphdr **dpp,
+ int convert);
+
+static int writeit(struct testcase *test,
+ struct tftphdr **dpp,
+ int ct,
+ int convert);
+
+static void read_ahead(struct testcase *test, int convert);
+
+static ssize_t write_behind(struct testcase *test, int convert);
+
+static int synchnet(curl_socket_t);
+
+static int do_tftp(struct testcase *test, struct tftphdr *tp, ssize_t size);
+
+static int validate_access(struct testcase *test, const char *fname, int mode);
+
+static void sendtftp(struct testcase *test, struct formats *pf);
+
+static void recvtftp(struct testcase *test, struct formats *pf);
+
+static void nak(int error);
+
+#if defined(HAVE_ALARM) && defined(SIGALRM)
+
+static void mysignal(int sig, void (*handler)(int));
+
+static void timer(int signum);
+
+static void justtimeout(int signum);
+
+#endif /* HAVE_ALARM && SIGALRM */
+
+static RETSIGTYPE exit_signal_handler(int signum);
+
+static void install_signal_handlers(void);
+
+static void restore_signal_handlers(void);
+
+/*****************************************************************************
+* FUNCTION IMPLEMENTATIONS *
+*****************************************************************************/
+
+#if defined(HAVE_ALARM) && defined(SIGALRM)
+
+/*
+ * Like signal(), but with well-defined semantics.
+ */
+static void mysignal(int sig, void (*handler)(int))
+{
+ struct sigaction sa;
+ memset(&sa, 0, sizeof(sa));
+ sa.sa_handler = handler;
+ sigaction(sig, &sa, NULL);
+}
+
+static void timer(int signum)
+{
+ (void)signum;
+
+ logmsg("alarm!");
+
+ timeout += rexmtval;
+ if(timeout >= maxtimeout) {
+ if(wrotepidfile) {
+ wrotepidfile = 0;
+ unlink(pidname);
+ }
+ if(serverlogslocked) {
+ serverlogslocked = 0;
+ clear_advisor_read_lock(SERVERLOGS_LOCK);
+ }
+ exit(1);
+ }
+#ifdef HAVE_SIGSETJMP
+ siglongjmp(timeoutbuf, 1);
+#endif
+}
+
+static void justtimeout(int signum)
+{
+ (void)signum;
+}
+
+#endif /* HAVE_ALARM && SIGALRM */
+
+/* signal handler that will be triggered to indicate that the program
+ should finish its execution in a controlled manner as soon as possible.
+ The first time this is called it will set got_exit_signal to one and
+ store in exit_signal the signal that triggered its execution. */
+
+static RETSIGTYPE exit_signal_handler(int signum)
+{
+ int old_errno = ERRNO;
+ if(got_exit_signal == 0) {
+ got_exit_signal = 1;
+ exit_signal = signum;
+ }
+ (void)signal(signum, exit_signal_handler);
+ SET_ERRNO(old_errno);
+}
+
+static void install_signal_handlers(void)
+{
+#ifdef SIGHUP
+ /* ignore SIGHUP signal */
+ if((old_sighup_handler = signal(SIGHUP, SIG_IGN)) == SIG_ERR)
+ logmsg("cannot install SIGHUP handler: %s", strerror(ERRNO));
+#endif
+#ifdef SIGPIPE
+ /* ignore SIGPIPE signal */
+ if((old_sigpipe_handler = signal(SIGPIPE, SIG_IGN)) == SIG_ERR)
+ logmsg("cannot install SIGPIPE handler: %s", strerror(ERRNO));
+#endif
+#ifdef SIGINT
+ /* handle SIGINT signal with our exit_signal_handler */
+ if((old_sigint_handler = signal(SIGINT, exit_signal_handler)) == SIG_ERR)
+ logmsg("cannot install SIGINT handler: %s", strerror(ERRNO));
+ else
+ siginterrupt(SIGINT, 1);
+#endif
+#ifdef SIGTERM
+ /* handle SIGTERM signal with our exit_signal_handler */
+ if((old_sigterm_handler = signal(SIGTERM, exit_signal_handler)) == SIG_ERR)
+ logmsg("cannot install SIGTERM handler: %s", strerror(ERRNO));
+ else
+ siginterrupt(SIGTERM, 1);
+#endif
+}
+
+static void restore_signal_handlers(void)
+{
+#ifdef SIGHUP
+ if(SIG_ERR != old_sighup_handler)
+ (void)signal(SIGHUP, old_sighup_handler);
+#endif
+#ifdef SIGPIPE
+ if(SIG_ERR != old_sigpipe_handler)
+ (void)signal(SIGPIPE, old_sigpipe_handler);
+#endif
+#ifdef SIGINT
+ if(SIG_ERR != old_sigint_handler)
+ (void)signal(SIGINT, old_sigint_handler);
+#endif
+#ifdef SIGTERM
+ if(SIG_ERR != old_sigterm_handler)
+ (void)signal(SIGTERM, old_sigterm_handler);
+#endif
+}
+
+/*
+ * init for either read-ahead or write-behind.
+ * zero for write-behind, one for read-head.
+ */
+static struct tftphdr *rw_init(int x)
+{
+ newline = 0; /* init crlf flag */
+ prevchar = -1;
+ bfs[0].counter = BF_ALLOC; /* pass out the first buffer */
+ current = 0;
+ bfs[1].counter = BF_FREE;
+ nextone = x; /* ahead or behind? */
+ return &bfs[0].buf.hdr;
+}
+
+static struct tftphdr *w_init(void)
+{
+ return rw_init(0); /* write-behind */
+}
+
+static struct tftphdr *r_init(void)
+{
+ return rw_init(1); /* read-ahead */
+}
+
+/* Have emptied current buffer by sending to net and getting ack.
+ Free it and return next buffer filled with data.
+ */
+static int readit(struct testcase *test, struct tftphdr **dpp,
+ int convert /* if true, convert to ascii */)
+{
+ struct bf *b;
+
+ bfs[current].counter = BF_FREE; /* free old one */
+ current = !current; /* "incr" current */
+
+ b = &bfs[current]; /* look at new buffer */
+ if (b->counter == BF_FREE) /* if it's empty */
+ read_ahead(test, convert); /* fill it */
+
+ *dpp = &b->buf.hdr; /* set caller's ptr */
+ return b->counter;
+}
+
+/*
+ * fill the input buffer, doing ascii conversions if requested
+ * conversions are lf -> cr,lf and cr -> cr, nul
+ */
+static void read_ahead(struct testcase *test,
+ int convert /* if true, convert to ascii */)
+{
+ int i;
+ char *p;
+ int c;
+ struct bf *b;
+ struct tftphdr *dp;
+
+ b = &bfs[nextone]; /* look at "next" buffer */
+ if (b->counter != BF_FREE) /* nop if not free */
+ return;
+ nextone = !nextone; /* "incr" next buffer ptr */
+
+ dp = &b->buf.hdr;
+
+ if (convert == 0) {
+ /* The former file reading code did this:
+ b->counter = read(fileno(file), dp->th_data, SEGSIZE); */
+ size_t copy_n = MIN(SEGSIZE, test->rcount);
+ memcpy(dp->th_data, test->rptr, copy_n);
+
+ /* decrease amount, advance pointer */
+ test->rcount -= copy_n;
+ test->rptr += copy_n;
+ b->counter = (int)copy_n;
+ return;
+ }
+
+ p = dp->th_data;
+ for (i = 0 ; i < SEGSIZE; i++) {
+ if (newline) {
+ if (prevchar == '\n')
+ c = '\n'; /* lf to cr,lf */
+ else
+ c = '\0'; /* cr to cr,nul */
+ newline = 0;
+ }
+ else {
+ if(test->rcount) {
+ c=test->rptr[0];
+ test->rptr++;
+ test->rcount--;
+ }
+ else
+ break;
+ if (c == '\n' || c == '\r') {
+ prevchar = c;
+ c = '\r';
+ newline = 1;
+ }
+ }
+ *p++ = (char)c;
+ }
+ b->counter = (int)(p - dp->th_data);
+}
+
+/* Update count associated with the buffer, get new buffer from the queue.
+ Calls write_behind only if next buffer not available.
+ */
+static int writeit(struct testcase *test, struct tftphdr **dpp,
+ int ct, int convert)
+{
+ bfs[current].counter = ct; /* set size of data to write */
+ current = !current; /* switch to other buffer */
+ if (bfs[current].counter != BF_FREE) /* if not free */
+ write_behind(test, convert); /* flush it */
+ bfs[current].counter = BF_ALLOC; /* mark as alloc'd */
+ *dpp = &bfs[current].buf.hdr;
+ return ct; /* this is a lie of course */
+}
+
+/*
+ * Output a buffer to a file, converting from netascii if requested.
+ * CR,NUL -> CR and CR,LF => LF.
+ * Note spec is undefined if we get CR as last byte of file or a
+ * CR followed by anything else. In this case we leave it alone.
+ */
+static ssize_t write_behind(struct testcase *test, int convert)
+{
+ char *writebuf;
+ int count;
+ int ct;
+ char *p;
+ int c; /* current character */
+ struct bf *b;
+ struct tftphdr *dp;
+
+ b = &bfs[nextone];
+ if (b->counter < -1) /* anything to flush? */
+ return 0; /* just nop if nothing to do */
+
+ if(!test->ofile) {
+ char outfile[256];
+ snprintf(outfile, sizeof(outfile), "log/upload.%ld", test->num);
+ test->ofile=open(outfile, O_CREAT|O_RDWR, 0777);
+ if(test->ofile == -1) {
+ logmsg("Couldn't create and/or open file %s for upload!", outfile);
+ return -1; /* failure! */
+ }
+ }
+
+ count = b->counter; /* remember byte count */
+ b->counter = BF_FREE; /* reset flag */
+ dp = &b->buf.hdr;
+ nextone = !nextone; /* incr for next time */
+ writebuf = dp->th_data;
+
+ if (count <= 0)
+ return -1; /* nak logic? */
+
+ if (convert == 0)
+ return write(test->ofile, writebuf, count);
+
+ p = writebuf;
+ ct = count;
+ while (ct--) { /* loop over the buffer */
+ c = *p++; /* pick up a character */
+ if (prevchar == '\r') { /* if prev char was cr */
+ if (c == '\n') /* if have cr,lf then just */
+ lseek(test->ofile, -1, SEEK_CUR); /* smash lf on top of the cr */
+ else
+ if (c == '\0') /* if have cr,nul then */
+ goto skipit; /* just skip over the putc */
+ /* else just fall through and allow it */
+ }
+ /* formerly
+ putc(c, file); */
+ write(test->ofile, &c, 1);
+ skipit:
+ prevchar = c;
+ }
+ return count;
+}
+
+/* When an error has occurred, it is possible that the two sides are out of
+ * synch. Ie: that what I think is the other side's response to packet N is
+ * really their response to packet N-1.
+ *
+ * So, to try to prevent that, we flush all the input queued up for us on the
+ * network connection on our host.
+ *
+ * We return the number of packets we flushed (mostly for reporting when trace
+ * is active).
+ */
+
+static int synchnet(curl_socket_t f /* socket to flush */)
+{
+
+#if defined(HAVE_IOCTLSOCKET)
+ unsigned long i;
+#else
+ int i;
+#endif
+ int j = 0;
+ char rbuf[PKTSIZE];
+ srvr_sockaddr_union_t fromaddr;
+ curl_socklen_t fromaddrlen;
+
+ for (;;) {
+#if defined(HAVE_IOCTLSOCKET)
+ (void) ioctlsocket(f, FIONREAD, &i);
+#else
+ (void) ioctl(f, FIONREAD, &i);
+#endif
+ if (i) {
+ j++;
+#ifdef ENABLE_IPV6
+ if(!use_ipv6)
+#endif
+ fromaddrlen = sizeof(fromaddr.sa4);
+#ifdef ENABLE_IPV6
+ else
+ fromaddrlen = sizeof(fromaddr.sa6);
+#endif
+ (void) recvfrom(f, rbuf, sizeof(rbuf), 0,
+ &fromaddr.sa, &fromaddrlen);
+ }
+ else
+ break;
+ }
+ return j;
+}
+
+int main(int argc, char **argv)
+{
+ srvr_sockaddr_union_t me;
+ struct tftphdr *tp;
+ ssize_t n = 0;
+ int arg = 1;
+ unsigned short port = DEFAULT_PORT;
+ curl_socket_t sock = CURL_SOCKET_BAD;
+ int flag;
+ int rc;
+ int error;
+ long pid;
+ struct testcase test;
+ int result = 0;
+
+ memset(&test, 0, sizeof(test));
+
+ while(argc>arg) {
+ if(!strcmp("--version", argv[arg])) {
+ printf("tftpd IPv4%s\n",
+#ifdef ENABLE_IPV6
+ "/IPv6"
+#else
+ ""
+#endif
+ );
+ return 0;
+ }
+ else if(!strcmp("--pidfile", argv[arg])) {
+ arg++;
+ if(argc>arg)
+ pidname = argv[arg++];
+ }
+ else if(!strcmp("--logfile", argv[arg])) {
+ arg++;
+ if(argc>arg)
+ serverlogfile = argv[arg++];
+ }
+ else if(!strcmp("--ipv4", argv[arg])) {
+#ifdef ENABLE_IPV6
+ ipv_inuse = "IPv4";
+ use_ipv6 = FALSE;
+#endif
+ arg++;
+ }
+ else if(!strcmp("--ipv6", argv[arg])) {
+#ifdef ENABLE_IPV6
+ ipv_inuse = "IPv6";
+ use_ipv6 = TRUE;
+#endif
+ arg++;
+ }
+ else if(!strcmp("--port", argv[arg])) {
+ arg++;
+ if(argc>arg) {
+ char *endptr;
+ unsigned long ulnum = strtoul(argv[arg], &endptr, 10);
+ if((endptr != argv[arg] + strlen(argv[arg])) ||
+ (ulnum < 1025UL) || (ulnum > 65535UL)) {
+ fprintf(stderr, "tftpd: invalid --port argument (%s)\n",
+ argv[arg]);
+ return 0;
+ }
+ port = curlx_ultous(ulnum);
+ arg++;
+ }
+ }
+ else if(!strcmp("--srcdir", argv[arg])) {
+ arg++;
+ if(argc>arg) {
+ path = argv[arg];
+ arg++;
+ }
+ }
+ else {
+ puts("Usage: tftpd [option]\n"
+ " --version\n"
+ " --logfile [file]\n"
+ " --pidfile [file]\n"
+ " --ipv4\n"
+ " --ipv6\n"
+ " --port [port]\n"
+ " --srcdir [path]");
+ return 0;
+ }
+ }
+
+#ifdef WIN32
+ win32_init();
+ atexit(win32_cleanup);
+#endif
+
+ install_signal_handlers();
+
+ pid = (long)getpid();
+
+#ifdef ENABLE_IPV6
+ if(!use_ipv6)
+#endif
+ sock = socket(AF_INET, SOCK_DGRAM, 0);
+#ifdef ENABLE_IPV6
+ else
+ sock = socket(AF_INET6, SOCK_DGRAM, 0);
+#endif
+
+ if(CURL_SOCKET_BAD == sock) {
+ error = SOCKERRNO;
+ logmsg("Error creating socket: (%d) %s",
+ error, strerror(error));
+ result = 1;
+ goto tftpd_cleanup;
+ }
+
+ flag = 1;
+ if (0 != setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
+ (void *)&flag, sizeof(flag))) {
+ error = SOCKERRNO;
+ logmsg("setsockopt(SO_REUSEADDR) failed with error: (%d) %s",
+ error, strerror(error));
+ result = 1;
+ goto tftpd_cleanup;
+ }
+
+#ifdef ENABLE_IPV6
+ if(!use_ipv6) {
+#endif
+ memset(&me.sa4, 0, sizeof(me.sa4));
+ me.sa4.sin_family = AF_INET;
+ me.sa4.sin_addr.s_addr = INADDR_ANY;
+ me.sa4.sin_port = htons(port);
+ rc = bind(sock, &me.sa, sizeof(me.sa4));
+#ifdef ENABLE_IPV6
+ }
+ else {
+ memset(&me.sa6, 0, sizeof(me.sa6));
+ me.sa6.sin6_family = AF_INET6;
+ me.sa6.sin6_addr = in6addr_any;
+ me.sa6.sin6_port = htons(port);
+ rc = bind(sock, &me.sa, sizeof(me.sa6));
+ }
+#endif /* ENABLE_IPV6 */
+ if(0 != rc) {
+ error = SOCKERRNO;
+ logmsg("Error binding socket on port %hu: (%d) %s",
+ port, error, strerror(error));
+ result = 1;
+ goto tftpd_cleanup;
+ }
+
+ wrotepidfile = write_pidfile(pidname);
+ if(!wrotepidfile) {
+ result = 1;
+ goto tftpd_cleanup;
+ }
+
+ logmsg("Running %s version on port UDP/%d", ipv_inuse, (int)port);
+
+ for (;;) {
+ fromlen = sizeof(from);
+#ifdef ENABLE_IPV6
+ if(!use_ipv6)
+#endif
+ fromlen = sizeof(from.sa4);
+#ifdef ENABLE_IPV6
+ else
+ fromlen = sizeof(from.sa6);
+#endif
+ n = (ssize_t)recvfrom(sock, &buf.storage[0], sizeof(buf.storage), 0,
+ &from.sa, &fromlen);
+ if(got_exit_signal)
+ break;
+ if (n < 0) {
+ logmsg("recvfrom");
+ result = 3;
+ break;
+ }
+
+ set_advisor_read_lock(SERVERLOGS_LOCK);
+ serverlogslocked = 1;
+
+#ifdef ENABLE_IPV6
+ if(!use_ipv6) {
+#endif
+ from.sa4.sin_family = AF_INET;
+ peer = socket(AF_INET, SOCK_DGRAM, 0);
+ if(CURL_SOCKET_BAD == peer) {
+ logmsg("socket");
+ result = 2;
+ break;
+ }
+ if(connect(peer, &from.sa, sizeof(from.sa4)) < 0) {
+ logmsg("connect: fail");
+ result = 1;
+ break;
+ }
+#ifdef ENABLE_IPV6
+ }
+ else {
+ from.sa6.sin6_family = AF_INET6;
+ peer = socket(AF_INET6, SOCK_DGRAM, 0);
+ if(CURL_SOCKET_BAD == peer) {
+ logmsg("socket");
+ result = 2;
+ break;
+ }
+ if (connect(peer, &from.sa, sizeof(from.sa6)) < 0) {
+ logmsg("connect: fail");
+ result = 1;
+ break;
+ }
+ }
+#endif
+
+ maxtimeout = 5*TIMEOUT;
+
+ tp = &buf.hdr;
+ tp->th_opcode = ntohs(tp->th_opcode);
+ if (tp->th_opcode == opcode_RRQ || tp->th_opcode == opcode_WRQ) {
+ memset(&test, 0, sizeof(test));
+ if (do_tftp(&test, tp, n) < 0)
+ break;
+ if(test.buffer)
+ free(test.buffer);
+ }
+ sclose(peer);
+ peer = CURL_SOCKET_BAD;
+
+ if(test.ofile > 0) {
+ close(test.ofile);
+ test.ofile = 0;
+ }
+
+ if(got_exit_signal)
+ break;
+
+ if(serverlogslocked) {
+ serverlogslocked = 0;
+ clear_advisor_read_lock(SERVERLOGS_LOCK);
+ }
+
+ logmsg("end of one transfer");
+
+ }
+
+tftpd_cleanup:
+
+ if(test.ofile > 0)
+ close(test.ofile);
+
+ if((peer != sock) && (peer != CURL_SOCKET_BAD))
+ sclose(peer);
+
+ if(sock != CURL_SOCKET_BAD)
+ sclose(sock);
+
+ if(got_exit_signal)
+ logmsg("signalled to die");
+
+ if(wrotepidfile)
+ unlink(pidname);
+
+ if(serverlogslocked) {
+ serverlogslocked = 0;
+ clear_advisor_read_lock(SERVERLOGS_LOCK);
+ }
+
+ restore_signal_handlers();
+
+ if(got_exit_signal) {
+ logmsg("========> %s tftpd (port: %d pid: %ld) exits with signal (%d)",
+ ipv_inuse, (int)port, pid, exit_signal);
+ /*
+ * To properly set the return status of the process we
+ * must raise the same signal SIGINT or SIGTERM that we
+ * caught and let the old handler take care of it.
+ */
+ raise(exit_signal);
+ }
+
+ logmsg("========> tftpd quits");
+ return result;
+}
+
+/*
+ * Handle initial connection protocol.
+ */
+static int do_tftp(struct testcase *test, struct tftphdr *tp, ssize_t size)
+{
+ char *cp;
+ int first = 1, ecode;
+ struct formats *pf;
+ char *filename, *mode = NULL;
+ int error;
+ FILE *server;
+
+ /* Open request dump file. */
+ server = fopen(REQUEST_DUMP, "ab");
+ if(!server) {
+ error = ERRNO;
+ logmsg("fopen() failed with error: %d %s", error, strerror(error));
+ logmsg("Error opening file: %s", REQUEST_DUMP);
+ return -1;
+ }
+
+ /* store input protocol */
+ fprintf(server, "opcode: %x\n", tp->th_opcode);
+
+ cp = (char *)&tp->th_stuff;
+ filename = cp;
+again:
+ while (cp < &buf.storage[size]) {
+ if (*cp == '\0')
+ break;
+ cp++;
+ }
+ if (*cp) {
+ nak(EBADOP);
+ fclose(server);
+ return 3;
+ }
+ if (first) {
+ mode = ++cp;
+ first = 0;
+ goto again;
+ }
+ /* store input protocol */
+ fprintf(server, "filename: %s\n", filename);
+
+ for (cp = mode; cp && *cp; cp++)
+ if(ISUPPER(*cp))
+ *cp = (char)tolower((int)*cp);
+
+ /* store input protocol */
+ fprintf(server, "mode: %s\n", mode);
+ fclose(server);
+
+ for (pf = formata; pf->f_mode; pf++)
+ if (strcmp(pf->f_mode, mode) == 0)
+ break;
+ if (!pf->f_mode) {
+ nak(EBADOP);
+ return 2;
+ }
+ ecode = validate_access(test, filename, tp->th_opcode);
+ if (ecode) {
+ nak(ecode);
+ return 1;
+ }
+ if (tp->th_opcode == opcode_WRQ)
+ recvtftp(test, pf);
+ else
+ sendtftp(test, pf);
+
+ return 0;
+}
+
+/*
+ * Validate file access.
+ */
+static int validate_access(struct testcase *test,
+ const char *filename, int mode)
+{
+ char *ptr;
+ long testno, partno;
+ int error;
+ char partbuf[80]="data";
+
+ logmsg("trying to get file: %s mode %x", filename, mode);
+
+ if(!strncmp("verifiedserver", filename, 14)) {
+ char weare[128];
+ size_t count = sprintf(weare, "WE ROOLZ: %ld\r\n", (long)getpid());
+
+ logmsg("Are-we-friendly question received");
+ test->buffer = strdup(weare);
+ test->rptr = test->buffer; /* set read pointer */
+ test->bufsize = count; /* set total count */
+ test->rcount = count; /* set data left to read */
+ return 0; /* fine */
+ }
+
+ /* find the last slash */
+ ptr = strrchr(filename, '/');
+
+ if(ptr) {
+ char *file;
+
+ ptr++; /* skip the slash */
+
+ /* skip all non-numericals following the slash */
+ while(*ptr && !ISDIGIT(*ptr))
+ ptr++;
+
+ /* get the number */
+ testno = strtol(ptr, &ptr, 10);
+
+ if(testno > 10000) {
+ partno = testno % 10000;
+ testno /= 10000;
+ }
+ else
+ partno = 0;
+
+
+ logmsg("requested test number %ld part %ld", testno, partno);
+
+ test->num = testno;
+
+ file = test2file(testno);
+
+ if(0 != partno)
+ sprintf(partbuf, "data%ld", partno);
+
+ if(file) {
+ FILE *stream=fopen(file, "rb");
+ if(!stream) {
+ error = ERRNO;
+ logmsg("fopen() failed with error: %d %s", error, strerror(error));
+ logmsg("Error opening file: %s", file);
+ logmsg("Couldn't open test file: %s", file);
+ return EACCESS;
+ }
+ else {
+ size_t count;
+ error = getpart(&test->buffer, &count, "reply", partbuf, stream);
+ fclose(stream);
+ if(error) {
+ logmsg("getpart() failed with error: %d", error);
+ return EACCESS;
+ }
+ if(test->buffer) {
+ test->rptr = test->buffer; /* set read pointer */
+ test->bufsize = count; /* set total count */
+ test->rcount = count; /* set data left to read */
+ }
+ else
+ return EACCESS;
+ }
+
+ }
+ else
+ return EACCESS;
+ }
+ else {
+ logmsg("no slash found in path");
+ return EACCESS; /* failure */
+ }
+
+ logmsg("file opened and all is good");
+ return 0;
+}
+
+/*
+ * Send the requested file.
+ */
+static void sendtftp(struct testcase *test, struct formats *pf)
+{
+ int size;
+ ssize_t n;
+ sendblock = 1;
+#if defined(HAVE_ALARM) && defined(SIGALRM)
+ mysignal(SIGALRM, timer);
+#endif
+ sdp = r_init();
+ sap = &ackbuf.hdr;
+ do {
+ size = readit(test, &sdp, pf->f_convert);
+ if (size < 0) {
+ nak(ERRNO + 100);
+ return;
+ }
+ sdp->th_opcode = htons((u_short)opcode_DATA);
+ sdp->th_block = htons((u_short)sendblock);
+ timeout = 0;
+#ifdef HAVE_SIGSETJMP
+ (void) sigsetjmp(timeoutbuf, 1);
+#endif
+ send_data:
+ if (swrite(peer, sdp, size + 4) != size + 4) {
+ logmsg("write");
+ return;
+ }
+ read_ahead(test, pf->f_convert);
+ for ( ; ; ) {
+#ifdef HAVE_ALARM
+ alarm(rexmtval); /* read the ack */
+#endif
+ n = sread(peer, &ackbuf.storage[0], sizeof(ackbuf.storage));
+#ifdef HAVE_ALARM
+ alarm(0);
+#endif
+ if(got_exit_signal)
+ return;
+ if (n < 0) {
+ logmsg("read: fail");
+ return;
+ }
+ sap->th_opcode = ntohs((u_short)sap->th_opcode);
+ sap->th_block = ntohs((u_short)sap->th_block);
+
+ if (sap->th_opcode == opcode_ERROR) {
+ logmsg("got ERROR");
+ return;
+ }
+
+ if (sap->th_opcode == opcode_ACK) {
+ if (sap->th_block == sendblock) {
+ break;
+ }
+ /* Re-synchronize with the other side */
+ (void) synchnet(peer);
+ if (sap->th_block == (sendblock-1)) {
+ goto send_data;
+ }
+ }
+
+ }
+ sendblock++;
+ } while (size == SEGSIZE);
+}
+
+/*
+ * Receive a file.
+ */
+static void recvtftp(struct testcase *test, struct formats *pf)
+{
+ ssize_t n, size;
+ recvblock = 0;
+#if defined(HAVE_ALARM) && defined(SIGALRM)
+ mysignal(SIGALRM, timer);
+#endif
+ rdp = w_init();
+ rap = &ackbuf.hdr;
+ do {
+ timeout = 0;
+ rap->th_opcode = htons((u_short)opcode_ACK);
+ rap->th_block = htons((u_short)recvblock);
+ recvblock++;
+#ifdef HAVE_SIGSETJMP
+ (void) sigsetjmp(timeoutbuf, 1);
+#endif
+send_ack:
+ if (swrite(peer, &ackbuf.storage[0], 4) != 4) {
+ logmsg("write: fail\n");
+ goto abort;
+ }
+ write_behind(test, pf->f_convert);
+ for ( ; ; ) {
+#ifdef HAVE_ALARM
+ alarm(rexmtval);
+#endif
+ n = sread(peer, rdp, PKTSIZE);
+#ifdef HAVE_ALARM
+ alarm(0);
+#endif
+ if(got_exit_signal)
+ goto abort;
+ if (n < 0) { /* really? */
+ logmsg("read: fail\n");
+ goto abort;
+ }
+ rdp->th_opcode = ntohs((u_short)rdp->th_opcode);
+ rdp->th_block = ntohs((u_short)rdp->th_block);
+ if (rdp->th_opcode == opcode_ERROR)
+ goto abort;
+ if (rdp->th_opcode == opcode_DATA) {
+ if (rdp->th_block == recvblock) {
+ break; /* normal */
+ }
+ /* Re-synchronize with the other side */
+ (void) synchnet(peer);
+ if (rdp->th_block == (recvblock-1))
+ goto send_ack; /* rexmit */
+ }
+ }
+
+ size = writeit(test, &rdp, (int)(n - 4), pf->f_convert);
+ if (size != (n-4)) { /* ahem */
+ if (size < 0)
+ nak(ERRNO + 100);
+ else
+ nak(ENOSPACE);
+ goto abort;
+ }
+ } while (size == SEGSIZE);
+ write_behind(test, pf->f_convert);
+
+ rap->th_opcode = htons((u_short)opcode_ACK); /* send the "final" ack */
+ rap->th_block = htons((u_short)recvblock);
+ (void) swrite(peer, &ackbuf.storage[0], 4);
+#if defined(HAVE_ALARM) && defined(SIGALRM)
+ mysignal(SIGALRM, justtimeout); /* just abort read on timeout */
+ alarm(rexmtval);
+#endif
+ /* normally times out and quits */
+ n = sread(peer, &buf.storage[0], sizeof(buf.storage));
+#ifdef HAVE_ALARM
+ alarm(0);
+#endif
+ if(got_exit_signal)
+ goto abort;
+ if (n >= 4 && /* if read some data */
+ rdp->th_opcode == opcode_DATA && /* and got a data block */
+ recvblock == rdp->th_block) { /* then my last ack was lost */
+ (void) swrite(peer, &ackbuf.storage[0], 4); /* resend final ack */
+ }
+abort:
+ return;
+}
+
+/*
+ * Send a nak packet (error message). Error code passed in is one of the
+ * standard TFTP codes, or a UNIX errno offset by 100.
+ */
+static void nak(int error)
+{
+ struct tftphdr *tp;
+ int length;
+ struct errmsg *pe;
+
+ tp = &buf.hdr;
+ tp->th_opcode = htons((u_short)opcode_ERROR);
+ tp->th_code = htons((u_short)error);
+ for (pe = errmsgs; pe->e_code >= 0; pe++)
+ if (pe->e_code == error)
+ break;
+ if (pe->e_code < 0) {
+ pe->e_msg = strerror(error - 100);
+ tp->th_code = EUNDEF; /* set 'undef' errorcode */
+ }
+ strcpy(tp->th_msg, pe->e_msg);
+ length = (int)strlen(pe->e_msg);
+ tp->th_msg[length] = '\0';
+ length += 5;
+ if (swrite(peer, &buf.storage[0], length) != length)
+ logmsg("nak: fail\n");
+}
diff --git a/tests/server/util.c b/tests/server/util.c
new file mode 100644
index 000000000..52802a82c
--- /dev/null
+++ b/tests/server/util.c
@@ -0,0 +1,283 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+
+#define CURL_NO_OLDIES
+
+#include "setup.h" /* portability help from the lib directory */
+
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef _XOPEN_SOURCE_EXTENDED
+/* This define is "almost" required to build on HPUX 11 */
+#include <arpa/inet.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_SYS_POLL_H
+#include <sys/poll.h>
+#elif defined(HAVE_POLL_H)
+#include <poll.h>
+#endif
+
+#define ENABLE_CURLX_PRINTF
+/* make the curlx header define all printf() functions to use the curlx_*
+ versions instead */
+#include "curlx.h" /* from the private lib dir */
+#include "getpart.h"
+#include "util.h"
+#include "timeval.h"
+
+#if defined(ENABLE_IPV6) && defined(__MINGW32__)
+const struct in6_addr in6addr_any = {{ IN6ADDR_ANY_INIT }};
+#endif
+
+void logmsg(const char *msg, ...)
+{
+ va_list ap;
+ char buffer[2048 + 1];
+ FILE *logfp;
+ int error;
+ struct timeval tv;
+ time_t sec;
+ struct tm *now;
+ char timebuf[20];
+ static time_t epoch_offset;
+ static int known_offset;
+
+ if (!serverlogfile) {
+ fprintf(stderr, "Error: serverlogfile not set\n");
+ return;
+ }
+
+ tv = curlx_tvnow();
+ if(!known_offset) {
+ epoch_offset = time(NULL) - tv.tv_sec;
+ known_offset = 1;
+ }
+ sec = epoch_offset + tv.tv_sec;
+ now = localtime(&sec); /* not thread safe but we don't care */
+
+ snprintf(timebuf, sizeof(timebuf), "%02d:%02d:%02d.%06ld",
+ (int)now->tm_hour, (int)now->tm_min, (int)now->tm_sec, (long)tv.tv_usec);
+
+ va_start(ap, msg);
+ vsnprintf(buffer, sizeof(buffer), msg, ap);
+ va_end(ap);
+
+ logfp = fopen(serverlogfile, "ab");
+ if(logfp) {
+ fprintf(logfp, "%s %s\n", timebuf, buffer);
+ fclose(logfp);
+ }
+ else {
+ error = ERRNO;
+ fprintf(stderr, "fopen() failed with error: %d %s\n",
+ error, strerror(error));
+ fprintf(stderr, "Error opening file: %s\n", serverlogfile);
+ fprintf(stderr, "Msg not logged: %s %s\n", timebuf, buffer);
+ }
+}
+
+#ifdef WIN32
+/* use instead of perror() on generic windows */
+void win32_perror (const char *msg)
+{
+ char buf[512];
+ DWORD err = SOCKERRNO;
+
+ if (!FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err,
+ LANG_NEUTRAL, buf, sizeof(buf), NULL))
+ snprintf(buf, sizeof(buf), "Unknown error %lu (%#lx)", err, err);
+ if (msg)
+ fprintf(stderr, "%s: ", msg);
+ fprintf(stderr, "%s\n", buf);
+}
+#endif /* WIN32 */
+
+#ifdef USE_WINSOCK
+void win32_init(void)
+{
+ WORD wVersionRequested;
+ WSADATA wsaData;
+ int err;
+ wVersionRequested = MAKEWORD(USE_WINSOCK, USE_WINSOCK);
+
+ err = WSAStartup(wVersionRequested, &wsaData);
+
+ if (err != 0) {
+ perror("Winsock init failed");
+ logmsg("Error initialising winsock -- aborting");
+ exit(1);
+ }
+
+ if ( LOBYTE( wsaData.wVersion ) != USE_WINSOCK ||
+ HIBYTE( wsaData.wVersion ) != USE_WINSOCK ) {
+
+ WSACleanup();
+ perror("Winsock init failed");
+ logmsg("No suitable winsock.dll found -- aborting");
+ exit(1);
+ }
+}
+
+void win32_cleanup(void)
+{
+ WSACleanup();
+}
+#endif /* USE_WINSOCK */
+
+/* set by the main code to point to where the test dir is */
+const char *path=".";
+
+char *test2file(long testno)
+{
+ static char filename[256];
+ snprintf(filename, sizeof(filename), TEST_DATA_PATH, path, testno);
+ return filename;
+}
+
+/*
+ * Portable function used for waiting a specific amount of ms.
+ * Waiting indefinitely with this function is not allowed, a
+ * zero or negative timeout value will return immediately.
+ *
+ * Return values:
+ * -1 = system call error, or invalid timeout value
+ * 0 = specified timeout has elapsed
+ */
+int wait_ms(int timeout_ms)
+{
+#if !defined(MSDOS) && !defined(USE_WINSOCK)
+#ifndef HAVE_POLL_FINE
+ struct timeval pending_tv;
+#endif
+ struct timeval initial_tv;
+ int pending_ms;
+ int error;
+#endif
+ int r = 0;
+
+ if(!timeout_ms)
+ return 0;
+ if(timeout_ms < 0) {
+ SET_SOCKERRNO(EINVAL);
+ return -1;
+ }
+#if defined(MSDOS)
+ delay(timeout_ms);
+#elif defined(USE_WINSOCK)
+ Sleep(timeout_ms);
+#else
+ pending_ms = timeout_ms;
+ initial_tv = curlx_tvnow();
+ do {
+#if defined(HAVE_POLL_FINE)
+ r = poll(NULL, 0, pending_ms);
+#else
+ pending_tv.tv_sec = pending_ms / 1000;
+ pending_tv.tv_usec = (pending_ms % 1000) * 1000;
+ r = select(0, NULL, NULL, NULL, &pending_tv);
+#endif /* HAVE_POLL_FINE */
+ if(r != -1)
+ break;
+ error = SOCKERRNO;
+ if(error && (error != EINTR))
+ break;
+ pending_ms = timeout_ms - (int)curlx_tvdiff(curlx_tvnow(), initial_tv);
+ if(pending_ms <= 0)
+ break;
+ } while(r == -1);
+#endif /* USE_WINSOCK */
+ if(r)
+ r = -1;
+ return r;
+}
+
+int write_pidfile(const char *filename)
+{
+ FILE *pidfile;
+ long pid;
+
+ pid = (long)getpid();
+ pidfile = fopen(filename, "wb");
+ if(!pidfile) {
+ logmsg("Couldn't write pid file: %s %s", filename, strerror(ERRNO));
+ return 0; /* fail */
+ }
+ fprintf(pidfile, "%ld\n", pid);
+ fclose(pidfile);
+ logmsg("Wrote pid %ld to %s", pid, filename);
+ return 1; /* success */
+}
+
+void set_advisor_read_lock(const char *filename)
+{
+ FILE *lockfile;
+ int error = 0;
+ int res;
+
+ do {
+ lockfile = fopen(filename, "wb");
+ } while((lockfile == NULL) && ((error = ERRNO) == EINTR));
+ if(lockfile == NULL) {
+ logmsg("Error creating lock file %s error: %d %s",
+ filename, error, strerror(error));
+ return;
+ }
+
+ do {
+ res = fclose(lockfile);
+ } while(res && ((error = ERRNO) == EINTR));
+ if(res)
+ logmsg("Error closing lock file %s error: %d %s",
+ filename, error, strerror(error));
+}
+
+void clear_advisor_read_lock(const char *filename)
+{
+ int error = 0;
+ int res;
+
+ /*
+ ** Log all removal failures. Even those due to file not existing.
+ ** This allows to detect if unexpectedly the file has already been
+ ** removed by a process different than the one that should do this.
+ */
+
+ do {
+ res = unlink(filename);
+ } while(res && ((error = ERRNO) == EINTR));
+ if(res)
+ logmsg("Error removing lock file %s error: %d %s",
+ filename, error, strerror(error));
+}
diff --git a/tests/server/util.h b/tests/server/util.h
new file mode 100644
index 000000000..76cd88d16
--- /dev/null
+++ b/tests/server/util.h
@@ -0,0 +1,64 @@
+#ifndef __SERVER_UTIL_H
+#define __SERVER_UTIL_H
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+
+void logmsg(const char *msg, ...);
+
+#define TEST_DATA_PATH "%s/data/test%ld"
+
+#define SERVERLOGS_LOCK "log/serverlogs.lock"
+
+/* global variable, where to find the 'data' dir */
+extern const char *path;
+
+/* global variable, log file name */
+extern const char *serverlogfile;
+
+#ifdef WIN32
+#include <process.h>
+#include <fcntl.h>
+
+#define sleep(sec) Sleep ((sec)*1000)
+
+#undef perror
+#define perror(m) win32_perror(m)
+void win32_perror (const char *msg);
+#endif /* WIN32 */
+
+#ifdef USE_WINSOCK
+void win32_init(void);
+void win32_cleanup(void);
+#endif /* USE_WINSOCK */
+
+/* returns the path name to the test case file */
+char *test2file(long testno);
+
+int wait_ms(int timeout_ms);
+
+int write_pidfile(const char *filename);
+
+void set_advisor_read_lock(const char *filename);
+
+void clear_advisor_read_lock(const char *filename);
+
+#endif /* __SERVER_UTIL_H */
diff --git a/tests/serverhelp.pm b/tests/serverhelp.pm
new file mode 100644
index 000000000..34b155d0e
--- /dev/null
+++ b/tests/serverhelp.pm
@@ -0,0 +1,237 @@
+#***************************************************************************
+# _ _ ____ _
+# Project ___| | | | _ \| |
+# / __| | | | |_) | |
+# | (__| |_| | _ <| |___
+# \___|\___/|_| \_\_____|
+#
+# Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+#
+# This software is licensed as described in the file COPYING, which
+# you should have received as part of this distribution. The terms
+# are also available at http://curl.haxx.se/docs/copyright.html.
+#
+# You may opt to use, copy, modify, merge, publish, distribute and/or sell
+# copies of the Software, and permit persons to whom the Software is
+# furnished to do so, under the terms of the COPYING file.
+#
+# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+# KIND, either express or implied.
+#
+#***************************************************************************
+
+package serverhelp;
+
+use strict;
+use warnings;
+use Exporter;
+
+
+#***************************************************************************
+# Global symbols allowed without explicit package name
+#
+use vars qw(
+ @ISA
+ @EXPORT_OK
+ );
+
+
+#***************************************************************************
+# Inherit Exporter's capabilities
+#
+@ISA = qw(Exporter);
+
+
+#***************************************************************************
+# Global symbols this module will export upon request
+#
+@EXPORT_OK = qw(
+ serverfactors
+ servername_id
+ servername_str
+ servername_canon
+ server_pidfilename
+ server_logfilename
+ server_cmdfilename
+ server_inputfilename
+ server_outputfilename
+ mainsockf_pidfilename
+ mainsockf_logfilename
+ datasockf_pidfilename
+ datasockf_logfilename
+ );
+
+
+#***************************************************************************
+# Return server characterization factors given a server id string.
+#
+sub serverfactors {
+ my $server = $_[0];
+ my $proto;
+ my $ipvnum;
+ my $idnum;
+
+ if($server =~ /^((ftp|http|imap|pop3|smtp)s?)(\d*)(-ipv6|)$/) {
+ $proto = $1;
+ $idnum = ($3 && ($3 > 1)) ? $3 : 1;
+ $ipvnum = ($4 && ($4 =~ /6$/)) ? 6 : 4;
+ }
+ elsif($server =~ /^(tftp|sftp|socks|ssh|rtsp)(\d*)(-ipv6|)$/) {
+ $proto = $1;
+ $idnum = ($2 && ($2 > 1)) ? $2 : 1;
+ $ipvnum = ($3 && ($3 =~ /6$/)) ? 6 : 4;
+ }
+ else {
+ die "invalid server id: $server"
+ }
+ return($proto, $ipvnum, $idnum);
+}
+
+
+#***************************************************************************
+# Return server name string formatted for presentation purposes
+#
+sub servername_str {
+ my ($proto, $ipver, $idnum) = @_;
+
+ $proto = uc($proto) if($proto);
+ die "unsupported protocol: $proto" unless($proto &&
+ ($proto =~ /^(((FTP|HTTP|IMAP|POP3|SMTP)S?)|(TFTP|SFTP|SOCKS|SSH|RTSP|GOPHER))$/));
+
+ $ipver = (not $ipver) ? 'ipv4' : lc($ipver);
+ die "unsupported IP version: $ipver" unless($ipver &&
+ ($ipver =~ /^(4|6|ipv4|ipv6|-ipv4|-ipv6)$/));
+ $ipver = ($ipver =~ /6$/) ? '-IPv6' : '';
+
+ $idnum = 1 if(not $idnum);
+ die "unsupported ID number: $idnum" unless($idnum &&
+ ($idnum =~ /^(\d+)$/));
+ $idnum = '' unless($idnum > 1);
+
+ return "${proto}${idnum}${ipver}";
+}
+
+
+#***************************************************************************
+# Return server name string formatted for identification purposes
+#
+sub servername_id {
+ my ($proto, $ipver, $idnum) = @_;
+ return lc(servername_str($proto, $ipver, $idnum));
+}
+
+
+#***************************************************************************
+# Return server name string formatted for file name purposes
+#
+sub servername_canon {
+ my ($proto, $ipver, $idnum) = @_;
+ my $string = lc(servername_str($proto, $ipver, $idnum));
+ $string =~ tr/-/_/;
+ return $string;
+}
+
+
+#***************************************************************************
+# Return file name for server pid file.
+#
+sub server_pidfilename {
+ my ($proto, $ipver, $idnum) = @_;
+ my $trailer = '_server.pid';
+ return '.'. servername_canon($proto, $ipver, $idnum) ."$trailer";
+}
+
+
+#***************************************************************************
+# Return file name for server log file.
+#
+sub server_logfilename {
+ my ($logdir, $proto, $ipver, $idnum) = @_;
+ my $trailer = '_server.log';
+ $trailer = '_stunnel.log' if(lc($proto) =~ /^(ftp|http|imap|pop3|smtp)s$/);
+ return "${logdir}/". servername_canon($proto, $ipver, $idnum) ."$trailer";
+}
+
+
+#***************************************************************************
+# Return file name for server commands file.
+#
+sub server_cmdfilename {
+ my ($logdir, $proto, $ipver, $idnum) = @_;
+ my $trailer = '_server.cmd';
+ return "${logdir}/". servername_canon($proto, $ipver, $idnum) ."$trailer";
+}
+
+
+#***************************************************************************
+# Return file name for server input file.
+#
+sub server_inputfilename {
+ my ($logdir, $proto, $ipver, $idnum) = @_;
+ my $trailer = '_server.input';
+ return "${logdir}/". servername_canon($proto, $ipver, $idnum) ."$trailer";
+}
+
+
+#***************************************************************************
+# Return file name for server output file.
+#
+sub server_outputfilename {
+ my ($logdir, $proto, $ipver, $idnum) = @_;
+ my $trailer = '_server.output';
+ return "${logdir}/". servername_canon($proto, $ipver, $idnum) ."$trailer";
+}
+
+
+#***************************************************************************
+# Return file name for main or primary sockfilter pid file.
+#
+sub mainsockf_pidfilename {
+ my ($proto, $ipver, $idnum) = @_;
+ die "unsupported protocol: $proto" unless($proto &&
+ (lc($proto) =~ /^(ftp|imap|pop3|smtp)s?$/));
+ my $trailer = (lc($proto) =~ /^ftps?$/) ? '_sockctrl.pid':'_sockfilt.pid';
+ return '.'. servername_canon($proto, $ipver, $idnum) ."$trailer";
+}
+
+
+#***************************************************************************
+# Return file name for main or primary sockfilter log file.
+#
+sub mainsockf_logfilename {
+ my ($logdir, $proto, $ipver, $idnum) = @_;
+ die "unsupported protocol: $proto" unless($proto &&
+ (lc($proto) =~ /^(ftp|imap|pop3|smtp)s?$/));
+ my $trailer = (lc($proto) =~ /^ftps?$/) ? '_sockctrl.log':'_sockfilt.log';
+ return "${logdir}/". servername_canon($proto, $ipver, $idnum) ."$trailer";
+}
+
+
+#***************************************************************************
+# Return file name for data or secondary sockfilter pid file.
+#
+sub datasockf_pidfilename {
+ my ($proto, $ipver, $idnum) = @_;
+ die "unsupported protocol: $proto" unless($proto &&
+ (lc($proto) =~ /^ftps?$/));
+ my $trailer = '_sockdata.pid';
+ return '.'. servername_canon($proto, $ipver, $idnum) ."$trailer";
+}
+
+
+#***************************************************************************
+# Return file name for data or secondary sockfilter log file.
+#
+sub datasockf_logfilename {
+ my ($logdir, $proto, $ipver, $idnum) = @_;
+ die "unsupported protocol: $proto" unless($proto &&
+ (lc($proto) =~ /^ftps?$/));
+ my $trailer = '_sockdata.log';
+ return "${logdir}/". servername_canon($proto, $ipver, $idnum) ."$trailer";
+}
+
+
+#***************************************************************************
+# End of library
+1;
+
diff --git a/tests/sshhelp.pm b/tests/sshhelp.pm
new file mode 100644
index 000000000..18de9d3ec
--- /dev/null
+++ b/tests/sshhelp.pm
@@ -0,0 +1,388 @@
+#***************************************************************************
+# _ _ ____ _
+# Project ___| | | | _ \| |
+# / __| | | | |_) | |
+# | (__| |_| | _ <| |___
+# \___|\___/|_| \_\_____|
+#
+# Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+#
+# This software is licensed as described in the file COPYING, which
+# you should have received as part of this distribution. The terms
+# are also available at http://curl.haxx.se/docs/copyright.html.
+#
+# You may opt to use, copy, modify, merge, publish, distribute and/or sell
+# copies of the Software, and permit persons to whom the Software is
+# furnished to do so, under the terms of the COPYING file.
+#
+# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+# KIND, either express or implied.
+#
+#***************************************************************************
+
+package sshhelp;
+
+use strict;
+use warnings;
+use Exporter;
+use File::Spec;
+
+
+#***************************************************************************
+# Global symbols allowed without explicit package name
+#
+use vars qw(
+ @ISA
+ @EXPORT_OK
+ $sshdexe
+ $sshexe
+ $sftpsrvexe
+ $sftpexe
+ $sshkeygenexe
+ $sshdconfig
+ $sshconfig
+ $sftpconfig
+ $knownhosts
+ $sshdlog
+ $sshlog
+ $sftplog
+ $sftpcmds
+ $hstprvkeyf
+ $hstpubkeyf
+ $cliprvkeyf
+ $clipubkeyf
+ @sftppath
+ );
+
+
+#***************************************************************************
+# Inherit Exporter's capabilities
+#
+@ISA = qw(Exporter);
+
+
+#***************************************************************************
+# Global symbols this module will export upon request
+#
+@EXPORT_OK = qw(
+ $sshdexe
+ $sshexe
+ $sftpsrvexe
+ $sftpexe
+ $sshkeygenexe
+ $sshdconfig
+ $sshconfig
+ $sftpconfig
+ $knownhosts
+ $sshdlog
+ $sshlog
+ $sftplog
+ $sftpcmds
+ $hstprvkeyf
+ $hstpubkeyf
+ $cliprvkeyf
+ $clipubkeyf
+ display_sshdconfig
+ display_sshconfig
+ display_sftpconfig
+ display_sshdlog
+ display_sshlog
+ display_sftplog
+ dump_array
+ exe_ext
+ find_sshd
+ find_ssh
+ find_sftpsrv
+ find_sftp
+ find_sshkeygen
+ logmsg
+ sshversioninfo
+ );
+
+
+#***************************************************************************
+# Global variables initialization
+#
+$sshdexe = 'sshd' .exe_ext(); # base name and ext of ssh daemon
+$sshexe = 'ssh' .exe_ext(); # base name and ext of ssh client
+$sftpsrvexe = 'sftp-server' .exe_ext(); # base name and ext of sftp-server
+$sftpexe = 'sftp' .exe_ext(); # base name and ext of sftp client
+$sshkeygenexe = 'ssh-keygen' .exe_ext(); # base name and ext of ssh-keygen
+$sshdconfig = 'curl_sshd_config'; # ssh daemon config file
+$sshconfig = 'curl_ssh_config'; # ssh client config file
+$sftpconfig = 'curl_sftp_config'; # sftp client config file
+$sshdlog = undef; # ssh daemon log file
+$sshlog = undef; # ssh client log file
+$sftplog = undef; # sftp client log file
+$sftpcmds = 'curl_sftp_cmds'; # sftp client commands batch file
+$knownhosts = 'curl_client_knownhosts'; # ssh knownhosts file
+$hstprvkeyf = 'curl_host_dsa_key'; # host private key file
+$hstpubkeyf = 'curl_host_dsa_key.pub'; # host public key file
+$cliprvkeyf = 'curl_client_key'; # client private key file
+$clipubkeyf = 'curl_client_key.pub'; # client public key file
+
+
+#***************************************************************************
+# Absolute paths where to look for sftp-server plugin
+#
+@sftppath = qw(
+ /usr/lib/openssh
+ /usr/libexec/openssh
+ /usr/libexec
+ /usr/local/libexec
+ /opt/local/libexec
+ /usr/lib/ssh
+ /usr/libexec/ssh
+ /usr/sbin
+ /usr/lib
+ /usr/lib/ssh/openssh
+ /usr/lib64/ssh
+ /usr/lib64/misc
+ /usr/lib/misc
+ /usr/local/sbin
+ /usr/freeware/bin
+ /usr/freeware/sbin
+ /usr/freeware/libexec
+ /opt/ssh/sbin
+ /opt/ssh/libexec
+ );
+
+
+#***************************************************************************
+# Return file extension for executable files on this operating system
+#
+sub exe_ext {
+ if ($^O eq 'MSWin32' || $^O eq 'cygwin' || $^O eq 'msys' ||
+ $^O eq 'dos' || $^O eq 'os2') {
+ return '.exe';
+ }
+}
+
+
+#***************************************************************************
+# Create or overwrite the given file with lines from an array of strings
+#
+sub dump_array {
+ my ($filename, @arr) = @_;
+ my $error;
+
+ if(!$filename) {
+ $error = 'Error: Missing argument 1 for dump_array()';
+ }
+ elsif(open(TEXTFH, ">$filename")) {
+ foreach my $line (@arr) {
+ $line .= "\n" unless($line =~ /\n$/);
+ print TEXTFH $line;
+ }
+ if(!close(TEXTFH)) {
+ $error = "Error: cannot close file $filename";
+ }
+ }
+ else {
+ $error = "Error: cannot write file $filename";
+ }
+ return $error;
+}
+
+
+#***************************************************************************
+# Display a message
+#
+sub logmsg {
+ my ($line) = @_;
+ chomp $line if($line);
+ $line .= "\n";
+ print "$line";
+}
+
+
+#***************************************************************************
+# Display contents of the given file
+#
+sub display_file {
+ my $filename = $_[0];
+ print "=== Start of file $filename\n";
+ if(open(DISPLAYFH, "<$filename")) {
+ while(my $line = <DISPLAYFH>) {
+ print "$line";
+ }
+ close DISPLAYFH;
+ }
+ print "=== End of file $filename\n";
+}
+
+
+#***************************************************************************
+# Display contents of the ssh daemon config file
+#
+sub display_sshdconfig {
+ display_file($sshdconfig);
+}
+
+
+#***************************************************************************
+# Display contents of the ssh client config file
+#
+sub display_sshconfig {
+ display_file($sshconfig);
+}
+
+
+#***************************************************************************
+# Display contents of the sftp client config file
+#
+sub display_sftpconfig {
+ display_file($sftpconfig);
+}
+
+
+#***************************************************************************
+# Display contents of the ssh daemon log file
+#
+sub display_sshdlog {
+ die "error: \$sshdlog uninitialized" if(not defined $sshdlog);
+ display_file($sshdlog);
+}
+
+
+#***************************************************************************
+# Display contents of the ssh client log file
+#
+sub display_sshlog {
+ die "error: \$sshlog uninitialized" if(not defined $sshlog);
+ display_file($sshlog);
+}
+
+
+#***************************************************************************
+# Display contents of the sftp client log file
+#
+sub display_sftplog {
+ die "error: \$sftplog uninitialized" if(not defined $sftplog);
+ display_file($sftplog);
+}
+
+
+#***************************************************************************
+# Find a file somewhere in the given path
+#
+sub find_file {
+ my $fn = $_[0];
+ shift;
+ my @path = @_;
+ foreach (@path) {
+ my $file = File::Spec->catfile($_, $fn);
+ if(-e $file) {
+ return $file;
+ }
+ }
+}
+
+
+#***************************************************************************
+# Find a file in environment path or in our sftppath
+#
+sub find_sfile {
+ my $filename = $_[0];
+ my @spath;
+ push(@spath, File::Spec->path());
+ push(@spath, @sftppath);
+ return find_file($filename, @spath);
+}
+
+
+#***************************************************************************
+# Find ssh daemon and return canonical filename
+#
+sub find_sshd {
+ return find_sfile($sshdexe);
+}
+
+
+#***************************************************************************
+# Find ssh client and return canonical filename
+#
+sub find_ssh {
+ return find_sfile($sshexe);
+}
+
+
+#***************************************************************************
+# Find sftp-server plugin and return canonical filename
+#
+sub find_sftpsrv {
+ return find_sfile($sftpsrvexe);
+}
+
+
+#***************************************************************************
+# Find sftp client and return canonical filename
+#
+sub find_sftp {
+ return find_sfile($sftpexe);
+}
+
+
+#***************************************************************************
+# Find ssh-keygen and return canonical filename
+#
+sub find_sshkeygen {
+ return find_sfile($sshkeygenexe);
+}
+
+
+#***************************************************************************
+# Return version info for the given ssh client or server binaries
+#
+sub sshversioninfo {
+ my $sshbin = $_[0]; # canonical filename
+ my $major;
+ my $minor;
+ my $patch;
+ my $sshid;
+ my $versnum;
+ my $versstr;
+ my $error;
+
+ if(!$sshbin) {
+ $error = 'Error: Missing argument 1 for sshversioninfo()';
+ }
+ elsif(! -x $sshbin) {
+ $error = "Error: cannot read or execute $sshbin";
+ }
+ else {
+ my $cmd = ($sshbin =~ /$sshdexe$/) ? "$sshbin -?" : "$sshbin -V";
+ $error = "$cmd\n";
+ foreach my $tmpstr (qx($cmd 2>&1)) {
+ if($tmpstr =~ /OpenSSH[_-](\d+)\.(\d+)(\.(\d+))*/i) {
+ $major = $1;
+ $minor = $2;
+ $patch = $4?$4:0;
+ $sshid = 'OpenSSH';
+ $versnum = (100*$major) + (10*$minor) + $patch;
+ $versstr = "$sshid $major.$minor.$patch";
+ $error = undef;
+ last;
+ }
+ if($tmpstr =~ /Sun[_-]SSH[_-](\d+)\.(\d+)(\.(\d+))*/i) {
+ $major = $1;
+ $minor = $2;
+ $patch = $4?$4:0;
+ $sshid = 'SunSSH';
+ $versnum = (100*$major) + (10*$minor) + $patch;
+ $versstr = "$sshid $major.$minor.$patch";
+ $error = undef;
+ last;
+ }
+ $error .= $tmpstr;
+ }
+ chomp $error if($error);
+ }
+ return ($sshid, $versnum, $versstr, $error);
+}
+
+
+#***************************************************************************
+# End of library
+1;
+
diff --git a/tests/sshserver.pl b/tests/sshserver.pl
new file mode 100755
index 000000000..b4390158d
--- /dev/null
+++ b/tests/sshserver.pl
@@ -0,0 +1,1042 @@
+#!/usr/bin/env perl
+#***************************************************************************
+# _ _ ____ _
+# Project ___| | | | _ \| |
+# / __| | | | |_) | |
+# | (__| |_| | _ <| |___
+# \___|\___/|_| \_\_____|
+#
+# Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+#
+# This software is licensed as described in the file COPYING, which
+# you should have received as part of this distribution. The terms
+# are also available at http://curl.haxx.se/docs/copyright.html.
+#
+# You may opt to use, copy, modify, merge, publish, distribute and/or sell
+# copies of the Software, and permit persons to whom the Software is
+# furnished to do so, under the terms of the COPYING file.
+#
+# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+# KIND, either express or implied.
+#
+#***************************************************************************
+
+# Starts sshd for use in the SCP, SFTP and SOCKS curl test harness tests.
+# Also creates the ssh configuration files needed for these tests.
+
+use strict;
+use warnings;
+use Cwd;
+
+#***************************************************************************
+# Variables and subs imported from sshhelp module
+#
+use sshhelp qw(
+ $sshdexe
+ $sshexe
+ $sftpsrvexe
+ $sftpexe
+ $sshkeygenexe
+ $sshdconfig
+ $sshconfig
+ $sftpconfig
+ $knownhosts
+ $sshdlog
+ $sshlog
+ $sftplog
+ $sftpcmds
+ $hstprvkeyf
+ $hstpubkeyf
+ $cliprvkeyf
+ $clipubkeyf
+ display_sshdconfig
+ display_sshconfig
+ display_sftpconfig
+ display_sshdlog
+ display_sshlog
+ display_sftplog
+ dump_array
+ find_sshd
+ find_ssh
+ find_sftpsrv
+ find_sftp
+ find_sshkeygen
+ logmsg
+ sshversioninfo
+ );
+
+#***************************************************************************
+# Subs imported from serverhelp module
+#
+use serverhelp qw(
+ server_pidfilename
+ server_logfilename
+ );
+
+
+#***************************************************************************
+
+my $verbose = 0; # set to 1 for debugging
+my $debugprotocol = 0; # set to 1 for protocol debugging
+my $port = 8999; # our default SCP/SFTP server port
+my $socksport = $port + 1; # our default SOCKS4/5 server port
+my $listenaddr = '127.0.0.1'; # default address on which to listen
+my $ipvnum = 4; # default IP version of listener address
+my $idnum = 1; # dafault ssh daemon instance number
+my $proto = 'ssh'; # protocol the ssh daemon speaks
+my $path = getcwd(); # current working directory
+my $logdir = $path .'/log'; # directory for log files
+my $username = $ENV{USER}; # default user
+my $pidfile; # ssh daemon pid file
+
+my $error;
+my @cfgarr;
+
+
+#***************************************************************************
+# Parse command line options
+#
+while(@ARGV) {
+ if($ARGV[0] eq '--verbose') {
+ $verbose = 1;
+ }
+ elsif($ARGV[0] eq '--debugprotocol') {
+ $verbose = 1;
+ $debugprotocol = 1;
+ }
+ elsif($ARGV[0] eq '--user') {
+ if($ARGV[1]) {
+ $username = $ARGV[1];
+ shift @ARGV;
+ }
+ }
+ elsif($ARGV[0] eq '--id') {
+ if($ARGV[1]) {
+ if($ARGV[1] =~ /^(\d+)$/) {
+ $idnum = $1 if($1 > 0);
+ shift @ARGV;
+ }
+ }
+ }
+ elsif($ARGV[0] eq '--ipv4') {
+ $ipvnum = 4;
+ $listenaddr = '127.0.0.1' if($listenaddr eq '::1');
+ }
+ elsif($ARGV[0] eq '--ipv6') {
+ $ipvnum = 6;
+ $listenaddr = '::1' if($listenaddr eq '127.0.0.1');
+ }
+ elsif($ARGV[0] eq '--addr') {
+ if($ARGV[1]) {
+ my $tmpstr = $ARGV[1];
+ if($tmpstr =~ /^(\d\d?\d?)\.(\d\d?\d?)\.(\d\d?\d?)\.(\d\d?\d?)$/) {
+ $listenaddr = "$1.$2.$3.$4" if($ipvnum == 4);
+ shift @ARGV;
+ }
+ elsif($ipvnum == 6) {
+ $listenaddr = $tmpstr;
+ $listenaddr =~ s/^\[(.*)\]$/$1/;
+ shift @ARGV;
+ }
+ }
+ }
+ elsif($ARGV[0] eq '--pidfile') {
+ if($ARGV[1]) {
+ $pidfile = "$path/". $ARGV[1];
+ shift @ARGV;
+ }
+ }
+ elsif($ARGV[0] eq '--sshport') {
+ if($ARGV[1]) {
+ if($ARGV[1] =~ /^(\d+)$/) {
+ $port = $1;
+ shift @ARGV;
+ }
+ }
+ }
+ elsif($ARGV[0] eq '--socksport') {
+ if($ARGV[1]) {
+ if($ARGV[1] =~ /^(\d+)$/) {
+ $socksport = $1;
+ shift @ARGV;
+ }
+ }
+ }
+ else {
+ print STDERR "\nWarning: sshserver.pl unknown parameter: $ARGV[0]\n";
+ }
+ shift @ARGV;
+}
+
+
+#***************************************************************************
+# Default ssh daemon pid file name
+#
+if(!$pidfile) {
+ $pidfile = "$path/". server_pidfilename($proto, $ipvnum, $idnum);
+}
+
+
+#***************************************************************************
+# ssh, socks and sftp server log file names
+#
+$sshdlog = server_logfilename($logdir, 'ssh', $ipvnum, $idnum);
+$sftplog = server_logfilename($logdir, 'sftp', $ipvnum, $idnum);
+$sshlog = server_logfilename($logdir, 'socks', $ipvnum, $idnum);
+
+
+#***************************************************************************
+# Logging level for ssh server and client
+#
+my $loglevel = $debugprotocol?'DEBUG3':'DEBUG2';
+
+
+#***************************************************************************
+# Validate username
+#
+if(!$username) {
+ $error = 'Will not run ssh server without a user name';
+}
+elsif($username eq 'root') {
+ $error = 'Will not run ssh server as root to mitigate security risks';
+}
+if($error) {
+ logmsg $error;
+ exit 1;
+}
+
+
+#***************************************************************************
+# Find out ssh daemon canonical file name
+#
+my $sshd = find_sshd();
+if(!$sshd) {
+ logmsg "cannot find $sshdexe";
+ exit 1;
+}
+
+
+#***************************************************************************
+# Find out ssh daemon version info
+#
+my ($sshdid, $sshdvernum, $sshdverstr, $sshderror) = sshversioninfo($sshd);
+if(!$sshdid) {
+ # Not an OpenSSH or SunSSH ssh daemon
+ logmsg $sshderror if($verbose);
+ logmsg 'SCP, SFTP and SOCKS tests require OpenSSH 2.9.9 or later';
+ exit 1;
+}
+logmsg "ssh server found $sshd is $sshdverstr" if($verbose);
+
+
+#***************************************************************************
+# ssh daemon command line options we might use and version support
+#
+# -e: log stderr : OpenSSH 2.9.0 and later
+# -f: sshd config file : OpenSSH 1.2.1 and later
+# -D: no daemon forking : OpenSSH 2.5.0 and later
+# -o: command-line option : OpenSSH 3.1.0 and later
+# -t: test config file : OpenSSH 2.9.9 and later
+# -?: sshd version info : OpenSSH 1.2.1 and later
+#
+# -e: log stderr : SunSSH 1.0.0 and later
+# -f: sshd config file : SunSSH 1.0.0 and later
+# -D: no daemon forking : SunSSH 1.0.0 and later
+# -o: command-line option : SunSSH 1.0.0 and later
+# -t: test config file : SunSSH 1.0.0 and later
+# -?: sshd version info : SunSSH 1.0.0 and later
+
+
+#***************************************************************************
+# Verify minimum ssh daemon version
+#
+if((($sshdid =~ /OpenSSH/) && ($sshdvernum < 299)) ||
+ (($sshdid =~ /SunSSH/) && ($sshdvernum < 100))) {
+ logmsg 'SCP, SFTP and SOCKS tests require OpenSSH 2.9.9 or later';
+ exit 1;
+}
+
+
+#***************************************************************************
+# Find out sftp server plugin canonical file name
+#
+my $sftpsrv = find_sftpsrv();
+if(!$sftpsrv) {
+ logmsg "cannot find $sftpsrvexe";
+ exit 1;
+}
+logmsg "sftp server plugin found $sftpsrv" if($verbose);
+
+
+#***************************************************************************
+# Find out sftp client canonical file name
+#
+my $sftp = find_sftp();
+if(!$sftp) {
+ logmsg "cannot find $sftpexe";
+ exit 1;
+}
+logmsg "sftp client found $sftp" if($verbose);
+
+
+#***************************************************************************
+# Find out ssh keygen canonical file name
+#
+my $sshkeygen = find_sshkeygen();
+if(!$sshkeygen) {
+ logmsg "cannot find $sshkeygenexe";
+ exit 1;
+}
+logmsg "ssh keygen found $sshkeygen" if($verbose);
+
+
+#***************************************************************************
+# Find out ssh client canonical file name
+#
+my $ssh = find_ssh();
+if(!$ssh) {
+ logmsg "cannot find $sshexe";
+ exit 1;
+}
+
+
+#***************************************************************************
+# Find out ssh client version info
+#
+my ($sshid, $sshvernum, $sshverstr, $ssherror) = sshversioninfo($ssh);
+if(!$sshid) {
+ # Not an OpenSSH or SunSSH ssh client
+ logmsg $ssherror if($verbose);
+ logmsg 'SCP, SFTP and SOCKS tests require OpenSSH 2.9.9 or later';
+ exit 1;
+}
+logmsg "ssh client found $ssh is $sshverstr" if($verbose);
+
+
+#***************************************************************************
+# ssh client command line options we might use and version support
+#
+# -D: dynamic app port forwarding : OpenSSH 2.9.9 and later
+# -F: ssh config file : OpenSSH 2.9.9 and later
+# -N: no shell/command : OpenSSH 2.1.0 and later
+# -p: connection port : OpenSSH 1.2.1 and later
+# -v: verbose messages : OpenSSH 1.2.1 and later
+# -vv: increase verbosity : OpenSSH 2.3.0 and later
+# -V: ssh version info : OpenSSH 1.2.1 and later
+#
+# -D: dynamic app port forwarding : SunSSH 1.0.0 and later
+# -F: ssh config file : SunSSH 1.0.0 and later
+# -N: no shell/command : SunSSH 1.0.0 and later
+# -p: connection port : SunSSH 1.0.0 and later
+# -v: verbose messages : SunSSH 1.0.0 and later
+# -vv: increase verbosity : SunSSH 1.0.0 and later
+# -V: ssh version info : SunSSH 1.0.0 and later
+
+
+#***************************************************************************
+# Verify minimum ssh client version
+#
+if((($sshid =~ /OpenSSH/) && ($sshvernum < 299)) ||
+ (($sshid =~ /SunSSH/) && ($sshvernum < 100))) {
+ logmsg 'SCP, SFTP and SOCKS tests require OpenSSH 2.9.9 or later';
+ exit 1;
+}
+
+
+#***************************************************************************
+# ssh keygen command line options we actually use and version support
+#
+# -C: identity comment : OpenSSH 1.2.1 and later
+# -f: key filename : OpenSSH 1.2.1 and later
+# -N: new passphrase : OpenSSH 1.2.1 and later
+# -q: quiet keygen : OpenSSH 1.2.1 and later
+# -t: key type : OpenSSH 2.5.0 and later
+#
+# -C: identity comment : SunSSH 1.0.0 and later
+# -f: key filename : SunSSH 1.0.0 and later
+# -N: new passphrase : SunSSH 1.0.0 and later
+# -q: quiet keygen : SunSSH 1.0.0 and later
+# -t: key type : SunSSH 1.0.0 and later
+
+
+#***************************************************************************
+# Generate host and client key files for curl's tests
+#
+if((! -e $hstprvkeyf) || (! -e $hstpubkeyf) ||
+ (! -e $cliprvkeyf) || (! -e $clipubkeyf)) {
+ # Make sure all files are gone so ssh-keygen doesn't complain
+ unlink($hstprvkeyf, $hstpubkeyf, $cliprvkeyf, $clipubkeyf);
+ logmsg 'generating host keys...' if($verbose);
+ if(system "$sshkeygen -q -t dsa -f $hstprvkeyf -C 'curl test server' -N ''") {
+ logmsg 'Could not generate host key';
+ exit 1;
+ }
+ logmsg 'generating client keys...' if($verbose);
+ if(system "$sshkeygen -q -t dsa -f $cliprvkeyf -C 'curl test client' -N ''") {
+ logmsg 'Could not generate client key';
+ exit 1;
+ }
+}
+
+
+#***************************************************************************
+# ssh daemon configuration file options we might use and version support
+#
+# AFSTokenPassing : OpenSSH 1.2.1 and later [1]
+# AcceptEnv : OpenSSH 3.9.0 and later
+# AddressFamily : OpenSSH 4.0.0 and later
+# AllowGroups : OpenSSH 1.2.1 and later
+# AllowTcpForwarding : OpenSSH 2.3.0 and later
+# AllowUsers : OpenSSH 1.2.1 and later
+# AuthorizedKeysFile : OpenSSH 2.9.9 and later
+# AuthorizedKeysFile2 : OpenSSH 2.9.9 and later
+# Banner : OpenSSH 2.5.0 and later
+# ChallengeResponseAuthentication : OpenSSH 2.5.0 and later
+# Ciphers : OpenSSH 2.1.0 and later [3]
+# ClientAliveCountMax : OpenSSH 2.9.0 and later
+# ClientAliveInterval : OpenSSH 2.9.0 and later
+# Compression : OpenSSH 3.3.0 and later
+# DenyGroups : OpenSSH 1.2.1 and later
+# DenyUsers : OpenSSH 1.2.1 and later
+# ForceCommand : OpenSSH 4.4.0 and later [3]
+# GatewayPorts : OpenSSH 2.1.0 and later
+# GSSAPIAuthentication : OpenSSH 3.7.0 and later [1]
+# GSSAPICleanupCredentials : OpenSSH 3.8.0 and later [1]
+# GSSAPIKeyExchange : SunSSH 1.0.0 and later [1]
+# GSSAPIStoreDelegatedCredentials : SunSSH 1.0.0 and later [1]
+# GSSCleanupCreds : SunSSH 1.0.0 and later [1]
+# GSSUseSessionCredCache : SunSSH 1.0.0 and later [1]
+# HostbasedAuthentication : OpenSSH 2.9.0 and later
+# HostbasedUsesNameFromPacketOnly : OpenSSH 2.9.0 and later
+# HostKey : OpenSSH 1.2.1 and later
+# IgnoreRhosts : OpenSSH 1.2.1 and later
+# IgnoreUserKnownHosts : OpenSSH 1.2.1 and later
+# KbdInteractiveAuthentication : OpenSSH 2.3.0 and later
+# KeepAlive : OpenSSH 1.2.1 and later
+# KerberosAuthentication : OpenSSH 1.2.1 and later [1]
+# KerberosGetAFSToken : OpenSSH 3.8.0 and later [1]
+# KerberosOrLocalPasswd : OpenSSH 1.2.1 and later [1]
+# KerberosTgtPassing : OpenSSH 1.2.1 and later [1]
+# KerberosTicketCleanup : OpenSSH 1.2.1 and later [1]
+# KeyRegenerationInterval : OpenSSH 1.2.1 and later
+# ListenAddress : OpenSSH 1.2.1 and later
+# LoginGraceTime : OpenSSH 1.2.1 and later
+# LogLevel : OpenSSH 1.2.1 and later
+# LookupClientHostnames : SunSSH 1.0.0 and later
+# MACs : OpenSSH 2.5.0 and later [3]
+# Match : OpenSSH 4.4.0 and later [3]
+# MaxAuthTries : OpenSSH 3.9.0 and later
+# MaxStartups : OpenSSH 2.2.0 and later
+# PAMAuthenticationViaKbdInt : OpenSSH 2.9.0 and later [2]
+# PasswordAuthentication : OpenSSH 1.2.1 and later
+# PermitEmptyPasswords : OpenSSH 1.2.1 and later
+# PermitOpen : OpenSSH 4.4.0 and later [3]
+# PermitRootLogin : OpenSSH 1.2.1 and later
+# PermitTunnel : OpenSSH 4.3.0 and later
+# PermitUserEnvironment : OpenSSH 3.5.0 and later
+# PidFile : OpenSSH 2.1.0 and later
+# Port : OpenSSH 1.2.1 and later
+# PrintLastLog : OpenSSH 2.9.0 and later
+# PrintMotd : OpenSSH 1.2.1 and later
+# Protocol : OpenSSH 2.1.0 and later
+# PubkeyAuthentication : OpenSSH 2.5.0 and later
+# RhostsAuthentication : OpenSSH 1.2.1 and later
+# RhostsRSAAuthentication : OpenSSH 1.2.1 and later
+# RSAAuthentication : OpenSSH 1.2.1 and later
+# ServerKeyBits : OpenSSH 1.2.1 and later
+# SkeyAuthentication : OpenSSH 1.2.1 and later [1]
+# StrictModes : OpenSSH 1.2.1 and later
+# Subsystem : OpenSSH 2.2.0 and later
+# SyslogFacility : OpenSSH 1.2.1 and later
+# TCPKeepAlive : OpenSSH 3.8.0 and later
+# UseDNS : OpenSSH 3.7.0 and later
+# UseLogin : OpenSSH 1.2.1 and later
+# UsePAM : OpenSSH 3.7.0 and later [1][2]
+# UsePrivilegeSeparation : OpenSSH 3.2.2 and later
+# VerifyReverseMapping : OpenSSH 3.1.0 and later
+# X11DisplayOffset : OpenSSH 1.2.1 and later [3]
+# X11Forwarding : OpenSSH 1.2.1 and later
+# X11UseLocalhost : OpenSSH 3.1.0 and later
+# XAuthLocation : OpenSSH 2.1.1 and later [3]
+#
+# [1] Option only available if activated at compile time
+# [2] Option specific for portable versions
+# [3] Option not used in our ssh server config file
+
+
+#***************************************************************************
+# Initialize sshd config with options actually supported in OpenSSH 2.9.9
+#
+logmsg 'generating ssh server config file...' if($verbose);
+@cfgarr = ();
+push @cfgarr, '# This is a generated file. Do not edit.';
+push @cfgarr, "# $sshdverstr sshd configuration file for curl testing";
+push @cfgarr, '#';
+push @cfgarr, "DenyUsers !$username";
+push @cfgarr, "AllowUsers $username";
+push @cfgarr, 'DenyGroups';
+push @cfgarr, 'AllowGroups';
+push @cfgarr, '#';
+push @cfgarr, "AuthorizedKeysFile $path/$clipubkeyf";
+push @cfgarr, "AuthorizedKeysFile2 $path/$clipubkeyf";
+push @cfgarr, "HostKey $path/$hstprvkeyf";
+push @cfgarr, "PidFile $pidfile";
+push @cfgarr, '#';
+push @cfgarr, "Port $port";
+push @cfgarr, "ListenAddress $listenaddr";
+push @cfgarr, 'Protocol 2';
+push @cfgarr, '#';
+push @cfgarr, 'AllowTcpForwarding yes';
+push @cfgarr, 'Banner none';
+push @cfgarr, 'ChallengeResponseAuthentication no';
+push @cfgarr, 'ClientAliveCountMax 3';
+push @cfgarr, 'ClientAliveInterval 0';
+push @cfgarr, 'GatewayPorts no';
+push @cfgarr, 'HostbasedAuthentication no';
+push @cfgarr, 'HostbasedUsesNameFromPacketOnly no';
+push @cfgarr, 'IgnoreRhosts yes';
+push @cfgarr, 'IgnoreUserKnownHosts yes';
+push @cfgarr, 'KeyRegenerationInterval 0';
+push @cfgarr, 'LoginGraceTime 30';
+push @cfgarr, "LogLevel $loglevel";
+push @cfgarr, 'MaxStartups 5';
+push @cfgarr, 'PasswordAuthentication no';
+push @cfgarr, 'PermitEmptyPasswords no';
+push @cfgarr, 'PermitRootLogin no';
+push @cfgarr, 'PrintLastLog no';
+push @cfgarr, 'PrintMotd no';
+push @cfgarr, 'PubkeyAuthentication yes';
+push @cfgarr, 'RhostsRSAAuthentication no';
+push @cfgarr, 'RSAAuthentication no';
+push @cfgarr, 'ServerKeyBits 768';
+push @cfgarr, 'StrictModes no';
+push @cfgarr, "Subsystem sftp $sftpsrv";
+push @cfgarr, 'SyslogFacility AUTH';
+push @cfgarr, 'UseLogin no';
+push @cfgarr, 'X11Forwarding no';
+push @cfgarr, '#';
+
+
+#***************************************************************************
+# Write out initial sshd configuration file for curl's tests
+#
+$error = dump_array($sshdconfig, @cfgarr);
+if($error) {
+ logmsg $error;
+ exit 1;
+}
+
+
+#***************************************************************************
+# Verifies at run time if sshd supports a given configuration file option
+#
+sub sshd_supports_opt {
+ my ($option, $value) = @_;
+ my $err;
+ #
+ if((($sshdid =~ /OpenSSH/) && ($sshdvernum >= 310)) ||
+ ($sshdid =~ /SunSSH/)) {
+ # ssh daemon supports command line options -t -f and -o
+ $err = grep /((Unsupported)|(Bad configuration)|(Deprecated)) option.*$option/,
+ qx($sshd -t -f $sshdconfig -o $option=$value 2>&1);
+ return !$err;
+ }
+ if(($sshdid =~ /OpenSSH/) && ($sshdvernum >= 299)) {
+ # ssh daemon supports command line options -t and -f
+ $err = dump_array($sshdconfig, (@cfgarr, "$option $value"));
+ if($err) {
+ logmsg $err;
+ return 0;
+ }
+ $err = grep /((Unsupported)|(Bad configuration)|(Deprecated)) option.*$option/,
+ qx($sshd -t -f $sshdconfig 2>&1);
+ unlink $sshdconfig;
+ return !$err;
+ }
+ return 0;
+}
+
+
+#***************************************************************************
+# Kerberos Authentication support may have not been built into sshd
+#
+if(sshd_supports_opt('KerberosAuthentication','no')) {
+ push @cfgarr, 'KerberosAuthentication no';
+}
+if(sshd_supports_opt('KerberosGetAFSToken','no')) {
+ push @cfgarr, 'KerberosGetAFSToken no';
+}
+if(sshd_supports_opt('KerberosOrLocalPasswd','no')) {
+ push @cfgarr, 'KerberosOrLocalPasswd no';
+}
+if(sshd_supports_opt('KerberosTgtPassing','no')) {
+ push @cfgarr, 'KerberosTgtPassing no';
+}
+if(sshd_supports_opt('KerberosTicketCleanup','yes')) {
+ push @cfgarr, 'KerberosTicketCleanup yes';
+}
+
+
+#***************************************************************************
+# Andrew File System support may have not been built into sshd
+#
+if(sshd_supports_opt('AFSTokenPassing','no')) {
+ push @cfgarr, 'AFSTokenPassing no';
+}
+
+
+#***************************************************************************
+# S/Key authentication support may have not been built into sshd
+#
+if(sshd_supports_opt('SkeyAuthentication','no')) {
+ push @cfgarr, 'SkeyAuthentication no';
+}
+
+
+#***************************************************************************
+# GSSAPI Authentication support may have not been built into sshd
+#
+my $sshd_builtwith_GSSAPI;
+if(sshd_supports_opt('GSSAPIAuthentication','no')) {
+ push @cfgarr, 'GSSAPIAuthentication no';
+ $sshd_builtwith_GSSAPI = 1;
+}
+if(sshd_supports_opt('GSSAPICleanupCredentials','yes')) {
+ push @cfgarr, 'GSSAPICleanupCredentials yes';
+}
+if(sshd_supports_opt('GSSAPIKeyExchange','no')) {
+ push @cfgarr, 'GSSAPIKeyExchange no';
+}
+if(sshd_supports_opt('GSSAPIStoreDelegatedCredentials','no')) {
+ push @cfgarr, 'GSSAPIStoreDelegatedCredentials no';
+}
+if(sshd_supports_opt('GSSCleanupCreds','yes')) {
+ push @cfgarr, 'GSSCleanupCreds yes';
+}
+if(sshd_supports_opt('GSSUseSessionCredCache','no')) {
+ push @cfgarr, 'GSSUseSessionCredCache no';
+}
+push @cfgarr, '#';
+
+
+#***************************************************************************
+# Options that might be supported or not in sshd OpenSSH 2.9.9 and later
+#
+if(sshd_supports_opt('AcceptEnv','')) {
+ push @cfgarr, 'AcceptEnv';
+}
+if(sshd_supports_opt('AddressFamily','any')) {
+ # Address family must be specified before ListenAddress
+ splice @cfgarr, 14, 0, 'AddressFamily any';
+}
+if(sshd_supports_opt('Compression','no')) {
+ push @cfgarr, 'Compression no';
+}
+if(sshd_supports_opt('KbdInteractiveAuthentication','no')) {
+ push @cfgarr, 'KbdInteractiveAuthentication no';
+}
+if(sshd_supports_opt('KeepAlive','no')) {
+ push @cfgarr, 'KeepAlive no';
+}
+if(sshd_supports_opt('LookupClientHostnames','no')) {
+ push @cfgarr, 'LookupClientHostnames no';
+}
+if(sshd_supports_opt('MaxAuthTries','10')) {
+ push @cfgarr, 'MaxAuthTries 10';
+}
+if(sshd_supports_opt('PAMAuthenticationViaKbdInt','no')) {
+ push @cfgarr, 'PAMAuthenticationViaKbdInt no';
+}
+if(sshd_supports_opt('PermitTunnel','no')) {
+ push @cfgarr, 'PermitTunnel no';
+}
+if(sshd_supports_opt('PermitUserEnvironment','no')) {
+ push @cfgarr, 'PermitUserEnvironment no';
+}
+if(sshd_supports_opt('RhostsAuthentication','no')) {
+ push @cfgarr, 'RhostsAuthentication no';
+}
+if(sshd_supports_opt('TCPKeepAlive','no')) {
+ push @cfgarr, 'TCPKeepAlive no';
+}
+if(sshd_supports_opt('UseDNS','no')) {
+ push @cfgarr, 'UseDNS no';
+}
+if(sshd_supports_opt('UsePAM','no')) {
+ push @cfgarr, 'UsePAM no';
+}
+
+if($sshdid =~ /OpenSSH/) {
+ # http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6492415
+ if(sshd_supports_opt('UsePrivilegeSeparation','no')) {
+ push @cfgarr, 'UsePrivilegeSeparation no';
+ }
+}
+
+if(sshd_supports_opt('VerifyReverseMapping','no')) {
+ push @cfgarr, 'VerifyReverseMapping no';
+}
+if(sshd_supports_opt('X11UseLocalhost','yes')) {
+ push @cfgarr, 'X11UseLocalhost yes';
+}
+push @cfgarr, '#';
+
+
+#***************************************************************************
+# Write out resulting sshd configuration file for curl's tests
+#
+$error = dump_array($sshdconfig, @cfgarr);
+if($error) {
+ logmsg $error;
+ exit 1;
+}
+
+
+#***************************************************************************
+# Verify that sshd actually supports our generated configuration file
+#
+if(system "$sshd -t -f $sshdconfig > $sshdlog 2>&1") {
+ logmsg "sshd configuration file $sshdconfig failed verification";
+ display_sshdlog();
+ display_sshdconfig();
+ exit 1;
+}
+
+
+#***************************************************************************
+# Generate ssh client host key database file for curl's tests
+#
+if(! -e $knownhosts) {
+ logmsg 'generating ssh client known hosts file...' if($verbose);
+ if(open(DSAKEYFILE, "<$hstpubkeyf")) {
+ my @dsahostkey = do { local $/ = ' '; <DSAKEYFILE> };
+ if(close(DSAKEYFILE)) {
+ if(open(KNOWNHOSTS, ">$knownhosts")) {
+ print KNOWNHOSTS "$listenaddr ssh-dss $dsahostkey[1]\n";
+ if(!close(KNOWNHOSTS)) {
+ $error = "Error: cannot close file $knownhosts";
+ }
+ }
+ else {
+ $error = "Error: cannot write file $knownhosts";
+ }
+ }
+ else {
+ $error = "Error: cannot close file $hstpubkeyf";
+ }
+ }
+ else {
+ $error = "Error: cannot read file $hstpubkeyf";
+ }
+ if($error) {
+ logmsg $error;
+ exit 1;
+ }
+}
+
+
+#***************************************************************************
+# ssh client configuration file options we might use and version support
+#
+# AddressFamily : OpenSSH 3.7.0 and later
+# BatchMode : OpenSSH 1.2.1 and later
+# BindAddress : OpenSSH 2.9.9 and later
+# ChallengeResponseAuthentication : OpenSSH 2.5.0 and later
+# CheckHostIP : OpenSSH 1.2.1 and later
+# Cipher : OpenSSH 1.2.1 and later [3]
+# Ciphers : OpenSSH 2.1.0 and later [3]
+# ClearAllForwardings : OpenSSH 2.9.9 and later
+# Compression : OpenSSH 1.2.1 and later
+# CompressionLevel : OpenSSH 1.2.1 and later [3]
+# ConnectionAttempts : OpenSSH 1.2.1 and later
+# ConnectTimeout : OpenSSH 3.7.0 and later
+# ControlMaster : OpenSSH 3.9.0 and later
+# ControlPath : OpenSSH 3.9.0 and later
+# DisableBanner : SunSSH 1.2.0 and later
+# DynamicForward : OpenSSH 2.9.0 and later
+# EnableSSHKeysign : OpenSSH 3.6.0 and later
+# EscapeChar : OpenSSH 1.2.1 and later [3]
+# ExitOnForwardFailure : OpenSSH 4.4.0 and later
+# ForwardAgent : OpenSSH 1.2.1 and later
+# ForwardX11 : OpenSSH 1.2.1 and later
+# ForwardX11Trusted : OpenSSH 3.8.0 and later
+# GatewayPorts : OpenSSH 1.2.1 and later
+# GlobalKnownHostsFile : OpenSSH 1.2.1 and later
+# GSSAPIAuthentication : OpenSSH 3.7.0 and later [1]
+# GSSAPIDelegateCredentials : OpenSSH 3.7.0 and later [1]
+# HashKnownHosts : OpenSSH 4.0.0 and later
+# Host : OpenSSH 1.2.1 and later
+# HostbasedAuthentication : OpenSSH 2.9.0 and later
+# HostKeyAlgorithms : OpenSSH 2.9.0 and later [3]
+# HostKeyAlias : OpenSSH 2.5.0 and later [3]
+# HostName : OpenSSH 1.2.1 and later
+# IdentitiesOnly : OpenSSH 3.9.0 and later
+# IdentityFile : OpenSSH 1.2.1 and later
+# IgnoreIfUnknown : SunSSH 1.2.0 and later
+# KeepAlive : OpenSSH 1.2.1 and later
+# KbdInteractiveAuthentication : OpenSSH 2.3.0 and later
+# KbdInteractiveDevices : OpenSSH 2.3.0 and later [3]
+# LocalCommand : OpenSSH 4.3.0 and later [3]
+# LocalForward : OpenSSH 1.2.1 and later [3]
+# LogLevel : OpenSSH 1.2.1 and later
+# MACs : OpenSSH 2.5.0 and later [3]
+# NoHostAuthenticationForLocalhost : OpenSSH 3.0.0 and later
+# NumberOfPasswordPrompts : OpenSSH 1.2.1 and later
+# PasswordAuthentication : OpenSSH 1.2.1 and later
+# PermitLocalCommand : OpenSSH 4.3.0 and later
+# Port : OpenSSH 1.2.1 and later
+# PreferredAuthentications : OpenSSH 2.5.2 and later
+# Protocol : OpenSSH 2.1.0 and later
+# ProxyCommand : OpenSSH 1.2.1 and later [3]
+# PubkeyAuthentication : OpenSSH 2.5.0 and later
+# RekeyLimit : OpenSSH 3.7.0 and later
+# RemoteForward : OpenSSH 1.2.1 and later [3]
+# RhostsRSAAuthentication : OpenSSH 1.2.1 and later
+# RSAAuthentication : OpenSSH 1.2.1 and later
+# SendEnv : OpenSSH 3.9.0 and later
+# ServerAliveCountMax : OpenSSH 3.8.0 and later
+# ServerAliveInterval : OpenSSH 3.8.0 and later
+# SmartcardDevice : OpenSSH 2.9.9 and later [1][3]
+# StrictHostKeyChecking : OpenSSH 1.2.1 and later
+# TCPKeepAlive : OpenSSH 3.8.0 and later
+# Tunnel : OpenSSH 4.3.0 and later
+# TunnelDevice : OpenSSH 4.3.0 and later [3]
+# UsePAM : OpenSSH 3.7.0 and later [1][2][3]
+# UsePrivilegedPort : OpenSSH 1.2.1 and later
+# User : OpenSSH 1.2.1 and later
+# UserKnownHostsFile : OpenSSH 1.2.1 and later
+# VerifyHostKeyDNS : OpenSSH 3.8.0 and later
+# XAuthLocation : OpenSSH 2.1.1 and later [3]
+#
+# [1] Option only available if activated at compile time
+# [2] Option specific for portable versions
+# [3] Option not used in our ssh client config file
+
+
+#***************************************************************************
+# Initialize ssh config with options actually supported in OpenSSH 2.9.9
+#
+logmsg 'generating ssh client config file...' if($verbose);
+@cfgarr = ();
+push @cfgarr, '# This is a generated file. Do not edit.';
+push @cfgarr, "# $sshverstr ssh client configuration file for curl testing";
+push @cfgarr, '#';
+push @cfgarr, 'Host *';
+push @cfgarr, '#';
+push @cfgarr, "Port $port";
+push @cfgarr, "HostName $listenaddr";
+push @cfgarr, "User $username";
+push @cfgarr, 'Protocol 2';
+push @cfgarr, '#';
+push @cfgarr, "BindAddress $listenaddr";
+push @cfgarr, "DynamicForward $socksport";
+push @cfgarr, '#';
+push @cfgarr, "IdentityFile $path/curl_client_key";
+push @cfgarr, "UserKnownHostsFile $path/$knownhosts";
+push @cfgarr, '#';
+push @cfgarr, 'BatchMode yes';
+push @cfgarr, 'ChallengeResponseAuthentication no';
+push @cfgarr, 'CheckHostIP no';
+push @cfgarr, 'ClearAllForwardings no';
+push @cfgarr, 'Compression no';
+push @cfgarr, 'ConnectionAttempts 3';
+push @cfgarr, 'ForwardAgent no';
+push @cfgarr, 'ForwardX11 no';
+push @cfgarr, 'GatewayPorts no';
+push @cfgarr, 'GlobalKnownHostsFile /dev/null';
+push @cfgarr, 'HostbasedAuthentication no';
+push @cfgarr, 'KbdInteractiveAuthentication no';
+push @cfgarr, "LogLevel $loglevel";
+push @cfgarr, 'NumberOfPasswordPrompts 0';
+push @cfgarr, 'PasswordAuthentication no';
+push @cfgarr, 'PreferredAuthentications publickey';
+push @cfgarr, 'PubkeyAuthentication yes';
+push @cfgarr, 'RhostsRSAAuthentication no';
+push @cfgarr, 'RSAAuthentication no';
+push @cfgarr, 'StrictHostKeyChecking yes';
+push @cfgarr, 'UsePrivilegedPort no';
+push @cfgarr, '#';
+
+
+#***************************************************************************
+# Options supported in ssh client newer than OpenSSH 2.9.9
+#
+
+if(($sshid =~ /OpenSSH/) && ($sshvernum >= 370)) {
+ push @cfgarr, 'AddressFamily any';
+}
+
+if((($sshid =~ /OpenSSH/) && ($sshvernum >= 370)) ||
+ (($sshid =~ /SunSSH/) && ($sshvernum >= 120))) {
+ push @cfgarr, 'ConnectTimeout 30';
+}
+
+if(($sshid =~ /OpenSSH/) && ($sshvernum >= 390)) {
+ push @cfgarr, 'ControlMaster no';
+}
+
+if(($sshid =~ /OpenSSH/) && ($sshvernum >= 420)) {
+ push @cfgarr, 'ControlPath none';
+}
+
+if(($sshid =~ /SunSSH/) && ($sshvernum >= 120)) {
+ push @cfgarr, 'DisableBanner yes';
+}
+
+if(($sshid =~ /OpenSSH/) && ($sshvernum >= 360)) {
+ push @cfgarr, 'EnableSSHKeysign no';
+}
+
+if(($sshid =~ /OpenSSH/) && ($sshvernum >= 440)) {
+ push @cfgarr, 'ExitOnForwardFailure yes';
+}
+
+if((($sshid =~ /OpenSSH/) && ($sshvernum >= 380)) ||
+ (($sshid =~ /SunSSH/) && ($sshvernum >= 120))) {
+ push @cfgarr, 'ForwardX11Trusted no';
+}
+
+if(($sshd_builtwith_GSSAPI) && ($sshdid eq $sshid) &&
+ ($sshdvernum == $sshvernum)) {
+ push @cfgarr, 'GSSAPIAuthentication no';
+ push @cfgarr, 'GSSAPIDelegateCredentials no';
+ if($sshid =~ /SunSSH/) {
+ push @cfgarr, 'GSSAPIKeyExchange no';
+ }
+}
+
+if((($sshid =~ /OpenSSH/) && ($sshvernum >= 400)) ||
+ (($sshid =~ /SunSSH/) && ($sshvernum >= 120))) {
+ push @cfgarr, 'HashKnownHosts no';
+}
+
+if(($sshid =~ /OpenSSH/) && ($sshvernum >= 390)) {
+ push @cfgarr, 'IdentitiesOnly yes';
+}
+
+if(($sshid =~ /SunSSH/) && ($sshvernum >= 120)) {
+ push @cfgarr, 'IgnoreIfUnknown no';
+}
+
+if((($sshid =~ /OpenSSH/) && ($sshvernum < 380)) ||
+ ($sshid =~ /SunSSH/)) {
+ push @cfgarr, 'KeepAlive no';
+}
+
+if((($sshid =~ /OpenSSH/) && ($sshvernum >= 300)) ||
+ ($sshid =~ /SunSSH/)) {
+ push @cfgarr, 'NoHostAuthenticationForLocalhost no';
+}
+
+if(($sshid =~ /OpenSSH/) && ($sshvernum >= 430)) {
+ push @cfgarr, 'PermitLocalCommand no';
+}
+
+if((($sshid =~ /OpenSSH/) && ($sshvernum >= 370)) ||
+ (($sshid =~ /SunSSH/) && ($sshvernum >= 120))) {
+ push @cfgarr, 'RekeyLimit 1G';
+}
+
+if(($sshid =~ /OpenSSH/) && ($sshvernum >= 390)) {
+ push @cfgarr, 'SendEnv';
+}
+
+if((($sshid =~ /OpenSSH/) && ($sshvernum >= 380)) ||
+ (($sshid =~ /SunSSH/) && ($sshvernum >= 120))) {
+ push @cfgarr, 'ServerAliveCountMax 3';
+ push @cfgarr, 'ServerAliveInterval 0';
+}
+
+if(($sshid =~ /OpenSSH/) && ($sshvernum >= 380)) {
+ push @cfgarr, 'TCPKeepAlive no';
+}
+
+if(($sshid =~ /OpenSSH/) && ($sshvernum >= 430)) {
+ push @cfgarr, 'Tunnel no';
+}
+
+if(($sshid =~ /OpenSSH/) && ($sshvernum >= 380)) {
+ push @cfgarr, 'VerifyHostKeyDNS no';
+}
+
+push @cfgarr, '#';
+
+
+#***************************************************************************
+# Write out resulting ssh client configuration file for curl's tests
+#
+$error = dump_array($sshconfig, @cfgarr);
+if($error) {
+ logmsg $error;
+ exit 1;
+}
+
+
+#***************************************************************************
+# Initialize client sftp config with options actually supported.
+#
+logmsg 'generating sftp client config file...' if($verbose);
+splice @cfgarr, 1, 1, "# $sshverstr sftp client configuration file for curl testing";
+#
+for(my $i = scalar(@cfgarr) - 1; $i > 0; $i--) {
+ if($cfgarr[$i] =~ /^DynamicForward/) {
+ splice @cfgarr, $i, 1;
+ next;
+ }
+ if($cfgarr[$i] =~ /^ClearAllForwardings/) {
+ splice @cfgarr, $i, 1, "ClearAllForwardings yes";
+ next;
+ }
+}
+
+
+#***************************************************************************
+# Write out resulting sftp client configuration file for curl's tests
+#
+$error = dump_array($sftpconfig, @cfgarr);
+if($error) {
+ logmsg $error;
+ exit 1;
+}
+@cfgarr = ();
+
+
+#***************************************************************************
+# Generate client sftp commands batch file for sftp server verification
+#
+logmsg 'generating sftp client commands file...' if($verbose);
+push @cfgarr, 'pwd';
+push @cfgarr, 'quit';
+$error = dump_array($sftpcmds, @cfgarr);
+if($error) {
+ logmsg $error;
+ exit 1;
+}
+@cfgarr = ();
+
+
+#***************************************************************************
+# Start the ssh server daemon without forking it
+#
+logmsg "SCP/SFTP server listening on port $port" if($verbose);
+my $rc = system "$sshd -e -D -f $sshdconfig > $sshdlog 2>&1";
+if($rc == -1) {
+ logmsg "$sshd failed with: $!";
+}
+elsif($rc & 127) {
+ logmsg sprintf("$sshd died with signal %d, and %s coredump",
+ ($rc & 127), ($rc & 128)?'a':'no');
+}
+elsif($verbose && ($rc >> 8)) {
+ logmsg sprintf("$sshd exited with %d", $rc >> 8);
+}
+
+
+#***************************************************************************
+# Clean up once the server has stopped
+#
+unlink($hstprvkeyf, $hstpubkeyf, $cliprvkeyf, $clipubkeyf, $knownhosts);
+unlink($sshdconfig, $sshconfig, $sftpconfig);
+
+
+exit 0;
diff --git a/tests/stunnel.pem b/tests/stunnel.pem
new file mode 100644
index 000000000..1b4d66993
--- /dev/null
+++ b/tests/stunnel.pem
@@ -0,0 +1,142 @@
+#
+# This file contains a private key and a certificate used for stunnel.
+# The certificate contains a number of extensions essentially being
+# used in the 509 test. The certificate has been generated using
+# openssl with the parameters listed below up to the line
+# contain [something], after that you find the result.
+#
+#
+extensions = x509v3
+[ x509v3 ]
+subjectAltName = DNS:localhost
+nsCertType = server
+nsComment = "CURL stunnel server test certificate"
+keyUsage = digitalSignature,keyEncipherment
+extendedKeyUsage = serverAuth
+basicConstraints = CA:false
+subjectKeyIdentifier = hash
+subjectInfoAccess = AD_DVCS;URI:"https://localhost:8433/509"
+authorityInfoAccess = AD_DVCS;URI:"https://localhost:8433/509"
+[ req ]
+default_bits = 1234
+distinguished_name = req_DN
+default_md = sha1
+string_mask = pkix
+[ req_DN ]
+countryName = "1. Country Name (2 letter code)"
+countryName_value = SE
+stateOrProvinceName = "2. State or Province Name (full name) "
+stateOrProvinceName_value = Solna
+localityName = "3. Locality Name (eg, city) "
+localityName_value = Mooo
+0.organizationName = "4. Organization Name (eg, company) "
+0.organizationName_value = Haxx
+organizationalUnitName = "5. Organizational Unit Name (eg, section) "
+organizationalUnitName_value = Coolx
+commonName = "6. Common Name (eg, FQDN) "
+commonName_value = "storbror"
+1.commonName = "6. Common Name (eg, FQDN) "
+1.commonName_value = "localhost"
+[something]
+-----BEGIN RSA PRIVATE KEY-----
+MIIC1AIBAAKBmwNZN+oG6vJ8DAze+FvOKSS49X4xGMxALhKRLhQQb7qvM+7BcMgR
+v+RKxkX7SNgcxKPLcIHf7QQ6DBIlLXuAuVHQtWW9b06q64kBElkEwh6gP5Ia9JrR
+ysGbu2U6NRP+xBU33dVwZjF07ocN9Pp392W4VxEc+g3+FkRzUEaahDGOabmjgKuq
+DdlKdZLzgJj7+9sEKpb7+FdG56rZAgMBAAECgZsCkK1Z1XTUz5x3m7PMuHEiVaKS
+yk/B4ISq6pbO/gxpieARzhR038wNug6L+8VA8UDebXHBvGYYr9Mhb2OZUfIlr+nW
+h7kmHZ+T88M3eH/hQc3jtnvnu1dGmMlIXjTLQOrKgrAn6fYaw2HAGPdGKjpatAy/
+3vRjguv/22pNJLRQmMHdozJdc8mEYY+AhqrQxXCWQT/1peZzlq/IAQJOAfhE2YWf
+qB9iYNmuhxJ1PolPW4I63atXuoavqadbaRoaLm/pqLVB1QjMeyak8O/0TmO6CXk6
+878ps85fLFgARRjSYX+rYwoYNzqxK3cBAk4Bsy4oofReVT8xB+7rFZFMV4McyL7e
+sOABFqecLuNIGT6CdeEU1z7TUfq8sKM1MQ25e0J1PMmoWTqDwzhnxK+ckeFsZ8Te
+dgqVW+Oyy9kCTgHqyc/P/uEZkp1ioDu0WkpAR+1vZa2jeyH+vm9nhE9Z6Uty/r6F
+k4otIx9lMDmTwXqeE03vINJlJshqvjShfbnCe9gK8xrUk1cFl7QPAQJOATD3LQRq
+At2MniioFtiTbUN6n2ZS1C5xnHGq3fnBzxnZw4UmSfuZjG/L3gWPKkyJCK3HYe9K
+ho6ZQhNB6P5d7sQQjG6f+SIRwp+VjwvpAk4AnM4do54FETeLHhY4zy47dM/zdy3u
+iDjiFwoMTR+PfF03evsWe5pW3EaXolGi3FRAZ/idFA+L3Gi2y4xR44z71HkbF32L
+WKaLdOuBQvI=
+-----END RSA PRIVATE KEY-----
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number:
+ 09:c2:f9:ca:9a:d8
+ Signature Algorithm: md5WithRSAEncryption
+ Issuer: C=SE, ST=Solna, L=Mooo, O=Haxx, OU=Coolx, CN=storbror, CN=localhost
+ Validity
+ Not Before: Jan 5 11:25:13 2004 GMT
+ Not After : Feb 13 11:25:13 2008 GMT
+ Subject: C=SE, ST=Solna, L=Mooo, O=Haxx, OU=Coolx, CN=storbror, CN=localhost
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1234 bit)
+ Modulus (1234 bit):
+ 03:59:37:ea:06:ea:f2:7c:0c:0c:de:f8:5b:ce:29:
+ 24:b8:f5:7e:31:18:cc:40:2e:12:91:2e:14:10:6f:
+ ba:af:33:ee:c1:70:c8:11:bf:e4:4a:c6:45:fb:48:
+ d8:1c:c4:a3:cb:70:81:df:ed:04:3a:0c:12:25:2d:
+ 7b:80:b9:51:d0:b5:65:bd:6f:4e:aa:eb:89:01:12:
+ 59:04:c2:1e:a0:3f:92:1a:f4:9a:d1:ca:c1:9b:bb:
+ 65:3a:35:13:fe:c4:15:37:dd:d5:70:66:31:74:ee:
+ 87:0d:f4:fa:77:f7:65:b8:57:11:1c:fa:0d:fe:16:
+ 44:73:50:46:9a:84:31:8e:69:b9:a3:80:ab:aa:0d:
+ d9:4a:75:92:f3:80:98:fb:fb:db:04:2a:96:fb:f8:
+ 57:46:e7:aa:d9
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Subject Alternative Name:
+ DNS:localhost
+ Netscape Cert Type:
+ SSL Server
+ Netscape Comment:
+ CURL stunnel server test certificate
+ X509v3 Key Usage:
+ Digital Signature, Key Encipherment
+ X509v3 Extended Key Usage:
+ TLS Web Server Authentication
+ X509v3 Basic Constraints:
+ CA:FALSE
+ X509v3 Subject Key Identifier:
+ 35:77:35:3B:9B:98:3C:B6:C7:9A:E7:A8:04:B9:7C:70:AD:FA:37:A9
+ Subject Information Access:
+ ad dvcs - URI:https://localhost:8433/509
+
+ Authority Information Access:
+ ad dvcs - URI:https://localhost:8433/509
+
+ Signature Algorithm: md5WithRSAEncryption
+ 02:47:57:18:5f:54:3f:1d:29:0a:05:7a:d1:0f:e6:b9:2c:8b:
+ 29:38:50:bf:c1:a1:7f:73:4a:9d:f1:1b:bf:2e:ea:87:91:dd:
+ ff:75:73:57:78:cf:75:52:57:0b:5b:bb:d4:77:b2:dd:e8:0c:
+ 06:ce:1b:c0:3d:9f:68:c0:0b:66:b8:f9:46:db:04:a9:2f:a3:
+ 5e:9c:c6:70:ff:1d:af:1f:17:9c:38:3d:12:aa:af:7b:72:44:
+ a0:44:41:6b:9a:9b:60:8c:50:94:f1:d7:a5:77:6b:d3:0e:66:
+ 88:a1:52:63:23:f6:66:a6:ea:f9:d0:df:4d:8a:14:f0:73:c6:
+ b6:b6:b6:68:4f:3d:9a:b6:31:ba:19:f3:66:9f:16:6d:87:64:
+ 32:53:d2:90:e5:8c:1e:f5:18:61:1a
+-----BEGIN CERTIFICATE-----
+MIIDujCCAwigAwIBAgIGCcMA3QkhMA0GCSqGSIb3DQEBBAUAMHIxCzAJBgNVBAYT
+AlNFMQ4wDAYDVQQIEwVTb2xuYTENMAsGA1UEBxMETW9vbzENMAsGA1UEChMESGF4
+eDEOMAwGA1UECxMFQ29vbHgxETAPBgNVBAMTCHN0b3Jicm9yMRIwEAYDVQQDEwls
+b2N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ABjcN5nc80Rog+b6eS8QRX1BRnQqbGtocuptUgW5mWsSb+DR6pZbA==
+-----END CERTIFICATE-----
+-----BEGIN DH PARAMETERS-----
+MEYCQQD+KCcagSasA1QSo8tRXpbaLJJ1Ezt3FJFEZ3RVplp4qZwXQpSZ+Vly3xWx
+q3YvALe/enMbIq8F3OUmppq3UHwTAgEC
+-----END DH PARAMETERS-----
diff --git a/tests/symbol-scan.pl b/tests/symbol-scan.pl
new file mode 100644
index 000000000..cda9b7383
--- /dev/null
+++ b/tests/symbol-scan.pl
@@ -0,0 +1,162 @@
+#!/usr/bin/env perl
+#***************************************************************************
+# _ _ ____ _
+# Project ___| | | | _ \| |
+# / __| | | | |_) | |
+# | (__| |_| | _ <| |___
+# \___|\___/|_| \_\_____|
+#
+# Copyright (C) 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+#
+# This software is licensed as described in the file COPYING, which
+# you should have received as part of this distribution. The terms
+# are also available at http://curl.haxx.se/docs/copyright.html.
+#
+# You may opt to use, copy, modify, merge, publish, distribute and/or sell
+# copies of the Software, and permit persons to whom the Software is
+# furnished to do so, under the terms of the COPYING file.
+#
+# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+# KIND, either express or implied.
+#
+###########################################################################
+#
+# This script grew out of help from Przemyslaw Iskra and Balint Szilakszi
+# a late evening in the #curl IRC channel on freenode.
+#
+
+use strict;
+use warnings;
+
+#
+# configurehelp perl module is generated by configure script
+#
+use configurehelp qw(
+ $Cpreprocessor
+ );
+
+# we may get the dir root pointed out
+my $root=$ARGV[0] || ".";
+
+# need an include directory when building out-of-tree
+my $i = ($ARGV[1]) ? "-I$ARGV[1] " : '';
+
+my $h = "$root/include/curl/curl.h";
+my $mh = "$root/include/curl/multi.h";
+
+my $verbose=0;
+my $summary=0;
+my $misses=0;
+
+my @syms;
+my %doc;
+my %rem;
+
+open H_IN, "-|", "$Cpreprocessor $i$h" || die "Cannot preprocess curl.h";
+while ( <H_IN> ) {
+ if ( /enum\s+(\S+\s+)?{/ .. /}/ ) {
+ s/^\s+//;
+ next unless /^CURL/;
+ chomp;
+ s/[,\s].*//;
+ push @syms, $_;
+ }
+}
+close H_IN || die "Error preprocessing curl.h";
+
+sub scanheader {
+ my ($f)=@_;
+ open H, "<$f";
+ while(<H>) {
+ if (/^#define (CURL[A-Za-z0-9_]*)/) {
+ push @syms, $1;
+ }
+ }
+ close H;
+}
+
+scanheader($h);
+scanheader($mh);
+
+open S, "<$root/docs/libcurl/symbols-in-versions";
+while(<S>) {
+ if(/(^CURL[^ \n]*) *(.*)/) {
+ my ($sym, $rest)=($1, $2);
+ $doc{$sym}=$sym;
+ my @a=split(/ +/, $rest);
+ if($a[2]) {
+ # this symbol is documented to have been present the last time
+ # in this release
+ $rem{$sym}=$a[2];
+ }
+ }
+}
+close S;
+
+my $ignored=0;
+for my $e (sort @syms) {
+ # OBSOLETE - names that are just placeholders for a position where we
+ # previously had a name, that is now removed. The OBSOLETE names should
+ # never be used for anything.
+ #
+ # CURL_EXTERN - is a define used for libcurl functions that are external,
+ # public. No app or other code should ever use it.
+ #
+ # *_LAST and *_LASTENTRY are just prefix for the placeholders used for the
+ # last entry in many enum series.
+ #
+
+ if($e =~ /(OBSOLETE|^CURL_EXTERN|_LAST\z|_LASTENTRY\z)/) {
+ $ignored++;
+ next;
+ }
+ if($doc{$e}) {
+ if($verbose) {
+ print $e."\n";
+ }
+ $doc{$e}="used";
+ next;
+ }
+ else {
+ print $e."\n";
+ $misses++;
+ }
+}
+
+#
+# now scan through all symbols that were present in the symbols-in-versions
+# but not in the headers
+#
+# If the symbols were marked 'removed' in symbols-in-versions we don't output
+# anything about it since that is perfectly fine.
+#
+
+my $anyremoved;
+
+for my $e (sort keys %doc) {
+ if(($doc{$e} ne "used") && !$rem{$e}) {
+
+ if(!$anyremoved++) {
+ print "Missing symbols mentioned in symbols-in-versions\n";
+ print "Add them to a header, or mark them as removed.\n";
+ }
+
+ print "$e\n";
+ $misses++;
+ }
+}
+
+if($summary) {
+ print "Summary:\n";
+ printf "%d symbols in headers (out of which %d are ignored)\n", scalar(@syms),
+ $ignored;
+ printf "%d symbols in headers are interesting\n",
+ scalar(@syms)- $ignored;
+ printf "%d symbols are listed in symbols-in-versions\n (out of which %d are listed as removed)\n", scalar(keys %doc), scalar(keys %rem);
+ printf "%d symbols in symbols-in-versions should match the ones in headers\n", scalar(keys %doc) - scalar(keys %rem);
+
+}
+
+if($misses) {
+ exit 2; # there are stuff to attend to!
+}
diff --git a/tests/testcurl.1 b/tests/testcurl.1
new file mode 100644
index 000000000..39b7039bb
--- /dev/null
+++ b/tests/testcurl.1
@@ -0,0 +1,124 @@
+.\" **************************************************************************
+.\" * _ _ ____ _
+.\" * Project ___| | | | _ \| |
+.\" * / __| | | | |_) | |
+.\" * | (__| |_| | _ <| |___
+.\" * \___|\___/|_| \_\_____|
+.\" *
+.\" * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" *
+.\" * This software is licensed as described in the file COPYING, which
+.\" * you should have received as part of this distribution. The terms
+.\" * are also available at http://curl.haxx.se/docs/copyright.html.
+.\" *
+.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+.\" * copies of the Software, and permit persons to whom the Software is
+.\" * furnished to do so, under the terms of the COPYING file.
+.\" *
+.\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+.\" * KIND, either express or implied.
+.\" *
+.\" **************************************************************************
+.\"
+.TH testcurl.pl 1 "24 Mar 2010" "Curl 7.20.1" "testcurl"
+.SH NAME
+testcurl.pl \- (automatically) test curl
+.SH SYNOPSIS
+.B testcurl.pl [options] [dir] > output
+.SH DESCRIPTION
+\fItestcurl.pl\fP is the master script to use for automatic testing of curl
+off git or daily snapshots. It is written for the purpose of being run from a
+crontab job or similar at a regular interval. The output is suitable to be
+mailed to curl-autocompile@haxx.se to be dealt with automatically (make sure
+the subject includes the word "autobuild" as the mail gets silently discarded
+otherwise). The most current build status (with a reasonable backlog) will be
+published on the curl site, at http://curl.haxx.se/auto/
+
+\fIoptions\fP may be omitted. See \fI--setup\fP for what happens then.
+
+\fIdir\fP is a curl source dir, possibly a daily snapshot one. Using this will
+make testcurl.pl skip the 'buildconf' stage and thus it removes the dependency
+on automake, autoconf, libtool, GNU m4 and possibly a few other things.
+
+testcurl.pl will run 'buildconf' (or similar), run configure, build curl and
+libcurl in a separate build directory and then run 'make test' to test the
+fresh build.
+.SH OPTIONS
+.IP "--configure=[options]"
+Configure options passed to configure.
+.IP "--crosscompile"
+This is a cross-compile. Makes \fItestcurl.pl\fP skip a few things.
+.IP "--desc=[desc]"
+Description of your test system. Displayed on the build summary page on the
+weba site.
+.IP "--email=[email]"
+Set email address to report as. Displayed in the build logs on the site.
+.IP "--mktarball=[command]"
+Generic command to run after completed test.
+.IP "--name=[name]"
+Set name to report as. Displayed in the build summary on the site.
+.IP "--nobuildconf"
+Don't run buildconf. Useful when many builds use the same source tree, as then
+only one need to do this. Also, if multiple processes run tests simultaneously
+on the same source tree (like several hosts on a NFS mounted dir),
+simultaneous buildconf invokes may cause problems. (Added in 7.14.1)
+.IP "--nogitpull"
+Don't update from git even though it is a git tree. Useful to still be able to
+test even though your network is down, or similar.
+.IP "--runtestopts=[options]"
+Options that is passed to the runtests.pl script. Useful for disabling valgrind
+by force, and similar.
+.IP "--setup=[file name]"
+File name to read setup from (deprecated). The old style of providing info.
+If info is missing when testcurl.pl is started, it will prompt you and then
+store the info in a 'setup' file, which it will look for on each invoke. Use
+\fI--name\fP, \fI--emacs\fP, \fI--configure\fP and \fI--desc\fP instead.
+.IP "--target=[your os]"
+Specify your target environment. Recognized strings include 'vc', 'mingw32',
+\&'borland' and 'netware'.
+.SH "INITIAL SETUP"
+First you make a checkout from git (or you write a script that downloads daily
+snapshots automatically, find inspiration at
+http://curl.haxx.se/auto/autocurl.txt):
+
+.nf
+ $ mkdir daily-curl
+ $ cd daily-curl
+ $ git clone git://github.com/bagder/curl.git
+.fi
+
+With the curl sources checked out, or downloaded, you can start testing right
+away. If you want to use \fItestcurl.pl\fP without command line arguments and
+to have it store and remember the config in its 'setup' file, then start it
+manually now and fill in the answers to the questions it prompts you for:
+
+.nf
+ $ ./curl/tests/testcurl.pl
+.fi
+
+Now you are ready to go. If you let the script run, it will perform a full
+cycle and spit out lots of output. Mail us that output as described above.
+.SH "CRONTAB EXAMPLE"
+The crontab could include something like this:
+
+.nf
+\# autobuild curl:
+0 4 * * * cd daily-curl && ./testit.sh
+.fi
+
+Where testit.sh is a shell script that could look similar to this:
+
+.nf
+mail="mail -s autobuild curl-autocompile@haxx.se"
+name="--name=whoami"
+email="--email=iamme@nowhere"
+desc='"--desc=supermachine Turbo 2000"'
+testprog="perl ./curl/tests/testcurl.pl $name $email $desc"
+opts1="--configure=--enable-debug"
+opts2="--configure=--enable-ipv6"
+
+# run first test
+$testprog $opts1 | $mail
+
+# run second test
+$testprog $opts2 | $mail
diff --git a/tests/testcurl.html b/tests/testcurl.html
new file mode 100644
index 000000000..75c4bccbf
--- /dev/null
+++ b/tests/testcurl.html
@@ -0,0 +1,113 @@
+<html><head>
+<title>testcurl.pl man page</title>
+<meta name="generator" content="roffit 0.7">
+<STYLE type="text/css">
+P.level0 {
+ padding-left: 2em;
+}
+
+P.level1 {
+ padding-left: 4em;
+}
+
+P.level2 {
+ padding-left: 6em;
+}
+
+span.emphasis {
+ font-style: italic;
+}
+
+span.bold {
+ font-weight: bold;
+}
+
+span.manpage {
+ font-weight: bold;
+}
+
+h2.nroffsh {
+ background-color: #e0e0e0;
+}
+
+span.nroffip {
+ font-weight: bold;
+ font-size: 120%;
+ font-family: monospace;
+}
+
+p.roffit {
+ text-align: center;
+ font-size: 80%;
+}
+</STYLE>
+</head><body>
+
+<p class="level0"><a name="NAME"></a><h2 class="nroffsh">NAME</h2>
+<p class="level0">testcurl.pl - (automatically) test curl <a name="SYNOPSIS"></a><h2 class="nroffsh">SYNOPSIS</h2>
+<p class="level0"><span Class="bold">testcurl.pl [options] [dir] &gt; output</span> <a name="DESCRIPTION"></a><h2 class="nroffsh">DESCRIPTION</h2>
+<p class="level0"><span Class="emphasis">testcurl.pl</span> is the master script to use for automatic testing of curl off git or daily snapshots. It is written for the purpose of being run from a crontab job or similar at a regular interval. The output is suitable to be mailed to curl-autocompile@haxx.se to be dealt with automatically (make sure the subject includes the word "autobuild" as the mail gets silently discarded otherwise). The most current build status (with a reasonable backlog) will be published on the curl site, at <a href="http://curl.haxx.se/auto/">http://curl.haxx.se/auto/</a>
+<p class="level0"><span Class="emphasis">options</span> may be omitted. See <span Class="emphasis">--setup</span> for what happens then.
+<p class="level0"><span Class="emphasis">dir</span> is a curl source dir, possibly a daily snapshot one. Using this will make testcurl.pl skip the 'buildconf' stage and thus it removes the dependency on automake, autoconf, libtool, GNU m4 and possibly a few other things.
+<p class="level0">testcurl.pl will run 'buildconf' (or similar), run configure, build curl and libcurl in a separate build directory and then run 'make test' to test the fresh build. <a name="OPTIONS"></a><h2 class="nroffsh">OPTIONS</h2>
+<p class="level0">
+<p class="level0"><a name="--configureoptions"></a><span class="nroffip">--configure=[options]</span>
+<p class="level1">Configure options passed to configure.
+<p class="level0"><a name="--crosscompile"></a><span class="nroffip">--crosscompile</span>
+<p class="level1">This is a cross-compile. Makes <span Class="emphasis">testcurl.pl</span> skip a few things.
+<p class="level0"><a name="--descdesc"></a><span class="nroffip">--desc=[desc]</span>
+<p class="level1">Description of your test system. Displayed on the build summary page on the weba site.
+<p class="level0"><a name="--emailemail"></a><span class="nroffip">--email=[email]</span>
+<p class="level1">Set email address to report as. Displayed in the build logs on the site.
+<p class="level0"><a name="--mktarballcommand"></a><span class="nroffip">--mktarball=[command]</span>
+<p class="level1">Generic command to run after completed test.
+<p class="level0"><a name="--namename"></a><span class="nroffip">--name=[name]</span>
+<p class="level1">Set name to report as. Displayed in the build summary on the site.
+<p class="level0"><a name="--nobuildconf"></a><span class="nroffip">--nobuildconf</span>
+<p class="level1">Don't run buildconf. Useful when many builds use the same source tree, as then only one need to do this. Also, if multiple processes run tests simultaneously on the same source tree (like several hosts on a NFS mounted dir), simultaneous buildconf invokes may cause problems. (Added in 7.14.1)
+<p class="level0"><a name="--nogitpull"></a><span class="nroffip">--nogitpull</span>
+<p class="level1">Don't update from git even though it is a git tree. Useful to still be able to test even though your network is down, or similar.
+<p class="level0"><a name="--runtestoptsoptions"></a><span class="nroffip">--runtestopts=[options]</span>
+<p class="level1">Options that is passed to the runtests.pl script. Useful for disabling valgrind by force, and similar.
+<p class="level0"><a name="--setupfile"></a><span class="nroffip">--setup=[file name]</span>
+<p class="level1">File name to read setup from (deprecated). The old style of providing info. If info is missing when testcurl.pl is started, it will prompt you and then store the info in a 'setup' file, which it will look for on each invoke. Use <span Class="emphasis">--name</span>, <span Class="emphasis">--emacs</span>, <span Class="emphasis">--configure</span> and <span Class="emphasis">--desc</span> instead.
+<p class="level0"><a name="--targetyour"></a><span class="nroffip">--target=[your os]</span>
+<p class="level1">Specify your target environment. Recognized strings include 'vc', 'mingw32', 'borland' and 'netware'. <a name="INITIAL"></a><h2 class="nroffsh">INITIAL SETUP</h2>
+<p class="level0">First you make a checkout from git (or you write a script that downloads daily snapshots automatically, find inspiration at <a href="http://curl.haxx.se/auto/autocurl.txt">http://curl.haxx.se/auto/autocurl.txt</a>):
+<p class="level0"><pre>
+<p class="level0">&nbsp; $ mkdir daily-curl
+ &nbsp; $ cd daily-curl
+ &nbsp; $ git clone git://github.com/bagder/curl.git
+ </pre>
+
+<p class="level0">
+<p class="level0">With the curl sources checked out, or downloaded, you can start testing right away. If you want to use <span Class="emphasis">testcurl.pl</span> without command line arguments and to have it store and remember the config in its 'setup' file, then start it manually now and fill in the answers to the questions it prompts you for:
+<p class="level0"><pre>
+<p class="level0">&nbsp; $ ./curl/tests/testcurl.pl
+ </pre>
+
+<p class="level0">
+<p class="level0">Now you are ready to go. If you let the script run, it will perform a full cycle and spit out lots of output. Mail us that output as described above. <a name="CRONTAB"></a><h2 class="nroffsh">CRONTAB EXAMPLE</h2>
+<p class="level0">The crontab could include something like this:
+<p class="level0"><pre>
+<p class="level0"># autobuild curl:
+ 0 4 * * * cd daily-curl && ./testit.sh
+ </pre>
+
+<p class="level0">
+<p class="level0">Where testit.sh is a shell script that could look similar to this:
+<p class="level0"><pre>
+<p class="level0">mail="mail -s autobuild curl-autocompile@haxx.se"
+ name="--name=whoami"
+ email="--email=iamme@nowhere"
+ desc='"--desc=supermachine Turbo 2000"'
+ testprog="perl ./curl/tests/testcurl.pl $name $email $desc"
+ opts1="--configure=--enable-debug"
+ opts2="--configure=--enable-ipv6"
+ <p class="level0"># run first test
+ $testprog $opts1 | $mail
+ <p class="level0"># run second test
+ $testprog $opts2 | $mail
+ <p class="roffit">
+ This HTML page was made with <a href="http://daniel.haxx.se/projects/roffit/">roffit</a>.
+</body></html>
diff --git a/tests/testcurl.pdf b/tests/testcurl.pdf
new file mode 100644
index 000000000..a15fc9937
--- /dev/null
+++ b/tests/testcurl.pdf
Binary files differ
diff --git a/tests/testcurl.pl b/tests/testcurl.pl
new file mode 100755
index 000000000..27f188f2f
--- /dev/null
+++ b/tests/testcurl.pl
@@ -0,0 +1,741 @@
+#!/usr/bin/env perl
+#***************************************************************************
+# _ _ ____ _
+# Project ___| | | | _ \| |
+# / __| | | | |_) | |
+# | (__| |_| | _ <| |___
+# \___|\___/|_| \_\_____|
+#
+# Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+#
+# This software is licensed as described in the file COPYING, which
+# you should have received as part of this distribution. The terms
+# are also available at http://curl.haxx.se/docs/copyright.html.
+#
+# You may opt to use, copy, modify, merge, publish, distribute and/or sell
+# copies of the Software, and permit persons to whom the Software is
+# furnished to do so, under the terms of the COPYING file.
+#
+# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+# KIND, either express or implied.
+#
+###########################################################################
+
+###########################
+# What is This Script?
+###########################
+
+# testcurl.pl is the master script to use for automatic testing of curl
+# directly off its source repository.
+# This is written for the purpose of being run from a crontab job or similar
+# at a regular interval. The output is suitable to be mailed to
+# curl-autocompile@haxx.se to be dealt with automatically (make sure the
+# subject includes the word "autobuild" as the mail gets silently discarded
+# otherwise). The most current build status (with a resonable backlog) will
+# be published on the curl site, at http://curl.haxx.se/auto/
+
+# USAGE:
+# testcurl.pl [options] [curl-daily-name] > output
+
+# Options:
+#
+# --configure=[options] Configure options
+# --crosscompile This is a crosscompile
+# --desc=[desc] Description of your test system
+# --email=[email] Set email address to report as
+# --extvercmd=[command] Command to use for displaying version with cross compiles.
+# --mktarball=[command] Command to run after completed test
+# --name=[name] Set name to report as
+# --nocvsup Don't pull from git even though it is a git tree
+# --nogitpull Don't pull from git even though it is a git tree
+# --nobuildconf Don't run buildconf
+# --noconfigure Don't run configure
+# --runtestopts=[options] Options to pass to runtests.pl
+# --setup=[file name] File name to read setup from (deprecated)
+# --target=[your os] Specify your target environment.
+#
+# if [curl-daily-name] is omitted, a 'curl' git directory is assumed.
+#
+
+use strict;
+
+use Cwd;
+
+# Turn on warnings (equivalent to -w, which can't be used with /usr/bin/env)
+#BEGIN { $^W = 1; }
+
+use vars qw($version $fixed $infixed $CURLDIR $git $pwd $build $buildlog
+ $buildlogname $configurebuild $targetos $confheader $binext
+ $libext);
+
+use vars qw($name $email $desc $confopts $runtestopts $setupfile $mktarball
+ $extvercmd $nogitpull $nobuildconf $crosscompile
+ $timestamp);
+
+# version of this script
+$version='2010-08-20';
+$fixed=0;
+
+# Determine if we're running from git or a canned copy of curl,
+# or if we got a specific target option or setup file option.
+$CURLDIR="curl";
+if (-f ".git/config") {
+ $CURLDIR = "./";
+}
+
+$git=1;
+$setupfile = 'setup';
+$configurebuild = 1;
+while ($ARGV[0]) {
+ if ($ARGV[0] =~ /--target=/) {
+ $targetos = (split(/=/, shift @ARGV))[1];
+ }
+ elsif ($ARGV[0] =~ /--setup=/) {
+ $setupfile = (split(/=/, shift @ARGV))[1];
+ }
+ elsif ($ARGV[0] =~ /--extvercmd=/) {
+ $extvercmd = (split(/=/, shift @ARGV))[1];
+ }
+ elsif ($ARGV[0] =~ /--mktarball=/) {
+ $mktarball = (split(/=/, shift @ARGV))[1];
+ }
+ elsif ($ARGV[0] =~ /--name=/) {
+ $name = (split(/=/, shift @ARGV))[1];
+ }
+ elsif ($ARGV[0] =~ /--email=/) {
+ $email = (split(/=/, shift @ARGV))[1];
+ }
+ elsif ($ARGV[0] =~ /--desc=/) {
+ $desc = (split(/=/, shift @ARGV))[1];
+ }
+ elsif ($ARGV[0] =~ /--configure=/) {
+ $confopts = (split(/=/, shift @ARGV))[1];
+ }
+ elsif (($ARGV[0] eq "--nocvsup") || ($ARGV[0] eq "--nogitpull")) {
+ $nogitpull=1;
+ shift @ARGV;
+ }
+ elsif ($ARGV[0] =~ /--nobuildconf/) {
+ $nobuildconf=1;
+ shift @ARGV;
+ }
+ elsif ($ARGV[0] =~ /--noconfigure/) {
+ $configurebuild=0;
+ shift @ARGV;
+ }
+ elsif ($ARGV[0] =~ /--crosscompile/) {
+ $crosscompile=1;
+ shift @ARGV;
+ }
+ elsif ($ARGV[0] =~ /--runtestopts=/) {
+ $runtestopts = (split(/=/, shift @ARGV, 2))[1];
+ }
+ else {
+ $CURLDIR=shift @ARGV;
+ $git=0; # a given dir, assume not using git
+ }
+}
+
+# Do the platform-specific stuff here
+$confheader = 'curl_config.h';
+$binext = '';
+$libext = '.la'; # .la since both libcurl and libcares are made with libtool
+if ($^O eq 'MSWin32' || $targetos) {
+ if (!$targetos) {
+ # If no target defined on Win32 lets assume vc
+ $targetos = 'vc';
+ }
+ if ($targetos =~ /vc/ || $targetos =~ /borland/ || $targetos =~ /watcom/) {
+ $binext = '.exe';
+ $libext = '.lib';
+ }
+ elsif ($targetos =~ /mingw/) {
+ $binext = '.exe';
+ if ($^O eq 'MSWin32') {
+ $libext = '.a';
+ }
+ }
+ elsif ($targetos =~ /netware/) {
+ $configurebuild = 0;
+ $binext = '.nlm';
+ if ($^O eq 'MSWin32') {
+ $libext = '.lib';
+ }
+ else {
+ $libext = '.a';
+ }
+ }
+}
+
+if (($^O eq 'MSWin32' || $^O eq 'msys') &&
+ ($targetos =~ /vc/ || $targetos =~ /mingw32/ ||
+ $targetos =~ /borland/ || $targetos =~ /watcom/)) {
+
+ # Set these things only when building ON Windows and for Win32 platform.
+ # FOR Windows since we might be cross-compiling on another system. Non-
+ # Windows builds still default to configure-style builds with curl_config.h.
+
+ $configurebuild = 0;
+ $confheader = 'config-win32.h';
+}
+
+$ENV{LC_ALL}="C" if (($ENV{LC_ALL}) && ($ENV{LC_ALL} !~ /^C$/));
+$ENV{LC_CTYPE}="C" if (($ENV{LC_CTYPE}) && ($ENV{LC_CTYPE} !~ /^C$/));
+$ENV{LANG}="C";
+
+sub rmtree($) {
+ my $target = $_[0];
+ if ($^O eq 'MSWin32') {
+ foreach (glob($target)) {
+ s:/:\\:g;
+ system("rd /s /q $_");
+ }
+ } else {
+ system("rm -rf $target");
+ }
+}
+
+sub grepfile($$) {
+ my ($target, $fn) = @_;
+ open(F, $fn) or die;
+ while (<F>) {
+ if (/$target/) {
+ close(F);
+ return 1;
+ }
+ }
+ close(F);
+ return 0;
+}
+
+sub logit($) {
+ my $text=$_[0];
+ if ($text) {
+ print "testcurl: $text\n";
+ }
+}
+
+sub logit_spaced($) {
+ my $text=$_[0];
+ if ($text) {
+ print "\ntestcurl: $text\n\n";
+ }
+}
+
+sub mydie($){
+ my $text=$_[0];
+ logit "$text";
+ chdir $pwd; # cd back to the original root dir
+
+ if ($pwd && $build) {
+ # we have a build directory name, remove the dir
+ logit "removing the $build dir";
+ rmtree "$pwd/$build";
+ }
+ if (-r $buildlog) {
+ # we have a build log output file left, remove it
+ logit "removing the $buildlogname file";
+ unlink "$buildlog";
+ }
+ logit "ENDING HERE"; # last line logged!
+ exit 1;
+}
+
+sub get_host_triplet {
+ my $triplet;
+ my $configfile = "$pwd/$build/lib/curl_config.h";
+
+ if(-f $configfile && -s $configfile && open(LIBCONFIGH, "<$configfile")) {
+ while(<LIBCONFIGH>) {
+ if($_ =~ /^\#define\s+OS\s+"*([^"][^"]*)"*\s*/) {
+ $triplet = $1;
+ last;
+ }
+ }
+ close(LIBCONFIGH);
+ }
+ return $triplet;
+}
+
+if (open(F, "$setupfile")) {
+ while (<F>) {
+ if (/(\w+)=(.*)/) {
+ eval "\$$1=$2;";
+ }
+ }
+ close(F);
+ $infixed=$fixed;
+} else {
+ $infixed=0; # so that "additional args to configure" works properly first time...
+}
+
+if (!$name) {
+ print "please enter your name\n";
+ $name = <>;
+ chomp $name;
+ $fixed=1;
+}
+
+if (!$email) {
+ print "please enter your contact email address\n";
+ $email = <>;
+ chomp $email;
+ $fixed=2;
+}
+
+if (!$desc) {
+ print "please enter a one line system description\n";
+ $desc = <>;
+ chomp $desc;
+ $fixed=3;
+}
+
+if (!$confopts) {
+ if ($infixed < 4) {
+ print "please enter your additional arguments to configure\n";
+ print "examples: --with-ssl --enable-debug --enable-ipv6 --with-krb4\n";
+ $confopts = <>;
+ chomp $confopts;
+ }
+}
+
+
+if ($fixed < 4) {
+ $fixed=4;
+ open(F, ">$setupfile") or die;
+ print F "name='$name'\n";
+ print F "email='$email'\n";
+ print F "desc='$desc'\n";
+ print F "confopts='$confopts'\n";
+ print F "fixed='$fixed'\n";
+ close(F);
+}
+
+# Enable picky compiler warnings unless explicitly disabled
+if (($confopts !~ /--enable-debug/) &&
+ ($confopts !~ /--enable-warnings/) &&
+ ($confopts !~ /--disable-warnings/)) {
+ $confopts .= " --enable-warnings";
+}
+
+my $str1066os = 'o' x 1066;
+
+# Set timestamp to the UTC this script is running. Its value might
+# be changed later in the script to the value present in curlver.h
+$timestamp = scalar(gmtime)." UTC";
+
+logit "STARTING HERE"; # first line logged, for scripts to trigger on
+logit 'TRANSFER CONTROL ==== 1120 CHAR LINE' . $str1066os . 'LINE_END';
+logit "NAME = $name";
+logit "EMAIL = $email";
+logit "DESC = $desc";
+logit "CONFOPTS = $confopts";
+logit "CPPFLAGS = ".$ENV{CPPFLAGS};
+logit "CFLAGS = ".$ENV{CFLAGS};
+logit "LDFLAGS = ".$ENV{LDFLAGS};
+logit "CC = ".$ENV{CC};
+logit "MAKEFLAGS = ".$ENV{MAKEFLAGS};
+logit "PKG_CONFIG_PATH = ".$ENV{PKG_CONFIG_PATH};
+logit "target = ".$targetos;
+logit "version = $version"; # script version
+logit "date = $timestamp"; # When the test build starts
+
+$str1066os = undef;
+
+# Make $pwd to become the path without newline. We'll use that in order to cut
+# off that path from all possible logs and error messages etc.
+$pwd = getcwd();
+
+if (-d $CURLDIR) {
+ if ($git && -d "$CURLDIR/.git") {
+ logit "$CURLDIR is verified to be a fine git source dir";
+ # remove the generated sources to force them to be re-generated each
+ # time we run this test
+ unlink "$CURLDIR/src/hugehelp.c";
+ } elsif (!$git && -f "$CURLDIR/tests/testcurl.pl") {
+ logit "$CURLDIR is verified to be a fine daily source dir"
+ } else {
+ mydie "$CURLDIR is not a daily source dir or checked out from git!"
+ }
+}
+$build="build-$$";
+$buildlogname="buildlog-$$";
+$buildlog="$pwd/$buildlogname";
+
+# remove any previous left-overs
+rmtree "build-*";
+rmtree "buildlog-*";
+
+# this is to remove old build logs that ended up in the wrong dir
+foreach (glob("$CURLDIR/buildlog-*")) { unlink $_; }
+
+# create a dir to build in
+mkdir $build, 0777;
+
+if (-d $build) {
+ logit "build dir $build was created fine";
+} else {
+ mydie "failed to create dir $build";
+}
+
+# get in the curl source tree root
+chdir $CURLDIR;
+
+# Do the git thing, or not...
+if ($git) {
+ # update quietly to the latest git
+ if($nogitpull) {
+ logit "skipping git pull (--nogitpull)";
+ } else {
+ my $gitstat = 0;
+ my @commits;
+ logit "run git pull in curl";
+ system("git pull 2>&1");
+ $gitstat += $?;
+ logit "failed to update from curl git ($?), continue anyway" if ($?);
+ # get the last 5 commits for show (even if no pull was made)
+ @commits=`git log --pretty=oneline --abbrev-commit -5`;
+ logit "The most recent curl git commits:";
+ for (@commits) {
+ chomp ($_);
+ logit " $_";
+ }
+ if (-d "ares/.git") {
+ chdir "ares";
+ logit "run git pull in ares";
+ system("git pull 2>&1");
+ $gitstat += $?;
+ logit "failed to update from ares git ($?), continue anyway" if ($?);
+ # get the last 5 commits for show (even if no pull was made)
+ @commits=`git log --pretty=oneline --abbrev-commit -5`;
+ logit "The most recent ares git commits:";
+ for (@commits) {
+ chomp ($_);
+ logit " $_";
+ }
+ chdir "$pwd/$CURLDIR";
+ }
+ # Set timestamp to the UTC the git update took place.
+ $timestamp = scalar(gmtime)." UTC" if (!$gitstat);
+ }
+
+ if($nobuildconf) {
+ logit "told to not run buildconf";
+ }
+ elsif ($configurebuild) {
+ # remove possible left-overs from the past
+ unlink "configure";
+ unlink "autom4te.cache";
+
+ # generate the build files
+ logit "invoke buildconf, but filter off aclocal underquoted definition warnings";
+ open(F, "./buildconf 2>&1 |") or die;
+ open(LOG, ">$buildlog") or die;
+ while (<F>) {
+ next if /warning: underquoted definition of/;
+ print;
+ print LOG;
+ }
+ close(F);
+ close(LOG);
+
+ if (grepfile("^buildconf: OK", $buildlog)) {
+ logit "buildconf was successful";
+ }
+ else {
+ mydie "buildconf was NOT successful";
+ }
+ }
+ else {
+ logit "buildconf was successful (dummy message)";
+ }
+}
+
+# Set timestamp to the one in curlver.h if this isn't a git test build.
+if ((-f "include/curl/curlver.h") &&
+ (open(F, "<include/curl/curlver.h"))) {
+ while (<F>) {
+ chomp;
+ if ($_ =~ /^\#define\s+LIBCURL_TIMESTAMP\s+\"(.+)\".*$/) {
+ my $stampstring = $1;
+ if ($stampstring !~ /DEV/) {
+ $stampstring =~ s/\s+UTC//;
+ $timestamp = $stampstring." UTC";
+ }
+ last;
+ }
+ }
+ close(F);
+}
+
+# Show timestamp we are using for this test build.
+logit "timestamp = $timestamp";
+
+if ($configurebuild) {
+ if (-f "configure") {
+ logit "configure created (at least it exists)";
+ } else {
+ mydie "no configure created/found";
+ }
+} else {
+ logit "configure created (dummy message)"; # dummy message to feign success
+}
+
+sub findinpath {
+ my $c;
+ my $e;
+ my $x = ($^O eq 'MSWin32') ? '.exe' : '';
+ my $s = ($^O eq 'MSWin32') ? ';' : ':';
+ my $p=$ENV{'PATH'};
+ my @pa = split($s, $p);
+ for $c (@_) {
+ for $e (@pa) {
+ if( -x "$e/$c$x") {
+ return $c;
+ }
+ }
+ }
+}
+
+my $make = findinpath("gmake", "make", "nmake");
+if(!$make) {
+ mydie "Couldn't find make in the PATH";
+}
+# force to 'nmake' for VC builds
+$make = "nmake" if ($targetos =~ /vc/);
+# force to 'wmake' for Watcom builds
+$make = "wmake" if ($targetos =~ /watcom/);
+logit "going with $make as make";
+
+# change to build dir
+chdir "$pwd/$build";
+
+if ($configurebuild) {
+ # run configure script
+ print `../$CURLDIR/configure $confopts 2>&1`;
+
+ if (-f "lib/Makefile") {
+ logit "configure seems to have finished fine";
+ } else {
+ mydie "configure didn't work";
+ }
+} else {
+ logit "copying files to build dir ...";
+ if (($^O eq 'MSWin32') && ($targetos !~ /netware/)) {
+ system("xcopy /s /q ..\\$CURLDIR .");
+ system("buildconf.bat");
+ }
+ elsif ($targetos =~ /netware/) {
+ system("cp -afr ../$CURLDIR/* .");
+ system("cp -af ../$CURLDIR/Makefile.dist Makefile");
+ system("$make -i -C lib -f Makefile.netware prebuild");
+ system("$make -i -C src -f Makefile.netware prebuild");
+ if (-d "../$CURLDIR/ares") {
+ system("$make -i -C ares -f Makefile.netware prebuild");
+ }
+ }
+ elsif ($^O eq 'linux') {
+ system("cp -afr ../$CURLDIR/* .");
+ system("cp -af ../$CURLDIR/Makefile.dist Makefile");
+ system("cp -af ../$CURLDIR/include/curl/curlbuild.h.dist ./include/curl/curlbuild.h");
+ system("$make -i -C lib -f Makefile.$targetos prebuild");
+ system("$make -i -C src -f Makefile.$targetos prebuild");
+ if (-d "../$CURLDIR/ares") {
+ system("cp -af ../$CURLDIR/ares/ares_build.h.dist ./ares/ares_build.h");
+ system("$make -i -C ares -f Makefile.$targetos prebuild");
+ }
+ }
+}
+
+if(-f "./libcurl.pc") {
+ logit_spaced "display libcurl.pc";
+ if(open(F, "<./libcurl.pc")) {
+ while(<F>) {
+ my $ll = $_;
+ print $ll if(($ll !~ /^ *#/) && ($ll !~ /^ *$/));
+ }
+ close(F);
+ }
+}
+
+if(-f "./include/curl/curlbuild.h") {
+ logit_spaced "display include/curl/curlbuild.h";
+ if(open(F, "<./include/curl/curlbuild.h")) {
+ while(<F>) {
+ my $ll = $_;
+ print $ll if(($ll =~ /^ *# *define *CURL_/) && ($ll !~ /__CURL_CURLBUILD_H/));
+ }
+ close(F);
+ }
+}
+else {
+ mydie "no curlbuild.h created/found";
+}
+
+logit_spaced "display lib/$confheader";
+open(F, "lib/$confheader") or die "lib/$confheader: $!";
+while (<F>) {
+ print if /^ *#/;
+}
+close(F);
+
+if (grepfile("^#define USE_ARES", "lib/$confheader")) {
+ print "\n";
+ logit "setup to build ares";
+
+ if(-f "./ares/libcares.pc") {
+ logit_spaced "display ares/libcares.pc";
+ if(open(F, "<./ares/libcares.pc")) {
+ while(<F>) {
+ my $ll = $_;
+ print $ll if(($ll !~ /^ *#/) && ($ll !~ /^ *$/));
+ }
+ close(F);
+ }
+ }
+
+ if(-f "./ares/ares_build.h") {
+ logit_spaced "display ares/ares_build.h";
+ if(open(F, "<./ares/ares_build.h")) {
+ while(<F>) {
+ my $ll = $_;
+ print $ll if(($ll =~ /^ *# *define *CARES_/) && ($ll !~ /__CARES_BUILD_H/));
+ }
+ close(F);
+ }
+ }
+ else {
+ mydie "no ares_build.h created/found";
+ }
+
+ $confheader =~ s/curl/ares/;
+ logit_spaced "display ares/$confheader";
+ if(open(F, "ares/$confheader")) {
+ while (<F>) {
+ print if /^ *#/;
+ }
+ close(F);
+ }
+
+ print "\n";
+ logit "build ares";
+ chdir "ares";
+
+ if ($targetos && !$configurebuild) {
+ logit "$make -f Makefile.$targetos";
+ open(F, "$make -f Makefile.$targetos 2>&1 |") or die;
+ }
+ else {
+ logit "$make";
+ open(F, "$make 2>&1 |") or die;
+ }
+ while (<F>) {
+ s/$pwd//g;
+ print;
+ }
+ close(F);
+
+ if (-f "libcares$libext") {
+ logit "ares is now built successfully (libcares$libext)";
+ } else {
+ mydie "ares build failed (libcares$libext)";
+ }
+
+ # cd back to the curl build dir
+ chdir "$pwd/$build";
+}
+
+my $mkcmd = "$make -i" . ($targetos && !$configurebuild ? " $targetos" : "");
+logit "$mkcmd";
+open(F, "$mkcmd 2>&1 |") or die;
+while (<F>) {
+ s/$pwd//g;
+ print;
+}
+close(F);
+
+if (-f "lib/libcurl$libext") {
+ logit "libcurl was created fine (libcurl$libext)";
+}
+else {
+ mydie "libcurl was not created (libcurl$libext)";
+}
+
+if (-f "src/curl$binext") {
+ logit "curl was created fine (curl$binext)";
+}
+else {
+ mydie "curl was not created (curl$binext)";
+}
+
+if (!$crosscompile || (($extvercmd ne '') && (-x $extvercmd))) {
+ logit "display curl${binext} --version output";
+ my $cmd = ($extvercmd ne '' ? $extvercmd.' ' : '')."./src/curl${binext} --version|";
+ open(F, $cmd);
+ while(<F>) {
+ # strip CR from output on non-win32 platforms (wine on Linux)
+ s/\r// if ($^O ne 'MSWin32');
+ print;
+ }
+ close(F);
+}
+
+if ($configurebuild && !$crosscompile) {
+ my $o;
+ if($runtestopts) {
+ $o = "TEST_F=\"$runtestopts\" ";
+ }
+ logit "$make -k ${o}test-full";
+ open(F, "$make -k ${o}test-full 2>&1 |") or die;
+ open(LOG, ">$buildlog") or die;
+ while (<F>) {
+ s/$pwd//g;
+ print;
+ print LOG;
+ }
+ close(F);
+ close(LOG);
+
+ if (grepfile("^TEST", $buildlog)) {
+ logit "tests were run";
+ } else {
+ mydie "test suite failure";
+ }
+
+ if (grepfile("^TESTFAIL:", $buildlog)) {
+ logit "the tests were not successful";
+ } else {
+ logit "the tests were successful!";
+ }
+}
+else {
+ if($crosscompile) {
+ # build test harness programs for selected cross-compiles
+ my $host_triplet = get_host_triplet();
+ if($host_triplet =~ /([^-]+)-([^-]+)-mingw(.*)/) {
+ chdir "$pwd/$build/tests";
+ logit_spaced "build test harness";
+ open(F, "$make -i 2>&1 |") or die;
+ open(LOG, ">$buildlog") or die;
+ while (<F>) {
+ s/$pwd//g;
+ print;
+ print LOG;
+ }
+ close(F);
+ close(LOG);
+ chdir "$pwd/$build";
+ }
+ logit_spaced "cross-compiling, can't run tests";
+ }
+ # dummy message to feign success
+ print "TESTDONE: 1 tests out of 0 (dummy message)\n";
+}
+
+# create a tarball if we got that option.
+if (($mktarball ne '') && (-x $mktarball)) {
+ system($mktarball);
+}
+
+# mydie to cleanup
+mydie "ending nicely";
diff --git a/tests/tftpserver.pl b/tests/tftpserver.pl
new file mode 100755
index 000000000..c5382ec66
--- /dev/null
+++ b/tests/tftpserver.pl
@@ -0,0 +1,109 @@
+#!/usr/bin/env perl
+#***************************************************************************
+# _ _ ____ _
+# Project ___| | | | _ \| |
+# / __| | | | |_) | |
+# | (__| |_| | _ <| |___
+# \___|\___/|_| \_\_____|
+#
+# Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+#
+# This software is licensed as described in the file COPYING, which
+# you should have received as part of this distribution. The terms
+# are also available at http://curl.haxx.se/docs/copyright.html.
+#
+# You may opt to use, copy, modify, merge, publish, distribute and/or sell
+# copies of the Software, and permit persons to whom the Software is
+# furnished to do so, under the terms of the COPYING file.
+#
+# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+# KIND, either express or implied.
+#
+#***************************************************************************
+
+BEGIN {
+ @INC=(@INC, $ENV{'srcdir'}, '.');
+}
+
+use strict;
+use warnings;
+
+use serverhelp qw(
+ server_pidfilename
+ server_logfilename
+ );
+
+my $verbose = 0; # set to 1 for debugging
+my $port = 8997; # just a default
+my $ipvnum = 4; # default IP version of tftp server
+my $idnum = 1; # dafault tftp server instance number
+my $proto = 'tftp'; # protocol the tftp server speaks
+my $pidfile; # tftp server pid file
+my $logfile; # tftp server log file
+my $srcdir;
+my $fork;
+
+my $flags = "";
+my $path = '.';
+my $logdir = $path .'/log';
+
+while(@ARGV) {
+ if($ARGV[0] eq '--pidfile') {
+ if($ARGV[1]) {
+ $pidfile = $ARGV[1];
+ shift @ARGV;
+ }
+ }
+ elsif($ARGV[0] eq '--logfile') {
+ if($ARGV[1]) {
+ $logfile = $ARGV[1];
+ shift @ARGV;
+ }
+ }
+ elsif($ARGV[0] eq '--srcdir') {
+ if($ARGV[1]) {
+ $srcdir = $ARGV[1];
+ shift @ARGV;
+ }
+ }
+ elsif($ARGV[0] eq '--ipv4') {
+ $ipvnum = 4;
+ }
+ elsif($ARGV[0] eq '--ipv6') {
+ $ipvnum = 6;
+ }
+ elsif($ARGV[0] eq '--port') {
+ if($ARGV[1] =~ /^(\d+)$/) {
+ $port = $1;
+ shift @ARGV;
+ }
+ }
+ elsif($ARGV[0] eq '--id') {
+ if($ARGV[1] =~ /^(\d+)$/) {
+ $idnum = $1 if($1 > 0);
+ shift @ARGV;
+ }
+ }
+ elsif($ARGV[0] eq '--verbose') {
+ $verbose = 1;
+ }
+ else {
+ print STDERR "\nWarning: tftpserver.pl unknown parameter: $ARGV[0]\n";
+ }
+ shift @ARGV;
+}
+
+if(!$srcdir) {
+ $srcdir = $ENV{'srcdir'} || '.';
+}
+if(!$pidfile) {
+ $pidfile = "$path/". server_pidfilename($proto, $ipvnum, $idnum);
+}
+if(!$logfile) {
+ $logfile = server_logfilename($logdir, $proto, $ipvnum, $idnum);
+}
+
+$flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
+$flags .= "--ipv$ipvnum --port $port --srcdir \"$srcdir\"";
+
+exec("server/tftpd $flags");
diff --git a/tests/valgrind.pm b/tests/valgrind.pm
new file mode 100644
index 000000000..78523ead6
--- /dev/null
+++ b/tests/valgrind.pm
@@ -0,0 +1,110 @@
+#***************************************************************************
+# _ _ ____ _
+# Project ___| | | | _ \| |
+# / __| | | | |_) | |
+# | (__| |_| | _ <| |___
+# \___|\___/|_| \_\_____|
+#
+# Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+#
+# This software is licensed as described in the file COPYING, which
+# you should have received as part of this distribution. The terms
+# are also available at http://curl.haxx.se/docs/copyright.html.
+#
+# You may opt to use, copy, modify, merge, publish, distribute and/or sell
+# copies of the Software, and permit persons to whom the Software is
+# furnished to do so, under the terms of the COPYING file.
+#
+# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+# KIND, either express or implied.
+#
+###########################################################################
+
+use File::Basename;
+
+sub valgrindparse {
+ my ($srcdir, # the dir in which the runtests script resides
+ $sslenabled,
+ $file) = @_;
+ my $leak;
+ my $invalidread;
+ my $uninitedvar;
+ my $error;
+ my $partial;
+ my $us;
+
+ my @o;
+
+ my $bt=0;
+
+ open(VAL, "<$file");
+ while(<VAL>) {
+ if($bt) {
+ # back trace parsing
+ if($_ =~ /^==(\d+)== *(at|by) 0x([0-9A-F]+): (.*)/) {
+ my $w = $4;
+ if($w =~ /(.*) \(([^:]*):(\d+)/) {
+ my ($func, $source, $line)=($1, $2, $3);
+ my $sourcename = basename($source);
+ if(-f "$srcdir/../src/$sourcename" ||
+ -f "$srcdir/../lib/$sourcename") {
+ # this is our source
+ # print "$func() at $source:$line\n";
+ $us++;
+ } #else {print "Not our source: $func, $source, $line\n";}
+ }
+ }
+ else {
+ if($us) {
+ # the stack trace included source details about us
+
+ $error++;
+ if($leak) {
+ push @o, "\n Leaked $leak bytes\n";
+ }
+ if($invalidread) {
+ push @o, "\n Read $invalidread invalid bytes\n";
+ }
+ if($uninitedvar) {
+ push @o, "\n Conditional jump or move depends on uninitialised value(s)\n";
+ }
+ }
+ $bt = 0; # no more backtrace
+ $us = 0;
+ }
+ }
+ else {
+ if($_ =~ /(\d+) bytes in (\d+) blocks are definitely lost/) {
+ $leak = $1;
+ if($leak) {
+ $error++;
+ }
+ $bt = 1;
+ }
+ elsif($_ =~ /Invalid read of size (\d+)/) {
+ $invalidread = $1;
+ $error++;
+ $bt = 1;
+ }
+ elsif($_ =~ /Conditional jump or move/) {
+ # If we require SSL, this test case most probaly makes
+ # us use OpenSSL. OpenSSL produces numerous valgrind
+ # errors of this kind, rendering it impossible for us to
+ # detect (valid) reports on actual curl or libcurl code.
+
+ if(!$sslenabled) {
+ $uninitedvar = 1;
+ $error++;
+ $bt = 1;
+ }
+ else {
+ $partial=1;
+ }
+ }
+ }
+ }
+ close(VAL);
+ return @o;
+}
+
+1;