Closed MartinMikita closed 11 years ago
@MartinMikita We may need to port the threading to: https://github.com/klokan/maptiler/blob/master/src/threading.h implemented as: https://github.com/klokan/maptiler/blob/master/src/threading_windows.c https://github.com/klokan/maptiler/blob/master/src/threading_posix.c
Header file pevents.h should not be included on compilation on MS Windows, because Windows has native support for multiple events.
Is MAXIMUM_WAIT_OBJECTS really 64? http://stackoverflow.com/questions/5131807/is-maximum-wait-objects-really-64
webstor/sysutils.h
or webstor/sysurils.cpp
CASSERT( c_maxEventCount <= MAXIMUM_WAIT_OBJECTS );
enum { c_maxEventCount = 256 };
@xrosecky Can this value be changed into 64?
It was required to install (unzip) the following dependencies on Windows: curl
, iconv
, xml
, openssl
(it is using for Qt 4.8.4 x64). It is also needed sqlite3
library for mbtiles.c
file
@MartinMikita: Yes, you can chage it to 64 on MS Windows.
Finally, I get compilation on Windows. But now, Amazon upload is not working... InvalidAccessKeyId exceptions...
Can you disable HTTPS temporary (https://github.com/klokan/webstor/blob/tileserver-maptiler/tileserver.cpp#L48) and use some network sniffer on localhost to capture communication and send me the request with response?
Here is an example of captured request:
PUT /webstortest3/upload%2F12%2F770%2F1609%2Epng HTTP/1.0
Host: s3.amazonaws.com
Content-Type: image/png
Date: Wed, 21 Aug 2013 20:41:43 GMT
x-amz-acl: public-read
Authorization: AWS AKIAIIPTMGH22AZTAB7A:nDTYdyfEO4uyFfFW7YXbyJj2OXk=
Connection: Keep-Alive
Content-Length: 6719
binary content follows
HTTP/1.1 200 OK
x-amz-id-2: nz5ZV3OcOurW8QHEmXAsmV8WeB58GL3trrZ7ay5FXA7ud1+EKBpYE7HuA5uFKPP+
x-amz-request-id: F573443E305582E3
Date: Wed, 21 Aug 2013 20:41:45 GMT
ETag: "b940326431a8ffb6ba2e8ab9fa7a40b6"
Content-Length: 0
Connection: keep-alive
Server: AmazonS3
Start upload in x64 version:
GET /webstortest6/tileserver.json HTTP/1.0
Host: s3.amazonaws.com
Date: Wed, 21 Aug 2013 22:57:43 GMT
Authorization: AWS
Connection: Keep-Alive
HTTP/1.1 400 Bad Request
x-amz-request-id: 72B0927FA93358B9
x-amz-id-2: 4KOKk3BZrOKDETDT4EhiD0r42b89gPMoQ7IH64GwfglvcCmDIybzCNWGvhVXR334
Content-Type: application/xml
Date: Wed, 21 Aug 2013 22:57:45 GMT
Connection: close
Server: AmazonS3
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>InvalidArgument</Code><Message>Authorization header is invalid -- one and only one ' ' (space) required</Message><ArgumentValue>AWS</ArgumentValue><ArgumentName>Authorization</ArgumentName><RequestId>72B0927FA93358B9</RequestId><HostId>4KOKk3BZrOKDETDT4EhiD0r42b89gPMoQ7IH64GwfglvcCmDIybzCNWGvhVXR334</HostId></Error>
Start upload in x86 version:
GET /webstortest6/tileserver.json HTTP/1.0
Host: s3.amazonaws.com
Date: Wed, 21 Aug 2013 23:09:58 GMT
Authorization: AWS 9:J8zgkzSnC5eDbDd2/DOjinKiVf8=
Connection: Keep-Alive
HTTP/1.1 403 Forbidden
x-amz-request-id: 09491D8950207C0C
x-amz-id-2: mHoZcXcsMbOm2ZclR1UEISpTOyPDtbwEYlprRwgPX9PlT5k+V5uwPIdc37WYegCy
Content-Type: application/xml
Date: Wed, 21 Aug 2013 23:10:00 GMT
Connection: close
Server: AmazonS3
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>InvalidAccessKeyId</Code><Message>The AWS Access Key Id you provided does not exist in our records.</Message><RequestId>09491D8950207C0C</RequestId><HostId>mHoZcXcsMbOm2ZclR1UEISpTOyPDtbwEYlprRwgPX9PlT5k+V5uwPIdc37WYegCy</HostId><AWSAccessKeyId>9</AWSAccessKeyId></Error>
Both authorization header are invalid, strange that x86 and x64 differs.
Signature is computed here:
https://github.com/klokan/webstor/blob/tileserver-maptiler/webstor/wsconn.cpp#L489
Check if m_accKey and m_secKey in WsConnection class are set correctly.
2013/8/22 MartinMikita notifications@github.com
GET /webstortest6/tileserver.json HTTP/1.0 Host: s3.amazonaws.com Date: Wed, 21 Aug 2013 22:57:43 GMT Authorization: AWS Connection: Keep-Alive
HTTP/1.1 400 Bad Request x-amz-request-id: 72B0927FA93358B9 x-amz-id-2: 4KOKk3BZrOKDETDT4EhiD0r42b89gPMoQ7IH64GwfglvcCmDIybzCNWGvhVXR334 Content-Type: application/xml Date: Wed, 21 Aug 2013 22:57:45 GMT Connection: close Server: AmazonS3
<?xml version="1.0" encoding="UTF-8"?>
InvalidArgument
Authorization header is invalid -- one and only one ' ' (space) required AWS Authorization 72B0927FA93358B9 4KOKk3BZrOKDETDT4EhiD0r42b89gPMoQ7IH64GwfglvcCmDIybzCNWGvhVXR334 — Reply to this email directly or view it on GitHubhttps://github.com/klokan/webstor/issues/18#issuecomment-23057078 .
I GET IT! IT IS FINALLY WORKING!
Congratulations!
Congratulations! Where was the problem? Last commit is seven hours old.
The main problem was with strings .This problem was reflected only on Windows.
It is not safe to use the result of std::string.c_str()
method as separate variable value. The string should be duplicated. I am not sure why, but I know it happens.
Hmm, the accKey and secKey are not modified after constructor call of S3Authentication, so it should be OK according to C++ standard, but maybe MS is of different opinion (http://www.cplusplus.com/reference/string/string/c_str/):
The pointer returned may be invalidated by further calls to other member functions that modify the object.
Thanks for catching this.
TileServer cannot be compiled on Windows platform.