patch-gatling_c 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. $Id$
  2. --- gatling-0.8.orig/gatling.c 2005-05-20 17:32:27.000000000 +0200
  3. +++ gatling-0.8/gatling.c 2007-07-06 17:55:56.000000000 +0200
  4. @@ -34,6 +34,7 @@
  5. #include <sys/time.h>
  6. #include <sys/resource.h>
  7. #include <sys/socket.h>
  8. +#include <crypt.h>
  9. #include <unistd.h>
  10. #include <stdlib.h>
  11. #include <errno.h>
  12. @@ -865,24 +866,6 @@ static inline int issafe(unsigned char c
  13. return (c!='"' && c!='%' && c>=' ' && c!='+');
  14. }
  15. -unsigned long fmt_urlencoded(char* dest,const char* src,unsigned long len) {
  16. - register const unsigned char* s=(const unsigned char*) src;
  17. - unsigned long written=0,i;
  18. - for (i=0; i<len; ++i) {
  19. - if (!issafe(s[i])) {
  20. - if (dest) {
  21. - dest[written]='%';
  22. - dest[written+1]=fmt_tohex(s[i]>>4);
  23. - dest[written+2]=fmt_tohex(s[i]&15);
  24. - }
  25. - written+=3;
  26. - } else {
  27. - if (dest) dest[written]=s[i]; ++written;
  28. - }
  29. - }
  30. - return written;
  31. -}
  32. -
  33. void catencoded(array* a,char* s) {
  34. unsigned int len=str_len(s);
  35. char* buf=alloca(fmt_urlencoded(0,s,len));
  36. @@ -1011,7 +994,7 @@ username2:password2
  37. * authentication was OK or -1 if authentication is needed (the HTTP
  38. * response was then already written to the iob). */
  39. int http_dohtaccess(struct http_data* h) {
  40. - unsigned long filesize;
  41. + size_t filesize;
  42. char* map;
  43. char* s;
  44. char* auth;
  45. @@ -1031,7 +1014,8 @@ int http_dohtaccess(struct http_data* h)
  46. char* username,* password;
  47. char* decoded;
  48. int i;
  49. - unsigned long l,dl,ul;
  50. + unsigned long l,ul;
  51. + size_t dl;
  52. auth+=6;
  53. while (*auth==' ' || *auth=='\t') ++auth;
  54. i=str_chr(auth,'\n');
  55. @@ -1103,7 +1087,7 @@ int64 http_openfile(struct http_data* h,
  56. char* dir=0;
  57. char* s;
  58. char* args;
  59. - unsigned long i;
  60. + size_t i;
  61. int64 fd;
  62. int doesgzip,doesbzip2;
  63. @@ -2948,7 +2932,7 @@ void forkslave(int fd,buffer* in) {
  64. j=str_chr(x,'\n'); if (j && x[j-1]=='\r') { --j; }
  65. k=str_chr(x,' ');
  66. if (k<j) {
  67. - unsigned long dl;
  68. + size_t dl;
  69. remoteuser=alloca(20+k-j);
  70. i=fmt_str(remoteuser,"REMOTE_USER=");
  71. scan_base64(x+k+1,remoteuser+i,&dl);