diff --git a/clients/curl/example.sh b/clients/curl/example.sh index 8223cb532..50ed2c52b 100755 --- a/clients/curl/example.sh +++ b/clients/curl/example.sh @@ -3,7 +3,7 @@ # Example client accesses to blob server using curl. # Configuration variables here: -BSHOST=localhost:8080 +BSHOST=localhost:3179/bs BSUSER=user BSPASS=foo diff --git a/clients/curl/upload-file.pl b/clients/curl/upload-file.pl index 68e376caf..bee85afd2 100755 --- a/clients/curl/upload-file.pl +++ b/clients/curl/upload-file.pl @@ -17,5 +17,5 @@ chomp $sha1; $sha1 =~ s/\s.+//; system("curl", "-u", "foo:foo", "-F", "sha1-$sha1=\@$file", - "http://127.0.0.1:3179/camli/upload") and die "upload failed."; -print "Uploaded http://127.0.0.1:3179/camli/sha1-$sha1\n"; + "http://127.0.0.1:3179/bs/camli/upload") and die "upload failed."; +print "Uploaded http://127.0.0.1:3179/bs/camli/sha1-$sha1\n"; diff --git a/clients/python/camliclient.py b/clients/python/camliclient.py index f70aebd8c..1cf15523d 100755 --- a/clients/python/camliclient.py +++ b/clients/python/camliclient.py @@ -137,7 +137,7 @@ Commands: default='', help='username:pasword for HTTP basic authentication') parser.add_option('-s', '--server', dest='server', - default='localhost:8080', + default='localhost:3179', help='hostname:port to connect to') parser.add_option('-d', '--debug', dest='debug', action='store_true', @@ -159,7 +159,7 @@ Commands: if opts.debug: logging.getLogger().setLevel(logging.DEBUG) - op = camli.op.CamliOp(opts.server, auth=opts.auth) + op = camli.op.CamliOp(opts.server, auth=opts.auth, basepath="/bs") command = args[0].lower() if command == 'putdir': diff --git a/lib/python/camli/op.py b/lib/python/camli/op.py index 7a5884a0d..bd11856bc 100755 --- a/lib/python/camli/op.py +++ b/lib/python/camli/op.py @@ -83,7 +83,7 @@ class CamliOp(object): buffer_size=BUFFER_SIZE, create_connection=httplib.HTTPConnection, auth=None, - basepath=False): + basepath=""): """Initializer. Args: @@ -100,6 +100,7 @@ class CamliOp(object): self._create_connection = create_connection self._connection = None self._authorization = '' + self.basepath = "" if auth: if len(auth.split(':')) != 2: # Default to dummy username; current server doesn't care @@ -348,7 +349,11 @@ class CamliOp(object): for blobref in blobref_list: logging.debug('Getting blobref=%s', blobref) - self.connection.request('GET', '/camli/' + blobref) + if self.basepath: + fullpath = self.basepath + '/camli/' + else: + fullpath = '/camli/' + self.connection.request('GET', fullpath + blobref) response = self.connection.getresponse() if response.status == 404: logging.debug('Server does not have blobref=%s', blobref)