Changeset 25027 for branches/pap/Nebulous
- Timestamp:
- Aug 7, 2009, 4:08:25 PM (17 years ago)
- Location:
- branches/pap
- Files:
-
- 2 deleted
- 35 edited
- 6 copied
-
. (modified) (1 prop)
-
Nebulous (modified) (1 prop)
-
Nebulous/Changes (modified) (2 diffs)
-
Nebulous/MANIFEST (modified) (2 diffs)
-
Nebulous/bin (modified) (1 prop)
-
Nebulous/bin/neb-cull (modified) (6 diffs)
-
Nebulous/bin/neb-locate (modified) (2 diffs)
-
Nebulous/bin/neb-ls (modified) (1 diff)
-
Nebulous/bin/neb-replicate (modified) (1 diff)
-
Nebulous/bin/neb-rm (modified) (4 diffs)
-
Nebulous/bin/neb-stat (modified) (1 diff)
-
Nebulous/examples (modified) (1 prop)
-
Nebulous/lib (modified) (1 prop)
-
Nebulous/lib/Nebulous/Client.pm (modified) (12 diffs)
-
Nebulous/lib/Nebulous/Client.pod (modified) (5 diffs)
-
Nebulous/nebclient (modified) (1 prop)
-
Nebulous/nebclient/configure.ac (modified) (1 diff)
-
Nebulous/nebclient/nebulous.wsdl (modified) (3 diffs)
-
Nebulous/nebclient/src/nebclient.c (modified) (52 diffs)
-
Nebulous/nebclient/src/nebclient.h (modified) (3 diffs)
-
Nebulous/nebclient/src/nebulous.h (modified) (3 diffs)
-
Nebulous/nebclient/src/soapC.c (modified) (6 diffs)
-
Nebulous/nebclient/src/soapClient.c (modified) (2 diffs)
-
Nebulous/nebclient/src/soapH.h (modified) (9 diffs)
-
Nebulous/nebclient/src/soapServer.c (modified) (3 diffs)
-
Nebulous/nebclient/src/soapStub.h (modified) (8 diffs)
-
Nebulous/nebclient/tests/tap (modified) (1 prop)
-
Nebulous/nebclient/tests/tests.c (modified) (3 diffs)
-
Nebulous/t (modified) (1 prop)
-
Nebulous/t/49_client_new.t (copied) (copied from trunk/Nebulous/t/49_client_new.t )
-
Nebulous/t/50_client_create.t (copied) (copied from trunk/Nebulous/t/50_client_create.t )
-
Nebulous/t/50_client_new.t (deleted)
-
Nebulous/t/51_client_create.t (deleted)
-
Nebulous/t/59_client_delete.t (modified) (5 diffs)
-
Nebulous/t/62_client_delete_instance.t (modified) (2 diffs)
-
Nebulous/t/63_client_stat.t (modified) (4 diffs)
-
Nebulous/t/66_client_xattr.t (modified) (15 diffs)
-
Nebulous/t/68_client_chmod.t (copied) (copied from trunk/Nebulous/t/68_client_chmod.t )
-
Nebulous/t/69_client_prune.t (copied) (copied from trunk/Nebulous/t/69_client_prune.t )
-
Nebulous/t/70_neb-ls.t (modified) (6 diffs)
-
Nebulous/t/71_client_there_can_be_only_one.t (copied) (copied from trunk/Nebulous/t/71_client_there_can_be_only_one.t )
-
Nebulous/t/72_neb-cull.t (copied) (copied from trunk/Nebulous/t/72_neb-cull.t )
-
Nebulous/t/conf/startup.pl.in (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/pap
- Property svn:mergeinfo changed
-
branches/pap/Nebulous
- Property svn:mergeinfo deleted
-
branches/pap/Nebulous/Changes
r23934 r25027 1 1 Revision history for Nebulous 2 3 0.17 4 - add chmod() API 5 - change neb-ls to always output in --long format 6 - add neb-rm --force flag 7 - change neb-locate's output seperator to \n 8 - add Nebulous::Client->prune() method 9 - add Nebulous::Client->there_can_be_only_one() method 10 - add neb-cull --one_only flag 2 11 3 12 0.10 … … 9 18 - add neb-swap 10 19 - add nebclient:nebSetXattr() 20 - add neb-rm --move flag 11 21 12 22 0.09 Wed Jul 9 16:36:27 HST 2008 -
branches/pap/Nebulous/MANIFEST
r23934 r25027 79 79 t/00_distribution.t 80 80 t/01_load.t 81 t/ 50_client_new.t82 t/5 1_client_create.t81 t/49_client_new.t 82 t/50_client_create.t 83 83 t/51_client_open_create.t 84 84 t/52_client_replicate.t … … 98 98 t/66_client_xattr.t 99 99 t/67_client_swap.t 100 t/68_client_chmod.t 101 t/69_client_prune.t 100 102 t/70_neb-ls.t 103 t/71_client_there_can_be_only_one.t 104 t/72_neb-cull.t 101 105 t/90_nebclient.t 102 106 t/TEST.PL -
branches/pap/Nebulous/bin
- Property svn:mergeinfo changed
-
branches/pap/Nebulous/bin/neb-cull
r16183 r25027 16 16 use Pod::Usage qw( pod2usage ); 17 17 18 my ($server, $volume );18 my ($server, $volume, $one_only); 19 19 20 20 $server = $ENV{'NEB_SERVER'} unless $server; … … 23 23 'server|s=s' => \$server, 24 24 'volume|v=s' => \$volume, 25 'one_only|o' => \$one_only, 25 26 ) || pod2usage( 2 ); 26 27 … … 40 41 unless defined $neb; 41 42 43 my @cull_args; 44 push @cull_args, $key; 42 45 if (defined $volume) { 43 $neb->cull($key, $volume) 44 or die "failed to replicate Nebulous key: $key"; 46 push @cull_args, $volume; 47 } 48 49 if ($one_only) { 50 my $status = $neb->there_can_be_only_one(@cull_args); 51 if ($status == 0) { 52 die "not enough instances of Nebulous key: $key"; 53 } 54 if (not defined $status or $status < 1) { 55 die "failed to cull Nebulous key: $key - " . $neb->err 56 if defined $neb->err; 57 die "failed to cull Nebulous key: $key"; 58 } 45 59 } else { 46 $neb->cull($key) 47 or die "failed to replicate Nebulous key: $key"; 60 unless (defined $neb->cull(@cull_args)) { 61 die "failed to cull Nebulous key: $key - " . $neb->err; 62 } 48 63 } 49 64 … … 58 73 =head1 SYNOPSIS 59 74 60 neb-cull [--server <URL>] [--volume <volume name>] <key>75 neb-cull [--server <URL>] [--volume <volume name>] [--one_only] <key> 61 76 62 77 =head1 DESCRIPTION … … 77 92 78 93 Symbolic name of the volume to create the new instance on. 94 95 Optional. 96 97 =item * --one_only|-o 98 99 Removes all but one instances of an object. Any inaccessible instances are 100 removed. If C<--volume> is specified, and an instance exists on that volume, 101 all instances but the one on that volume are removed. 79 102 80 103 Optional. … … 110 133 =head1 COPYRIGHT 111 134 112 Copyright (C) 2007-200 8Joshua Hoblitt. All rights reserved.135 Copyright (C) 2007-2009 Joshua Hoblitt. All rights reserved. 113 136 114 137 This program is free software; you can redistribute it and/or modify it under -
branches/pap/Nebulous/bin/neb-locate
r16179 r25027 41 41 unless defined $neb; 42 42 43 $volume = 'any' if defined $all; 44 43 45 my $uris; 44 46 if (defined $volume) { … … 70 72 } 71 73 72 print join(" ", @files), "\n";74 print join("\n", @files), "\n"; 73 75 74 76 __END__ -
branches/pap/Nebulous/bin/neb-ls
r23934 r25027 21 21 22 22 $server = $ENV{'NEB_SERVER'} unless $server; 23 24 # make --long the default 25 $long = 1; 23 26 24 27 GetOptions( -
branches/pap/Nebulous/bin/neb-replicate
r23696 r25027 16 16 use Pod::Usage qw( pod2usage ); 17 17 18 my ($server, $volume, $copies );18 my ($server, $volume, $copies, $set_copies); 19 19 $copies = 1; # default to making just one copy 20 20 -
branches/pap/Nebulous/bin/neb-rm
r13074 r25027 16 16 use Pod::Usage qw( pod2usage ); 17 17 18 my ($server); 18 my ( 19 $force, 20 $move, 21 $server, 22 ); 19 23 20 24 $server = $ENV{'NEB_SERVER'} unless $server; 21 25 22 26 GetOptions( 27 'force|f' => \$force, 28 'move|m' => \$move, 23 29 'server|s=s' => \$server, 24 30 ) || pod2usage( 2 ); … … 35 41 36 42 foreach my $key (@ARGV) { 37 $neb->delete($key) or warn "failed to delete key: $key"; 43 unless (defined $move) { 44 $neb->delete($key, $force) or warn "failed to delete key: $key"; 45 } else { 46 $neb->move($key, "${key}.rm") or warn "failed to move key: $key"; 47 } 38 48 } 39 49 … … 48 58 =head1 SYNOPSIS 49 59 50 neb-rm [--server <URL>] <key...>60 neb-rm [--server <URL>] [--force] [--move] <key...> 51 61 52 62 =head1 DESCRIPTION … … 58 68 59 69 =over 4 70 71 =item * --force|-f 72 73 When set, C<<key>> will be removed from the nebulous database even if the on 74 disk file(s) are missing. 75 76 Optional. 77 78 =item * --move|-m 79 80 When set, this flag causes C<<key>> to be renamed to C<<key>.rm> instead of 81 being deleted. 82 83 Optional. 60 84 61 85 =item * --server|-s <URL> -
branches/pap/Nebulous/bin/neb-stat
r18016 r25027 41 41 my $stat = $neb->stat($key); 42 42 die "nebulous key: $key not found" unless $stat; 43 my $instances = $neb->find_instances($key, ' :any');43 my $instances = $neb->find_instances($key, 'any'); 44 44 die "no instances found" unless $instances; 45 45 46 46 no warnings qw(uninitialized); 47 47 print 48 "object id: ", @$stat[0], "\n", 49 "key: ", @$stat[1], "\n", 50 "read lock: ", @$stat[2], "\n", 51 "write lock: ", @$stat[3], "\n", 52 "epoch: ", @$stat[4], "\n", 53 "mtime: ", @$stat[5], "\n", 54 "n instances: ", @$stat[6], "\n", 48 "object id: ", @$stat[0], "\n", 49 "key: ", @$stat[1], "\n", 50 "read lock: ", @$stat[2], "\n", 51 "write lock: ", @$stat[3], "\n", 52 "epoch: ", @$stat[4], "\n", 53 "mtime: ", @$stat[5], "\n", 54 "available instances: ", @$stat[6], "\n", 55 "total instances: ", @$stat[7], "\n", 55 56 "instance location:\n", " " x 4, 56 57 join("\n" . " " x 4, @$instances), "\n"; -
branches/pap/Nebulous/examples
- Property svn:mergeinfo deleted
-
branches/pap/Nebulous/lib
- Property svn:mergeinfo deleted
-
branches/pap/Nebulous/lib/Nebulous/Client.pm
r23934 r25027 9 9 no warnings qw( uninitialized ); 10 10 11 our $VERSION = '0. 09';11 our $VERSION = '0.17'; 12 12 13 13 use Digest::MD5; … … 16 16 use Nebulous::Client::Log; 17 17 use Nebulous::Util qw( :standard ); 18 use Params::Validate qw( validate validate_pos SCALAR UNDEF );18 use Params::Validate qw( validate validate_pos SCALAR UNDEF BOOLEAN ); 19 19 #use SOAP::Lite +trace => [qw( debug )]; 20 20 use SOAP::Lite; … … 297 297 my $instances = $stats[6]; 298 298 if (defined $instances and $instances < 2) { 299 $ log->debug("can not cull - not enough instances");299 $self->set_err("can not cull - not enough instances"); 300 300 $log->debug("leaving"); 301 301 … … 305 305 $locations = $self->find_instances($key, $vol_name); 306 306 unless (defined $locations) { 307 $ log->debug( "no instances" );307 $self->set_err( "no instances" ); 308 308 $log->debug( "leaving" ); 309 309 … … 313 313 $locations = $self->find_instances($key); 314 314 unless ($locations) { 315 $ log->debug("no instances");315 $self->set_err( "no instances" ); 316 316 $log->debug("leaving"); 317 317 … … 320 320 321 321 if (scalar @{ $locations } < 2) { 322 $ log->debug("can not cull - not enough instances");322 $self->set_err("can not cull - not enough instances"); 323 323 $log->debug("leaving"); 324 324 … … 329 329 my $uri = $self->delete_instance($key, @$locations[0]); 330 330 331 eval { 332 _nuke_file(_get_file_path(@$locations[0])); 333 }; 334 if ($@) { 335 $log->logdie($@); 336 } 337 331 338 $log->debug("leaving"); 332 339 333 340 return $uri; 341 } 342 343 344 sub there_can_be_only_one 345 { 346 my $self = shift; 347 348 my ($key, $vol_name) = validate_pos(@_, 349 { 350 type => SCALAR, 351 }, 352 { 353 # volume 354 type => SCALAR, 355 optional => 1, 356 }, 357 ); 358 359 $log->debug( "entered - @_" ); 360 361 my $locations; 362 my $removed = 0; 363 eval { 364 # first - strip off any inaccesible instances 365 if (not defined $self->prune($key)) { 366 # use the prune() method to also determine if $key is valid 367 die "invalid key: $key"; 368 } 369 370 # check to see if there is an instance on $vol_name that should be the 371 # sole survivor 372 if (defined $vol_name) { 373 $locations = $self->find_instances($key, $vol_name); 374 } 375 376 if (defined $locations) { 377 my $instances = $self->find_instances($key); 378 if (scalar @$instances < 2) { 379 die "not enough instances"; 380 } 381 foreach my $victim (@$instances) { 382 next if $victim eq $locations->[0]; 383 $self->delete_instance($key, $victim); 384 $removed++; 385 } 386 } else { 387 # nuke whatever 388 my $stats = $self->stat($key); 389 # start at one so cull() is called one less time then the # of 390 # instances 391 if ($stats->[6] < 2) { 392 die "not enough instances"; 393 } 394 for (my $i = 1; $i < $stats->[6]; $i++) { 395 $self->cull($key); 396 $removed++; 397 } 398 } 399 400 }; 401 if ($@) { 402 if ($@ =~ qr/invalid key/) { 403 $self->set_err($@); 404 return; 405 } 406 $log->logdie($@); 407 } 408 409 $log->debug("leaving"); 410 411 return $removed; 334 412 } 335 413 … … 803 881 my $self = shift; 804 882 805 my ( $key ) = validate_pos( @_, 806 { 807 type => SCALAR, 883 my ($key, $force) = validate_pos( @_, 884 { 885 type => SCALAR, 886 }, 887 { 888 type => BOOLEAN, 889 optional => 1, 890 default => undef, 891 callbacks => { 892 'is boolean' => sub { 893 $_[0] == 0 or $_[0] == 1 or $_[0] == undef; 894 }, 895 }, 808 896 }, 809 897 ); … … 817 905 # a lock is implicitly removed when the last storage object is deleted 818 906 foreach my $uri ( @$locations ) { 907 # it is being assumed here that it is better to have files on disk and 908 # not in the database then the inverse. 909 my $path; 910 eval { 911 $path = _get_file_path( $uri ); 912 }; 913 if ($@) { 914 if ($force) { 915 $log->warn($@); 916 $log->warn("exception ignored because force is in effect"); 917 } else { 918 $log->logdie($@); 919 } 920 } 921 819 922 $self->delete_instance($key, $uri) or return undef; 923 924 eval { 925 _nuke_file( $path ); 926 }; 927 if ($@) { 928 if ($force) { 929 $log->warn($@); 930 $log->warn("exception ignored because force is in effect"); 931 } else { 932 $log->logdie($@); 933 } 934 } 820 935 } 821 936 … … 959 1074 $log->debug( "entered - @_" ); 960 1075 961 # it is being assumed here that it is better to have files on disk and not in962 # the database then the inverse.963 964 my $path;965 eval {966 $path = _get_file_path( $uri );967 };968 $log->logdie( $@ ) if $@;969 970 1076 my $response = $self->{ 'server' }->delete_instance($key, $uri); 971 1077 if ( $response->fault ) { … … 982 1088 $log->debug( "server deleted instance" ); 983 1089 984 eval {985 _nuke_file( $path );986 };987 $log->logdie( $@ ) if $@;988 989 1090 $log->debug( "leaving" ); 990 1091 … … 1045 1146 1046 1147 return $stats; 1148 } 1149 1150 1151 sub chmod 1152 { 1153 my $self = shift; 1154 1155 my ($key, $mode) = validate_pos( @_, 1156 { 1157 type => SCALAR, 1158 }, 1159 { 1160 type => SCALAR, 1161 regex => qr/\d{3,4}/, 1162 }, 1163 ); 1164 1165 $log->debug( "entered - @_" ); 1166 1167 my $response = $self->{ 'server' }->chmod_object($key, $mode); 1168 if ( $response->fault ) { 1169 $self->set_err($response->faultstring); 1170 if ($response->faultstring =~ /is valid object key/) { 1171 $log->debug( "leaving" ); 1172 return; 1173 } 1174 if ($response->faultstring =~ /is allowable mode/) { 1175 $log->debug( "leaving" ); 1176 return; 1177 } 1178 1179 $log->logdie("unhandled fault - ", $self->err); 1180 } 1181 1182 my $response_mode = $response->result; 1183 1184 $log->debug( "leaving" ); 1185 1186 return $response_mode; 1187 } 1188 1189 1190 sub prune 1191 { 1192 my $self = shift; 1193 1194 my ( $key ) = validate_pos( @_, 1195 { 1196 type => SCALAR, 1197 }, 1198 ); 1199 1200 $log->debug( "entered - @_" ); 1201 1202 my $response = $self->{ 'server' }->prune_object( $key ); 1203 if ( $response->fault ) { 1204 $self->set_err($response->faultstring); 1205 if ($response->faultstring =~ /is valid object key/) { 1206 $log->debug( "leaving" ); 1207 return; 1208 } 1209 1210 $log->logdie("unhandled fault - ", $self->err); 1211 } 1212 1213 $log->debug( "server returned a stat" ); 1214 1215 my $n_removed = $response->result; 1216 1217 $log->debug( "leaving" ); 1218 1219 return $n_removed; 1047 1220 } 1048 1221 -
branches/pap/Nebulous/lib/Nebulous/Client.pod
r20094 r25027 13 13 ); 14 14 15 my $uri = $neb->create( "key", "node01");16 my $fh = $neb->open_create( "key", "node01");17 $neb->replicate( "key", "node01");18 $neb->cull( "key", "node01");19 $neb->lock( "key", 'write' );20 $neb->unlock( "key", 'write' );15 my $uri = $neb->create( $key, $vol ); 16 my $fh = $neb->open_create( $key, $vol ); 17 $neb->replicate( $key, $vol ); 18 $neb->cull( $key, $vol ); 19 $neb->lock( $key, 'write' ); 20 $neb->unlock( $key, 'write' ); 21 21 $neb->setxattr( $key, $name, $value, $flags ); 22 22 $neb->getxattr( $key, $name ); … … 24 24 $neb->removexattr( $key, $name ); 25 25 my $uris = $neb->find_objects( $pattern ); 26 my $uris = $neb->find_instances( "key", "node01");27 my $path = $neb->find( "key");28 my $fh = $neb->open( "key", 'read' );29 $neb->delete( "key");30 $neb->copy( "key", "new_key", "node01");31 $neb->move( "key", "new_key");32 $neb->swap( "key1", "key2");26 my $uris = $neb->find_instances( $key, $vol ); 27 my $path = $neb->find( $key ); 28 my $fh = $neb->open( $key, 'read' ); 29 $neb->delete( $key ); 30 $neb->copy( $key, $new_key, $vol ); 31 $neb->move( $key, $new_key ); 32 $neb->swap( $key1, $key2 ); 33 33 $neb->delete_instance( $uri ); 34 my $stats = $neb->stat( "key");34 my $stats = $neb->stat( $key ); 35 35 my $mounts = $neb->mounts(); 36 my $mode = $neb->chmod( $key, $mode ); 37 my $n_dead = $neb->prune( $key ); 38 my $n_dead = $neb->there_can_be_only_one( $key, $vol ); 36 39 37 40 =head1 DESCRIPTION … … 404 407 405 408 Returns an arrayref of scalars. 409 410 =item * prune($key) 411 412 Removes all of the inaccessible instances from an object. 413 414 =over 4 415 416 =item * key 417 418 The storage object key (name). 419 420 =back 421 422 The number of instances removed. 423 424 =item * there_can_be_only_one($key, $vol) 425 426 Removes all but one instance of an object and automatically removes any 427 inaccessible instances. 428 429 =over 4 430 431 =item * key 432 433 The storage object key (name). 434 435 =item * vol 436 437 If specified, the only remaining instance will be left on this volume (if an 438 instance already exists there). 439 440 =back 441 442 The number of avaiable instances removed. 406 443 407 444 =item * mounts() … … 425 462 ] 426 463 464 =item * chmod( $key, $mode ); 465 466 Accepts 2 parameters, both mandatory. C<$key> is the nebulous key to operate 467 on and C<$mode> are the POSIX like file permissions to set on all instances of 468 C<$key>. C<$mode> must be specified in oct. Returns C<$mode> or sucess or an 469 exception on failure. 470 427 471 =back 428 472 … … 456 500 =head1 COPYRIGHT 457 501 458 Copyright (C) 2004-200 8Joshua Hoblitt. All rights reserved.502 Copyright (C) 2004-2009 Joshua Hoblitt. All rights reserved. 459 503 460 504 This program is free software; you can redistribute it and/or modify it under -
branches/pap/Nebulous/nebclient
- Property svn:mergeinfo deleted
-
branches/pap/Nebulous/nebclient/configure.ac
r20208 r25027 5 5 AC_PREREQ(2.61) 6 6 7 AC_INIT([nebclient], [0. 08], [jhoblitt@cpan.org])7 AC_INIT([nebclient], [0.17], [jhoblitt@cpan.org]) 8 8 AC_CONFIG_SRCDIR([nebulous.wsdl]) 9 9 -
branches/pap/Nebulous/nebclient/nebulous.wsdl
r23935 r25027 140 140 </message> 141 141 142 <message name="chmod_objectRequest"> 143 <part name="key" type="xsd:string" /> 144 <part name="mode" type="xsd:int" /> 145 </message> 146 <message name="chmod_objectResponse"> 147 <!-- fixme --> 148 <part name="result" type="xsd:int" /> 149 </message> 150 151 <message name="prune_objectRequest"> 152 <part name="key" type="xsd:string" /> 153 </message> 154 <message name="prune_objectResponse"> 155 <!-- fixme --> 156 <part name="result" type="xsd:int" /> 157 </message> 158 142 159 143 160 <portType name="Nebulous/Server/SOAPPort"> … … 240 257 --> 241 258 </operation> 259 <operation name="chmod_object"> 260 <input message="tns:chmod_objectRequest" /> 261 <output message="tns:chmod_objectResponse" /> 262 <!-- 263 <fault name="" message="" /> 264 --> 265 </operation> 266 <operation name="prune_object"> 267 <input message="tns:prune_objectRequest" /> 268 <output message="tns:prune_objectResponse" /> 269 <!-- 270 <fault name="" message="" /> 271 --> 272 </operation> 242 273 </portType> 243 274 … … 390 421 <operation name="stat_object"> 391 422 <soap:operation soapAction="urn:Nebulous/Server/SOAP#stat_object" /> 423 <input> 424 <soap:body use="encoded" namespace="urn:Nebulous/Server/SOAP" 425 encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> 426 </input> 427 <output> 428 <soap:body use="encoded" namespace="urn:Nebulous/Server/SOAP" 429 encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> 430 </output> 431 </operation> 432 <operation name="chmod_object"> 433 <soap:operation soapAction="urn:Nebulous/Server/SOAP#chmod_object" /> 434 <input> 435 <soap:body use="encoded" namespace="urn:Nebulous/Server/SOAP" 436 encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> 437 </input> 438 <output> 439 <soap:body use="encoded" namespace="urn:Nebulous/Server/SOAP" 440 encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> 441 </output> 442 </operation> 443 <operation name="prune_object"> 444 <soap:operation soapAction="urn:Nebulous/Server/SOAP#prune_object" /> 392 445 <input> 393 446 <soap:body use="encoded" namespace="urn:Nebulous/Server/SOAP" -
branches/pap/Nebulous/nebclient/src/nebclient.c
r23935 r25027 51 51 static char *nullstrncpy(char *dest, const char *src, size_t n); 52 52 53 53 54 nebServer *nebServerAlloc(const char *endpoint) 54 55 { 55 nebServer *server; 56 57 server = xmalloc(sizeof(nebServer)); 56 nebServer *server = xmalloc(sizeof(nebServer)); 58 57 59 58 if (endpoint) { … … 77 76 } 78 77 78 79 79 void nebServerFree(nebServer *server) 80 80 { … … 92 92 } 93 93 94 94 95 char *nebCreate(nebServer *server, const char *key, const char *volume, char **URI) 95 96 { 97 REQUIRE_SERVER; 98 99 if (!key) { 100 nebSetErr(server, "parameter 'key' may not be NULL"); 101 102 return NULL; 103 } 104 96 105 struct ns1__create_USCOREobjectResponse response; 97 char *filename;98 99 REQUIRE_SERVER;100 101 if (!key) {102 nebSetErr(server, "parameter 'key' may not be NULL");103 104 return NULL;105 }106 107 106 if (soap_call_ns1__create_USCOREobject(server->soap, server->endpoint, NULL, 108 107 (char *)key, (char *)volume, (char **)&response) != SOAP_OK) { … … 117 116 } 118 117 118 char *filename; 119 119 if (!nebParseURI(server, (char *)response.result, &filename)) { 120 120 nebSetErr(server, "can not parse URI"); 121 nebFree(filename); 122 121 123 return NULL; 122 124 } … … 131 133 } 132 134 135 133 136 int nebOpenCreate(nebServer *server, const char *key, const char *volume, char **URI) 134 137 { 135 char *filename;136 int file; 137 138 REQUIRE_SERVER;139 140 if (!key) {141 nebSetErr(server, "parameter 'key' may not be NULL");142 143 return -1;144 }145 146 filename = nebCreate(server, key, volume, URI);147 148 file = open(filename, O_RDWR|O_TRUNC, 0660);138 REQUIRE_SERVER; 139 140 if (!key) { 141 nebSetErr(server, "parameter 'key' may not be NULL"); 142 143 return -1; 144 } 145 146 char *filename = nebCreate(server, key, volume, URI); 147 if (!filename) { 148 return -1; 149 } 150 151 int file = open(filename, O_RDWR|O_TRUNC, 0660); 149 152 if (file == -1) { 150 153 nebSetErr(server, "can not open %s: %s", filename, strerror(errno)); … … 159 162 } 160 163 164 161 165 bool nebReplicate(nebServer *server, const char *key, const char *volume, char **URI) 162 166 { 163 struct ns1__replicate_USCOREobjectResponse response;164 char *filename;165 int sourceFH, destFH;166 167 167 REQUIRE_SERVER; 168 168 … … 177 177 // we don't do this, it's possible that open will find & open the new 178 178 // instance that we're in the process of creating 179 sourceFH = nebOpen(server, (char *)key, NEB_READ);179 int sourceFH = nebOpen(server, (char *)key, NEB_READ); 180 180 if (sourceFH == -1) { 181 181 nebSetErr(server, "can not open key %s", key); 182 nebFree(filename);183 182 184 183 return false; … … 186 185 187 186 // ask the server for a new instance attached to our key 187 struct ns1__replicate_USCOREobjectResponse response; 188 188 if (soap_call_ns1__replicate_USCOREobject(server->soap, server->endpoint, 189 189 NULL, (char *)key, (char *)volume, (char **)&response) != SOAP_OK) { … … 193 193 } 194 194 195 char *filename = NULL; 195 196 if (!nebParseURI(server, (char *)response.result, &filename)) { 196 197 nebSetErr(server, "can not parse URI"); … … 199 200 } 200 201 201 destFH = open(filename, O_RDWR|O_TRUNC, 0660);202 int destFH = open(filename, O_RDWR|O_TRUNC, 0660); 202 203 if (destFH == -1) { 203 204 nebSetErr(server, "can not open %s: %s\n", filename, strerror(errno)); … … 234 235 } 235 236 237 236 238 bool nebCull(nebServer *server, const char *key) 237 239 { 238 nebObjectInstances *locations; 239 240 REQUIRE_SERVER; 241 242 if (!key) { 243 nebSetErr(server, "parameter 'key' may not be NULL"); 244 245 return false; 246 } 247 248 locations = nebFindInstances(server, key, NULL); 240 REQUIRE_SERVER; 241 242 if (!key) { 243 nebSetErr(server, "parameter 'key' may not be NULL"); 244 245 return false; 246 } 247 248 nebObjectInstances *locations = nebFindInstances(server, key, NULL); 249 249 if (!locations || locations->n <= 1) { 250 250 nebSetErr(server, "can not cull - not enough instances"); 251 if (locations) { 252 nebObjectInstancesFree(locations); 253 } 251 254 252 255 return false; … … 264 267 } 265 268 269 266 270 bool nebLock(nebServer *server, const char *key, nebRW flag) 267 271 { 268 time_t endtime; 269 char *type; 270 int response; 271 272 REQUIRE_SERVER; 273 274 if (!key) { 275 nebSetErr(server, "parameter 'key' may not be NULL"); 276 277 return false; 278 } 279 280 type = flag == NEB_READ ? "read" : "write"; 281 282 endtime = time(NULL) + LOCK_TIMEOUT; 272 REQUIRE_SERVER; 273 274 if (!key) { 275 nebSetErr(server, "parameter 'key' may not be NULL"); 276 277 return false; 278 } 279 280 char *type = flag == NEB_READ ? "read" : "write"; 281 282 time_t endtime = time(NULL) + LOCK_TIMEOUT; 283 283 284 284 while (time(NULL) < endtime) { 285 int response; 285 286 if (soap_call_ns1__lock_USCOREobject(server->soap, server->endpoint, 286 287 NULL, (char *)key, type, &response) != SOAP_OK) { … … 302 303 } 303 304 305 304 306 bool nebUnlock(nebServer *server, const char *key, nebRW flag) 305 307 { 306 char *type; 307 int response; 308 309 REQUIRE_SERVER; 310 311 if (!key) { 312 nebSetErr(server, "parameter 'key' may not be NULL"); 313 314 return false; 315 } 316 317 type = flag == NEB_READ ? "read" : "write"; 318 308 REQUIRE_SERVER; 309 310 if (!key) { 311 nebSetErr(server, "parameter 'key' may not be NULL"); 312 313 return false; 314 } 315 316 char *type = flag == NEB_READ ? "read" : "write"; 317 318 int response; 319 319 if (soap_call_ns1__unlock_USCOREobject(server->soap, server->endpoint, 320 320 NULL, (char *)key, type, &response) != SOAP_OK) { … … 466 466 nebObjectInstances *nebFindInstances(nebServer *server, const char *key, const char *volume) 467 467 { 468 REQUIRE_SERVER; 469 470 if (!key) { 471 nebSetErr(server, "parameter 'key' may not be NULL"); 472 473 return NULL; 474 } 475 468 476 struct ns1__find_USCOREinstancesResponse response; 469 int resultElements = 0;470 char **resultArray;471 nebObjectInstances *locations = NULL;472 473 REQUIRE_SERVER;474 475 if (!key) {476 nebSetErr(server, "parameter 'key' may not be NULL");477 478 return NULL;479 }480 481 477 // FIXME is this leaking memory when response goes out of scope? the gsoap 482 478 // manual seems to 'suggest' that this is temporary data that gets cleaed … … 488 484 } 489 485 490 resultElements = response.result->__size; 491 486 int resultElements = response.result->__size; 487 488 nebObjectInstances *locations = NULL; 492 489 if (resultElements) { 493 490 locations = xmalloc(sizeof(nebObjectInstances)); 494 491 locations->n = resultElements; 495 492 496 resultArray= response.result->__ptr;493 char **resultArray = response.result->__ptr; 497 494 498 495 locations->URI = xmalloc(sizeof(char*) * resultElements); … … 508 505 } 509 506 507 510 508 void nebObjectInstancesFree(nebObjectInstances *locations) 511 509 { … … 521 519 } 522 520 521 523 522 char *nebFind(nebServer *server, const char *key) 524 523 { 525 nebObjectInstances *locations;526 char *filename;527 528 524 REQUIRE_SERVER; 529 525 … … 534 530 } 535 531 536 locations = nebFindInstances(server, key, NULL);532 nebObjectInstances *locations = nebFindInstances(server, key, NULL); 537 533 if (!locations) { 538 534 if (!strstr(nebErr(server), "no instances on storage volume")) { … … 548 544 } 549 545 546 char *filename; 550 547 if (!nebParseURI(server, locations->URI[0], &filename)) { 551 548 nebSetErr(server, "can not parse URI"); … … 560 557 } 561 558 559 562 560 int nebOpen(nebServer *server, const char *key, nebRW flag) 563 561 { 564 nebObjectInstances *locations; 565 char *filename; 566 int fh; 567 568 REQUIRE_SERVER; 569 570 if (!key) { 571 nebSetErr(server, "parameter 'key' may not be NULL"); 572 573 return -1; 574 } 575 576 locations = nebFindInstances(server, key, NULL); 562 REQUIRE_SERVER; 563 564 if (!key) { 565 nebSetErr(server, "parameter 'key' may not be NULL"); 566 567 return -1; 568 } 569 570 nebObjectInstances *locations = nebFindInstances(server, key, NULL); 577 571 if (!locations) { 578 572 nebSetErr(server, "no instances found"); … … 581 575 } 582 576 577 char *filename; 583 578 if (!nebParseURI(server, locations->URI[0], &filename)) { 584 579 nebSetErr(server, "can not parse URI"); … … 588 583 } 589 584 585 int fh = 0; 590 586 if (flag == NEB_WRITE) { 591 587 if (locations->n > 1) { … … 613 609 } 614 610 611 615 612 bool nebDelete(nebServer *server, const char *key) 616 613 { 617 nebObjectInstances *locations; 618 619 REQUIRE_SERVER; 620 621 if (!key) { 622 nebSetErr(server, "parameter 'key' may not be NULL"); 623 624 return false; 625 } 626 627 locations = nebFindInstances(server, key, "any"); 614 REQUIRE_SERVER; 615 616 if (!key) { 617 nebSetErr(server, "parameter 'key' may not be NULL"); 618 619 return false; 620 } 621 622 nebObjectInstances *locations = nebFindInstances(server, key, "any"); 628 623 if (!locations) { 629 624 nebSetErr(server, "no instances found"); … … 646 641 } 647 642 643 648 644 bool nebCopy(nebServer *server, const char *key, const char *newKey) 649 645 { 650 int sourceFH;651 int destFH;652 653 646 REQUIRE_SERVER; 654 647 … … 665 658 } 666 659 667 sourceFH = nebOpen(server, (char *)key, NEB_READ);660 int sourceFH = nebOpen(server, (char *)key, NEB_READ); 668 661 if (sourceFH < 0) { 669 662 // propigate nebOpen() error … … 672 665 } 673 666 674 destFH = nebOpenCreate(server, newKey, NULL, NULL);667 int destFH = nebOpenCreate(server, newKey, NULL, NULL); 675 668 if (destFH < 0) { 676 669 // propigate nebCreate() error … … 696 689 } 697 690 691 698 692 bool nebMove(nebServer *server, const char *key, const char *newKey) 699 693 { … … 723 717 } 724 718 719 725 720 bool nebSwap(nebServer *server, const char *key1, const char *key2) 726 721 { 727 struct ns1__create_USCOREobjectResponse response;728 729 722 REQUIRE_SERVER; 730 723 … … 741 734 } 742 735 736 struct ns1__create_USCOREobjectResponse response; 743 737 if (soap_call_ns1__swap_USCOREobjects(server->soap, server->endpoint, 744 738 NULL, (char *)key1, (char *)key2, (char **)&response) != SOAP_OK) { … … 749 743 } 750 744 745 751 746 bool nebDeleteInstance(nebServer *server, const char *key, const char *URI) 752 747 { 753 int response;754 char *filename;755 bool status;756 757 748 REQUIRE_SERVER; 758 749 … … 763 754 } 764 755 756 char *filename; 765 757 if (!nebParseURI(server, URI, &filename)) { 766 758 nebSetErr(server, "can not parse URI"); … … 769 761 } 770 762 763 int response; 771 764 if (soap_call_ns1__delete_USCOREinstance(server->soap, server->endpoint, 772 765 NULL, (char *)key, (char *)URI, &response) != SOAP_OK) { … … 776 769 } 777 770 771 bool status; 778 772 if (response > 0) { 779 773 status = nebNukeFile(server, filename); … … 787 781 } 788 782 783 789 784 nebObjectStat *nebStat(nebServer *server, const char *key) 790 785 { 791 struct ns1__stat_USCOREobjectResponse response;792 nebObjectStat *stat;793 int resultElements = 0;794 char **resultArray = NULL;795 796 786 REQUIRE_SERVER; 797 787 … … 802 792 } 803 793 804 stat = xmalloc(sizeof(nebObjectStat));794 nebObjectStat *stat = xmalloc(sizeof(nebObjectStat)); 805 795 806 796 // FIXME is this leaking memory when response goes out of scope? the gsoap 807 797 // manual seems to 'suggest' that this is temporary data that gets cleaed 808 798 // up on the next soap function call 799 struct ns1__stat_USCOREobjectResponse response; 809 800 if (soap_call_ns1__stat_USCOREobject(server->soap, server->endpoint, 810 801 NULL, (char *)key, &response) != SOAP_OK) { … … 813 804 } 814 805 815 resultElements = response.result->__size;816 resultArray = response.result->__ptr;817 818 if (resultElements != 7) {806 int resultElements = response.result->__size; 807 char **resultArray = response.result->__ptr; 808 809 if (resultElements != 8) { 819 810 nebSetErr(server, "server didn't return the proper number of stat elements"); 820 811 return NULL; 821 812 } 822 813 823 nullstrncpy(stat->so_id, resultArray[0], 256);824 nullstrncpy(stat->ext_id, resultArray[1], 256);825 nullstrncpy(stat->read_lock, resultArray[2], 256);814 stat->so_id = atol(resultArray[0]); 815 stat->ext_id = atol(resultArray[1]); 816 stat->read_lock = atoi(resultArray[2]); 826 817 nullstrncpy(stat->write_lock, resultArray[3], 256); 827 818 nullstrncpy(stat->epoch, resultArray[4], 256); 828 819 nullstrncpy(stat->mtime, resultArray[5], 256); 829 stat->instances = atoi(resultArray[6]); 820 stat->available = atoi(resultArray[6]); 821 stat->instances = atoi(resultArray[7]); 830 822 831 823 return stat; 832 824 } 833 825 826 827 void nebObjectStatFree(nebObjectStat *stat) 828 { 829 if (!stat) { 830 return; 831 } 832 833 nebFree(stat); 834 } 835 836 837 int nebChmod(nebServer *server, const char *key, mode_t mode) 838 { 839 REQUIRE_SERVER; 840 841 if (!key) { 842 nebSetErr(server, "parameter 'key' may not be NULL"); 843 844 return -1; 845 } 846 847 // FIXME is this leaking memory when response goes out of scope? the gsoap 848 // manual seems to 'suggest' that this is temporary data that gets cleaed 849 // up on the next soap function call 850 int response; 851 if (soap_call_ns1__chmod_USCOREobject(server->soap, server->endpoint, 852 NULL, (char *)key, mode, &response) != SOAP_OK) { 853 nebSetServerErr(server); 854 return -1; 855 } 856 857 return 0; 858 } 859 860 861 int nebPrune(nebServer *server, const char *key) 862 { 863 REQUIRE_SERVER; 864 865 if (!key) { 866 nebSetErr(server, "parameter 'key' may not be NULL"); 867 868 return -1; 869 } 870 871 // FIXME is this leaking memory when response goes out of scope? the gsoap 872 // manual seems to 'suggest' that this is temporary data that gets cleaed 873 // up on the next soap function call 874 int response; 875 if (soap_call_ns1__prune_USCOREobject(server->soap, server->endpoint, 876 NULL, (char *)key, &response) != SOAP_OK) { 877 nebSetServerErr(server); 878 return -1; 879 } 880 881 return response; 882 } 883 884 885 int nebThereCanBeOnlyOne(nebServer *server, const char *key, const char *volume) 886 { 887 REQUIRE_SERVER; 888 889 if (!key) { 890 nebSetErr(server, "parameter 'key' may not be NULL"); 891 892 return -1; 893 } 894 895 // first - strip off any inaccesible instances 896 if (nebPrune(server, key) < 0 ) { 897 // use the prune() method to also determine if $key is valid 898 return -1; 899 } 900 901 // check to see if there is an instance on $vol_name that should be the 902 // sole survivor 903 nebObjectInstances *locations = NULL; 904 if (volume) { 905 locations = nebFindInstances(server, key, NULL); 906 } 907 908 long removed = 0; 909 if (locations && locations->n) { 910 nebObjectInstances *instances = nebFindInstances(server, key, NULL); 911 for (long i = 0; i < instances->n; i++) { 912 if (strcmp(locations->URI[0], instances->URI[i]) == 0) { 913 continue; 914 } 915 if (!nebDeleteInstance(server, key, instances->URI[i])) { 916 nebObjectInstancesFree(instances); 917 nebObjectInstancesFree(locations); 918 return -1; 919 } 920 removed++; 921 } 922 nebObjectInstancesFree(instances); 923 nebObjectInstancesFree(locations); 924 } else { 925 nebObjectInstancesFree(locations); 926 // nuke whatever 927 nebObjectStat *stat = nebStat(server, key); 928 if (!stat) { 929 return -1; 930 } 931 932 int available = stat->available; 933 nebObjectStatFree(stat); 934 935 // start at one so cull() is called one less time then the # of 936 // instances 937 for (long i = 1; i < available; i++) { 938 if (!nebCull(server, key)) { 939 return -1; 940 } 941 removed++; 942 } 943 } 944 945 return removed; 946 } 947 948 834 949 char *nebErr(nebServer *server) 835 950 { … … 837 952 } 838 953 954 839 955 void nebFree(void *ptr) { 956 if (!ptr) { return; } 840 957 xfree(ptr); 841 958 } … … 844 961 static void p_nebSetErr(const char * filename, unsigned long lineno, const char *function, nebServer *server, const char *format, ...) 845 962 { 846 va_list args; 847 size_t err_size; 848 char err_location[ERRBUF_SIZE]; 849 size_t err_location_size; 850 851 err_location_size = snprintf(err_location, ERRBUF_SIZE, "%s:%lu %s() - ", 963 char err_location[ERRBUF_SIZE]; 964 size_t err_location_size = snprintf(err_location, ERRBUF_SIZE, "%s:%lu %s() - ", 852 965 filename, lineno, function); 853 966 … … 862 975 863 976 while (1) { 977 va_list args; 864 978 va_start(args, format); 865 979 // append error string after error location info 866 err_size = vsnprintf(980 size_t err_size = vsnprintf( 867 981 server->err_buf + err_location_size, 868 982 server->err_buf_size - err_location_size, … … 888 1002 } 889 1003 1004 890 1005 static void nebSetServerErr(nebServer *server) 891 1006 { 892 const char **code; 893 const char **string; 894 895 REQUIRE_SERVER; 896 897 code = soap_faultcode(server->soap); 898 string = soap_faultstring(server->soap); 1007 REQUIRE_SERVER; 1008 1009 const char **code = soap_faultcode(server->soap); 1010 const char **string = soap_faultstring(server->soap); 899 1011 900 1012 nebSetErr(server, "%s - %s", *code, *string); 901 1013 } 1014 902 1015 903 1016 #if NEBCOPYFILE 904 1017 static off_t nebCopyFile(nebServer *server, const char *source, const char *dest) 905 1018 { 906 int sourceFH; 907 int destFH; 908 off_t bytesCopied; 909 910 REQUIRE_SERVER; 911 912 sourceFH = open(source, O_RDONLY); 1019 REQUIRE_SERVER; 1020 1021 int sourceFH = open(source, O_RDONLY); 913 1022 if (sourceFH == -1) { 914 1023 nebSetErr(server, "can not open %s: %s", source, strerror(errno)); … … 917 1026 } 918 1027 919 destFH = open(dest, O_WRONLY|O_CREAT|O_CREAT, 0600);1028 int destFH = open(dest, O_WRONLY|O_CREAT|O_CREAT, 0600); 920 1029 if (destFH == -1) { 921 1030 nebSetErr(server, "can not open %s: %s", dest, strerror(errno)); … … 924 1033 } 925 1034 926 bytesCopied = nebCopyFilehandle(server, sourceFH, destFH);1035 off_t bytesCopied = nebCopyFilehandle(server, sourceFH, destFH); 927 1036 if (bytesCopied < 0) { 928 1037 return -1; … … 945 1054 #endif 946 1055 1056 947 1057 static off_t nebCopyFilehandle(nebServer *server, int sourceFH, int destFH) 948 1058 { 949 off_t bytesTotal; 950 off_t bytesRemaining; 951 off_t writeSize; 952 char writeBuf[64 * 1024]; 1059 REQUIRE_SERVER; 1060 953 1061 struct stat sourceStat; 954 955 REQUIRE_SERVER;956 957 1062 if(fstat(sourceFH, &sourceStat)) { 958 1063 nebSetErr(server, "can not stat filehandles: %s", strerror(errno)); … … 962 1067 963 1068 // the size of the file to copied 964 bytesTotal = sourceStat.st_size;1069 off_t bytesTotal = sourceStat.st_size; 965 1070 966 1071 /* … … 970 1075 */ 971 1076 972 bytesRemaining = bytesTotal;1077 off_t bytesRemaining = bytesTotal; 973 1078 974 1079 while (bytesRemaining) { 1080 off_t writeSize; 1081 char writeBuf[64 * 1024]; 975 1082 if (bytesRemaining <= sizeof(writeBuf)) { 976 1083 writeSize = bytesRemaining; … … 997 1104 } 998 1105 1106 999 1107 static size_t nebParseURI(nebServer *server, const char *URI, char **filename) 1000 1108 { 1001 regex_t myregex;1002 regmatch_t mymatch[2];1003 char errbuf[ERRBUF_SIZE];1004 char *pattern = "^file://(.*)$";1005 int status;1006 size_t matchStart, matchEnd;1007 size_t matchLength;1008 size_t filename_size;1009 1010 1109 REQUIRE_SERVER; 1011 1110 … … 1022 1121 } 1023 1122 1024 status = regcomp(&myregex, pattern, REG_EXTENDED); 1123 regex_t myregex; 1124 regmatch_t mymatch[2]; 1125 char *pattern = "^file://(.*)$"; 1126 char errbuf[ERRBUF_SIZE]; 1127 1128 int status = regcomp(&myregex, pattern, REG_EXTENDED); 1025 1129 if (status != 0) { 1026 1130 regerror(status, &myregex, errbuf, ERRBUF_SIZE); … … 1040 1144 regfree(&myregex); 1041 1145 1042 matchStart = (size_t)mymatch[1].rm_so;1043 matchEnd = (size_t)mymatch[1].rm_eo;1044 matchLength = matchEnd - matchStart;1146 size_t matchStart = (size_t)mymatch[1].rm_so; 1147 size_t matchEnd = (size_t)mymatch[1].rm_eo; 1148 size_t matchLength = matchEnd - matchStart; 1045 1149 1046 1150 if (matchStart == -1) { … … 1048 1152 } 1049 1153 1050 filename_size = matchLength + 1;1154 size_t filename_size = matchLength + 1; 1051 1155 *filename = xmalloc(filename_size); 1052 1156 … … 1055 1159 return strlen(*filename); 1056 1160 } 1161 1057 1162 1058 1163 static bool nebNukeFile(nebServer *server, const char *filename) … … 1074 1179 return true; 1075 1180 } 1181 1076 1182 1077 1183 static char *nullstrncpy(char *dest, const char *src, size_t n) { … … 1081 1187 } 1082 1188 1189 if (!dest) { 1190 dest = xmalloc(n + 1); 1191 } 1192 1083 1193 return strncpy(dest, src, n); 1084 1194 } -
branches/pap/Nebulous/nebclient/src/nebclient.h
r23935 r25027 11 11 #ifndef NEBCLIENT_H 12 12 #define NEBCLIENT_H 1 13 14 // #include <sys/stat.h> 13 15 14 16 #ifdef __cplusplus … … 36 38 37 39 typedef struct { 38 char so_id[256];///< storage object ID39 char ext_id[256];///< storage object key (name)40 char read_lock[256];///< read lock value40 long so_id; ///< storage object ID 41 long ext_id; ///< storage object key (name) 42 int read_lock; ///< read lock value 41 43 char write_lock[256]; ///< write lock value 42 44 char epoch[256]; ///< creation time stamp 43 45 char mtime[256]; ///< modification time stamp 44 int instances; ///< number of instances 46 int available; ///< number of available instances 47 int instances; ///< total number of instances 45 48 } nebObjectStat; 46 49 … … 293 296 nebObjectStat *nebStat( 294 297 nebServer *server, ///< nebServer object 295 const char *key /// storage object key (name) 298 const char *key ///< storage object key (name) 299 ); 300 301 302 /** Deallocates a stat object 303 */ 304 void nebObjectStatFree( 305 nebObjectStat *stat ///< nebObjectStat object 306 ); 307 308 /** Change permissions of a storage objects 309 * 310 * This function will change the file permissions of all currently on disk 311 * instances of a storage object. 312 * 313 * @return the new mode or NULL on failure. 314 */ 315 316 int nebChmod( 317 nebServer *server, ///< nebServer object 318 const char *key, ///< storage object key (name) 319 mode_t mode ///< chmod(2) compatible mode (mode_t) 320 ); 321 322 /** Removes all of the inaccessible instances from an object 323 * 324 * @return the number of inaccessible instances removed 325 */ 326 327 int nebPrune( 328 nebServer *server, ///< nebServer object 329 const char *key ///< storage object key (name) 330 ); 331 332 /** Removes all but one instances of an object 333 * 334 * @return the number of available instances removed 335 */ 336 337 int nebThereCanBeOnlyOne( 338 nebServer *server, ///< nebServer object 339 const char *key, ///< storage object key (name) 340 const char *volume ///< leave remain instance on this volume 296 341 ); 297 342 -
branches/pap/Nebulous/nebclient/src/nebulous.h
r23935 r25027 1 1 /* src/nebulous.h 2 2 Generated by wsdl2h 1.2.12 from nebulous.wsdl and typemap.dat 3 2009-0 4-20 22:15:21GMT3 2009-07-25 01:30:29 GMT 4 4 Copyright (C) 2001-2008 Robert van Engelen, Genivia Inc. All Rights Reserved. 5 5 This part of the software is released under one of the following licenses: … … 119 119 - @ref ns1__delete_USCOREinstance 120 120 - @ref ns1__stat_USCOREobject 121 - @ref ns1__chmod_USCOREobject 122 - @ref ns1__prune_USCOREobject 121 123 122 124 @section SOAP_ports Endpoints of Binding "SOAP" … … 893 895 ); 894 896 897 /******************************************************************************\ 898 * * 899 * ns1__chmod_USCOREobject * 900 * * 901 \******************************************************************************/ 902 903 904 /// Operation "ns1__chmod_USCOREobject" of service binding "SOAP" 905 906 /** 907 908 Operation details: 909 910 - SOAP RPC encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 911 - SOAP action="urn:Nebulous/Server/SOAP#chmod_object" 912 913 C stub function (defined in soapClient.c[pp] generated by soapcpp2): 914 @code 915 int soap_call_ns1__chmod_USCOREobject( 916 struct soap *soap, 917 NULL, // char *endpoint = NULL selects default endpoint for this operation 918 NULL, // char *action = NULL selects default action for this operation 919 // request parameters: 920 char* key, 921 int mode, 922 // response parameters: 923 int *result 924 ); 925 @endcode 926 927 C server function (called from the service dispatcher defined in soapServer.c[pp]): 928 @code 929 int ns1__chmod_USCOREobject( 930 struct soap *soap, 931 // request parameters: 932 char* key, 933 int mode, 934 // response parameters: 935 int *result 936 ); 937 @endcode 938 939 */ 940 941 //gsoap ns1 service method-style: chmod_USCOREobject rpc 942 //gsoap ns1 service method-encoding: chmod_USCOREobject http://schemas.xmlsoap.org/soap/encoding/ 943 //gsoap ns1 service method-action: chmod_USCOREobject urn:Nebulous/Server/SOAP#chmod_object 944 int ns1__chmod_USCOREobject( 945 char* key, ///< Request parameter 946 int mode, ///< Request parameter 947 int *result ///< Response parameter 948 ); 949 950 /******************************************************************************\ 951 * * 952 * ns1__prune_USCOREobject * 953 * * 954 \******************************************************************************/ 955 956 957 /// Operation "ns1__prune_USCOREobject" of service binding "SOAP" 958 959 /** 960 961 Operation details: 962 963 - SOAP RPC encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 964 - SOAP action="urn:Nebulous/Server/SOAP#prune_object" 965 966 C stub function (defined in soapClient.c[pp] generated by soapcpp2): 967 @code 968 int soap_call_ns1__prune_USCOREobject( 969 struct soap *soap, 970 NULL, // char *endpoint = NULL selects default endpoint for this operation 971 NULL, // char *action = NULL selects default action for this operation 972 // request parameters: 973 char* key, 974 // response parameters: 975 int *result 976 ); 977 @endcode 978 979 C server function (called from the service dispatcher defined in soapServer.c[pp]): 980 @code 981 int ns1__prune_USCOREobject( 982 struct soap *soap, 983 // request parameters: 984 char* key, 985 // response parameters: 986 int *result 987 ); 988 @endcode 989 990 */ 991 992 //gsoap ns1 service method-style: prune_USCOREobject rpc 993 //gsoap ns1 service method-encoding: prune_USCOREobject http://schemas.xmlsoap.org/soap/encoding/ 994 //gsoap ns1 service method-action: prune_USCOREobject urn:Nebulous/Server/SOAP#prune_object 995 int ns1__prune_USCOREobject( 996 char* key, ///< Request parameter 997 int *result ///< Response parameter 998 ); 999 895 1000 /* End of src/nebulous.h */ -
branches/pap/Nebulous/nebclient/src/soapC.c
r23935 r25027 12 12 #endif 13 13 14 SOAP_SOURCE_STAMP("@(#) soapC.c ver 2.7.12 2009-0 4-20 22:15:22GMT")14 SOAP_SOURCE_STAMP("@(#) soapC.c ver 2.7.12 2009-07-25 01:30:29 GMT") 15 15 16 16 … … 161 161 case SOAP_TYPE_int: 162 162 return soap_in_int(soap, NULL, NULL, "xsd:int"); 163 case SOAP_TYPE_ns1__prune_USCOREobject: 164 return soap_in_ns1__prune_USCOREobject(soap, NULL, NULL, "ns1:prune_object"); 165 case SOAP_TYPE_ns1__prune_USCOREobjectResponse: 166 return soap_in_ns1__prune_USCOREobjectResponse(soap, NULL, NULL, "ns1:prune_objectResponse"); 167 case SOAP_TYPE_ns1__chmod_USCOREobject: 168 return soap_in_ns1__chmod_USCOREobject(soap, NULL, NULL, "ns1:chmod_object"); 169 case SOAP_TYPE_ns1__chmod_USCOREobjectResponse: 170 return soap_in_ns1__chmod_USCOREobjectResponse(soap, NULL, NULL, "ns1:chmod_objectResponse"); 163 171 case SOAP_TYPE_ns1__stat_USCOREobject: 164 172 return soap_in_ns1__stat_USCOREobject(soap, NULL, NULL, "ns1:stat_object"); … … 250 258 return soap_in_int(soap, NULL, NULL, NULL); 251 259 } 260 if (!soap_match_tag(soap, t, "ns1:prune_object")) 261 { *type = SOAP_TYPE_ns1__prune_USCOREobject; 262 return soap_in_ns1__prune_USCOREobject(soap, NULL, NULL, NULL); 263 } 264 if (!soap_match_tag(soap, t, "ns1:prune_objectResponse")) 265 { *type = SOAP_TYPE_ns1__prune_USCOREobjectResponse; 266 return soap_in_ns1__prune_USCOREobjectResponse(soap, NULL, NULL, NULL); 267 } 268 if (!soap_match_tag(soap, t, "ns1:chmod_object")) 269 { *type = SOAP_TYPE_ns1__chmod_USCOREobject; 270 return soap_in_ns1__chmod_USCOREobject(soap, NULL, NULL, NULL); 271 } 272 if (!soap_match_tag(soap, t, "ns1:chmod_objectResponse")) 273 { *type = SOAP_TYPE_ns1__chmod_USCOREobjectResponse; 274 return soap_in_ns1__chmod_USCOREobjectResponse(soap, NULL, NULL, NULL); 275 } 252 276 if (!soap_match_tag(soap, t, "ns1:stat_object")) 253 277 { *type = SOAP_TYPE_ns1__stat_USCOREobject; … … 440 464 case SOAP_TYPE_int: 441 465 return soap_out_int(soap, tag, id, (const int *)ptr, "xsd:int"); 466 case SOAP_TYPE_ns1__prune_USCOREobject: 467 return soap_out_ns1__prune_USCOREobject(soap, tag, id, (const struct ns1__prune_USCOREobject *)ptr, "ns1:prune_object"); 468 case SOAP_TYPE_ns1__prune_USCOREobjectResponse: 469 return soap_out_ns1__prune_USCOREobjectResponse(soap, tag, id, (const struct ns1__prune_USCOREobjectResponse *)ptr, "ns1:prune_objectResponse"); 470 case SOAP_TYPE_ns1__chmod_USCOREobject: 471 return soap_out_ns1__chmod_USCOREobject(soap, tag, id, (const struct ns1__chmod_USCOREobject *)ptr, "ns1:chmod_object"); 472 case SOAP_TYPE_ns1__chmod_USCOREobjectResponse: 473 return soap_out_ns1__chmod_USCOREobjectResponse(soap, tag, id, (const struct ns1__chmod_USCOREobjectResponse *)ptr, "ns1:chmod_objectResponse"); 442 474 case SOAP_TYPE_ns1__stat_USCOREobject: 443 475 return soap_out_ns1__stat_USCOREobject(soap, tag, id, (const struct ns1__stat_USCOREobject *)ptr, "ns1:stat_object"); … … 527 559 switch (type) 528 560 { 561 case SOAP_TYPE_ns1__prune_USCOREobject: 562 soap_serialize_ns1__prune_USCOREobject(soap, (const struct ns1__prune_USCOREobject *)ptr); 563 break; 564 case SOAP_TYPE_ns1__prune_USCOREobjectResponse: 565 soap_serialize_ns1__prune_USCOREobjectResponse(soap, (const struct ns1__prune_USCOREobjectResponse *)ptr); 566 break; 567 case SOAP_TYPE_ns1__chmod_USCOREobject: 568 soap_serialize_ns1__chmod_USCOREobject(soap, (const struct ns1__chmod_USCOREobject *)ptr); 569 break; 570 case SOAP_TYPE_ns1__chmod_USCOREobjectResponse: 571 soap_serialize_ns1__chmod_USCOREobjectResponse(soap, (const struct ns1__chmod_USCOREobjectResponse *)ptr); 572 break; 529 573 case SOAP_TYPE_ns1__stat_USCOREobject: 530 574 soap_serialize_ns1__stat_USCOREobject(soap, (const struct ns1__stat_USCOREobject *)ptr); … … 1195 1239 #endif 1196 1240 1241 SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns1__prune_USCOREobject(struct soap *soap, struct ns1__prune_USCOREobject *a) 1242 { 1243 (void)soap; (void)a; /* appease -Wall -Werror */ 1244 soap_default_string(soap, &a->key); 1245 } 1246 1247 SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_ns1__prune_USCOREobject(struct soap *soap, const struct ns1__prune_USCOREobject *a) 1248 { 1249 (void)soap; (void)a; /* appease -Wall -Werror */ 1250 soap_serialize_string(soap, &a->key); 1251 } 1252 1253 SOAP_FMAC3 int SOAP_FMAC4 soap_put_ns1__prune_USCOREobject(struct soap *soap, const struct ns1__prune_USCOREobject *a, const char *tag, const char *type) 1254 { 1255 register int id = soap_embed(soap, (void*)a, NULL, 0, tag, SOAP_TYPE_ns1__prune_USCOREobject); 1256 if (soap_out_ns1__prune_USCOREobject(soap, tag, id, a, type)) 1257 return soap->error; 1258 return soap_putindependent(soap); 1259 } 1260 1261 SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__prune_USCOREobject(struct soap *soap, const char *tag, int id, const struct ns1__prune_USCOREobject *a, const char *type) 1262 { 1263 if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_ns1__prune_USCOREobject), type)) 1264 return soap->error; 1265 if (soap_out_string(soap, "key", -1, &a->key, "")) 1266 return soap->error; 1267 return soap_element_end_out(soap, tag); 1268 } 1269 1270 SOAP_FMAC3 struct ns1__prune_USCOREobject * SOAP_FMAC4 soap_get_ns1__prune_USCOREobject(struct soap *soap, struct ns1__prune_USCOREobject *p, const char *tag, const char *type) 1271 { 1272 if ((p = soap_in_ns1__prune_USCOREobject(soap, tag, p, type))) 1273 if (soap_getindependent(soap)) 1274 return NULL; 1275 return p; 1276 } 1277 1278 SOAP_FMAC3 struct ns1__prune_USCOREobject * SOAP_FMAC4 soap_in_ns1__prune_USCOREobject(struct soap *soap, const char *tag, struct ns1__prune_USCOREobject *a, const char *type) 1279 { 1280 size_t soap_flag_key = 1; 1281 if (soap_element_begin_in(soap, tag, 0, type)) 1282 return NULL; 1283 a = (struct ns1__prune_USCOREobject *)soap_id_enter(soap, soap->id, a, SOAP_TYPE_ns1__prune_USCOREobject, sizeof(struct ns1__prune_USCOREobject), 0, NULL, NULL, NULL); 1284 if (!a) 1285 return NULL; 1286 soap_default_ns1__prune_USCOREobject(soap, a); 1287 if (soap->body && !*soap->href) 1288 { 1289 for (;;) 1290 { soap->error = SOAP_TAG_MISMATCH; 1291 if (soap_flag_key && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) 1292 if (soap_in_string(soap, "key", &a->key, "xsd:string")) 1293 { soap_flag_key--; 1294 continue; 1295 } 1296 if (soap->error == SOAP_TAG_MISMATCH) 1297 soap->error = soap_ignore_element(soap); 1298 if (soap->error == SOAP_NO_TAG) 1299 break; 1300 if (soap->error) 1301 return NULL; 1302 } 1303 if (soap_element_end_in(soap, tag)) 1304 return NULL; 1305 } 1306 else 1307 { a = (struct ns1__prune_USCOREobject *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_ns1__prune_USCOREobject, 0, sizeof(struct ns1__prune_USCOREobject), 0, NULL); 1308 if (soap->body && soap_element_end_in(soap, tag)) 1309 return NULL; 1310 } 1311 return a; 1312 } 1313 1314 SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns1__prune_USCOREobjectResponse(struct soap *soap, struct ns1__prune_USCOREobjectResponse *a) 1315 { 1316 (void)soap; (void)a; /* appease -Wall -Werror */ 1317 a->result = NULL; 1318 } 1319 1320 SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_ns1__prune_USCOREobjectResponse(struct soap *soap, const struct ns1__prune_USCOREobjectResponse *a) 1321 { 1322 (void)soap; (void)a; /* appease -Wall -Werror */ 1323 soap_serialize_PointerToint(soap, &a->result); 1324 } 1325 1326 SOAP_FMAC3 int SOAP_FMAC4 soap_put_ns1__prune_USCOREobjectResponse(struct soap *soap, const struct ns1__prune_USCOREobjectResponse *a, const char *tag, const char *type) 1327 { 1328 register int id = soap_embed(soap, (void*)a, NULL, 0, tag, SOAP_TYPE_ns1__prune_USCOREobjectResponse); 1329 if (soap_out_ns1__prune_USCOREobjectResponse(soap, tag, id, a, type)) 1330 return soap->error; 1331 return soap_putindependent(soap); 1332 } 1333 1334 SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__prune_USCOREobjectResponse(struct soap *soap, const char *tag, int id, const struct ns1__prune_USCOREobjectResponse *a, const char *type) 1335 { 1336 if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_ns1__prune_USCOREobjectResponse), type)) 1337 return soap->error; 1338 if (soap_out_PointerToint(soap, "result", -1, &a->result, "")) 1339 return soap->error; 1340 return soap_element_end_out(soap, tag); 1341 } 1342 1343 SOAP_FMAC3 struct ns1__prune_USCOREobjectResponse * SOAP_FMAC4 soap_get_ns1__prune_USCOREobjectResponse(struct soap *soap, struct ns1__prune_USCOREobjectResponse *p, const char *tag, const char *type) 1344 { 1345 if ((p = soap_in_ns1__prune_USCOREobjectResponse(soap, tag, p, type))) 1346 if (soap_getindependent(soap)) 1347 return NULL; 1348 return p; 1349 } 1350 1351 SOAP_FMAC3 struct ns1__prune_USCOREobjectResponse * SOAP_FMAC4 soap_in_ns1__prune_USCOREobjectResponse(struct soap *soap, const char *tag, struct ns1__prune_USCOREobjectResponse *a, const char *type) 1352 { 1353 size_t soap_flag_result = 1; 1354 if (soap_element_begin_in(soap, tag, 0, type)) 1355 return NULL; 1356 a = (struct ns1__prune_USCOREobjectResponse *)soap_id_enter(soap, soap->id, a, SOAP_TYPE_ns1__prune_USCOREobjectResponse, sizeof(struct ns1__prune_USCOREobjectResponse), 0, NULL, NULL, NULL); 1357 if (!a) 1358 return NULL; 1359 soap_default_ns1__prune_USCOREobjectResponse(soap, a); 1360 if (soap->body && !*soap->href) 1361 { 1362 for (;;) 1363 { soap->error = SOAP_TAG_MISMATCH; 1364 if (soap_flag_result && soap->error == SOAP_TAG_MISMATCH) 1365 if (soap_in_PointerToint(soap, "result", &a->result, "xsd:int")) 1366 { soap_flag_result--; 1367 continue; 1368 } 1369 if (soap->error == SOAP_TAG_MISMATCH) 1370 soap->error = soap_ignore_element(soap); 1371 if (soap->error == SOAP_NO_TAG) 1372 break; 1373 if (soap->error) 1374 return NULL; 1375 } 1376 if (soap_element_end_in(soap, tag)) 1377 return NULL; 1378 } 1379 else 1380 { a = (struct ns1__prune_USCOREobjectResponse *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_ns1__prune_USCOREobjectResponse, 0, sizeof(struct ns1__prune_USCOREobjectResponse), 0, NULL); 1381 if (soap->body && soap_element_end_in(soap, tag)) 1382 return NULL; 1383 } 1384 return a; 1385 } 1386 1387 SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns1__chmod_USCOREobject(struct soap *soap, struct ns1__chmod_USCOREobject *a) 1388 { 1389 (void)soap; (void)a; /* appease -Wall -Werror */ 1390 soap_default_string(soap, &a->key); 1391 soap_default_int(soap, &a->mode); 1392 } 1393 1394 SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_ns1__chmod_USCOREobject(struct soap *soap, const struct ns1__chmod_USCOREobject *a) 1395 { 1396 (void)soap; (void)a; /* appease -Wall -Werror */ 1397 soap_serialize_string(soap, &a->key); 1398 soap_embedded(soap, &a->mode, SOAP_TYPE_int); 1399 } 1400 1401 SOAP_FMAC3 int SOAP_FMAC4 soap_put_ns1__chmod_USCOREobject(struct soap *soap, const struct ns1__chmod_USCOREobject *a, const char *tag, const char *type) 1402 { 1403 register int id = soap_embed(soap, (void*)a, NULL, 0, tag, SOAP_TYPE_ns1__chmod_USCOREobject); 1404 if (soap_out_ns1__chmod_USCOREobject(soap, tag, id, a, type)) 1405 return soap->error; 1406 return soap_putindependent(soap); 1407 } 1408 1409 SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__chmod_USCOREobject(struct soap *soap, const char *tag, int id, const struct ns1__chmod_USCOREobject *a, const char *type) 1410 { 1411 if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_ns1__chmod_USCOREobject), type)) 1412 return soap->error; 1413 if (soap_out_string(soap, "key", -1, &a->key, "")) 1414 return soap->error; 1415 if (soap_out_int(soap, "mode", -1, &a->mode, "")) 1416 return soap->error; 1417 return soap_element_end_out(soap, tag); 1418 } 1419 1420 SOAP_FMAC3 struct ns1__chmod_USCOREobject * SOAP_FMAC4 soap_get_ns1__chmod_USCOREobject(struct soap *soap, struct ns1__chmod_USCOREobject *p, const char *tag, const char *type) 1421 { 1422 if ((p = soap_in_ns1__chmod_USCOREobject(soap, tag, p, type))) 1423 if (soap_getindependent(soap)) 1424 return NULL; 1425 return p; 1426 } 1427 1428 SOAP_FMAC3 struct ns1__chmod_USCOREobject * SOAP_FMAC4 soap_in_ns1__chmod_USCOREobject(struct soap *soap, const char *tag, struct ns1__chmod_USCOREobject *a, const char *type) 1429 { 1430 size_t soap_flag_key = 1; 1431 size_t soap_flag_mode = 1; 1432 if (soap_element_begin_in(soap, tag, 0, type)) 1433 return NULL; 1434 a = (struct ns1__chmod_USCOREobject *)soap_id_enter(soap, soap->id, a, SOAP_TYPE_ns1__chmod_USCOREobject, sizeof(struct ns1__chmod_USCOREobject), 0, NULL, NULL, NULL); 1435 if (!a) 1436 return NULL; 1437 soap_default_ns1__chmod_USCOREobject(soap, a); 1438 if (soap->body && !*soap->href) 1439 { 1440 for (;;) 1441 { soap->error = SOAP_TAG_MISMATCH; 1442 if (soap_flag_key && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) 1443 if (soap_in_string(soap, "key", &a->key, "xsd:string")) 1444 { soap_flag_key--; 1445 continue; 1446 } 1447 if (soap_flag_mode && soap->error == SOAP_TAG_MISMATCH) 1448 if (soap_in_int(soap, "mode", &a->mode, "xsd:int")) 1449 { soap_flag_mode--; 1450 continue; 1451 } 1452 if (soap->error == SOAP_TAG_MISMATCH) 1453 soap->error = soap_ignore_element(soap); 1454 if (soap->error == SOAP_NO_TAG) 1455 break; 1456 if (soap->error) 1457 return NULL; 1458 } 1459 if (soap_element_end_in(soap, tag)) 1460 return NULL; 1461 } 1462 else 1463 { a = (struct ns1__chmod_USCOREobject *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_ns1__chmod_USCOREobject, 0, sizeof(struct ns1__chmod_USCOREobject), 0, NULL); 1464 if (soap->body && soap_element_end_in(soap, tag)) 1465 return NULL; 1466 } 1467 if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_mode > 0)) 1468 { soap->error = SOAP_OCCURS; 1469 return NULL; 1470 } 1471 return a; 1472 } 1473 1474 SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns1__chmod_USCOREobjectResponse(struct soap *soap, struct ns1__chmod_USCOREobjectResponse *a) 1475 { 1476 (void)soap; (void)a; /* appease -Wall -Werror */ 1477 a->result = NULL; 1478 } 1479 1480 SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_ns1__chmod_USCOREobjectResponse(struct soap *soap, const struct ns1__chmod_USCOREobjectResponse *a) 1481 { 1482 (void)soap; (void)a; /* appease -Wall -Werror */ 1483 soap_serialize_PointerToint(soap, &a->result); 1484 } 1485 1486 SOAP_FMAC3 int SOAP_FMAC4 soap_put_ns1__chmod_USCOREobjectResponse(struct soap *soap, const struct ns1__chmod_USCOREobjectResponse *a, const char *tag, const char *type) 1487 { 1488 register int id = soap_embed(soap, (void*)a, NULL, 0, tag, SOAP_TYPE_ns1__chmod_USCOREobjectResponse); 1489 if (soap_out_ns1__chmod_USCOREobjectResponse(soap, tag, id, a, type)) 1490 return soap->error; 1491 return soap_putindependent(soap); 1492 } 1493 1494 SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__chmod_USCOREobjectResponse(struct soap *soap, const char *tag, int id, const struct ns1__chmod_USCOREobjectResponse *a, const char *type) 1495 { 1496 if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_ns1__chmod_USCOREobjectResponse), type)) 1497 return soap->error; 1498 if (soap_out_PointerToint(soap, "result", -1, &a->result, "")) 1499 return soap->error; 1500 return soap_element_end_out(soap, tag); 1501 } 1502 1503 SOAP_FMAC3 struct ns1__chmod_USCOREobjectResponse * SOAP_FMAC4 soap_get_ns1__chmod_USCOREobjectResponse(struct soap *soap, struct ns1__chmod_USCOREobjectResponse *p, const char *tag, const char *type) 1504 { 1505 if ((p = soap_in_ns1__chmod_USCOREobjectResponse(soap, tag, p, type))) 1506 if (soap_getindependent(soap)) 1507 return NULL; 1508 return p; 1509 } 1510 1511 SOAP_FMAC3 struct ns1__chmod_USCOREobjectResponse * SOAP_FMAC4 soap_in_ns1__chmod_USCOREobjectResponse(struct soap *soap, const char *tag, struct ns1__chmod_USCOREobjectResponse *a, const char *type) 1512 { 1513 size_t soap_flag_result = 1; 1514 if (soap_element_begin_in(soap, tag, 0, type)) 1515 return NULL; 1516 a = (struct ns1__chmod_USCOREobjectResponse *)soap_id_enter(soap, soap->id, a, SOAP_TYPE_ns1__chmod_USCOREobjectResponse, sizeof(struct ns1__chmod_USCOREobjectResponse), 0, NULL, NULL, NULL); 1517 if (!a) 1518 return NULL; 1519 soap_default_ns1__chmod_USCOREobjectResponse(soap, a); 1520 if (soap->body && !*soap->href) 1521 { 1522 for (;;) 1523 { soap->error = SOAP_TAG_MISMATCH; 1524 if (soap_flag_result && soap->error == SOAP_TAG_MISMATCH) 1525 if (soap_in_PointerToint(soap, "result", &a->result, "xsd:int")) 1526 { soap_flag_result--; 1527 continue; 1528 } 1529 if (soap->error == SOAP_TAG_MISMATCH) 1530 soap->error = soap_ignore_element(soap); 1531 if (soap->error == SOAP_NO_TAG) 1532 break; 1533 if (soap->error) 1534 return NULL; 1535 } 1536 if (soap_element_end_in(soap, tag)) 1537 return NULL; 1538 } 1539 else 1540 { a = (struct ns1__chmod_USCOREobjectResponse *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_ns1__chmod_USCOREobjectResponse, 0, sizeof(struct ns1__chmod_USCOREobjectResponse), 0, NULL); 1541 if (soap->body && soap_element_end_in(soap, tag)) 1542 return NULL; 1543 } 1544 return a; 1545 } 1546 1197 1547 SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns1__stat_USCOREobject(struct soap *soap, struct ns1__stat_USCOREobject *a) 1198 1548 { -
branches/pap/Nebulous/nebclient/src/soapClient.c
r23935 r25027 10 10 #endif 11 11 12 SOAP_SOURCE_STAMP("@(#) soapClient.c ver 2.7.12 2009-0 4-20 22:15:21GMT")12 SOAP_SOURCE_STAMP("@(#) soapClient.c ver 2.7.12 2009-07-25 01:30:29 GMT") 13 13 14 14 … … 812 812 } 813 813 814 SOAP_FMAC5 int SOAP_FMAC6 soap_call_ns1__chmod_USCOREobject(struct soap *soap, const char *soap_endpoint, const char *soap_action, char *key, int mode, int *result) 815 { struct ns1__chmod_USCOREobject soap_tmp_ns1__chmod_USCOREobject; 816 struct ns1__chmod_USCOREobjectResponse *soap_tmp_ns1__chmod_USCOREobjectResponse; 817 if (!soap_endpoint) 818 soap_endpoint = "http://localhost:80/nebulous"; 819 if (!soap_action) 820 soap_action = "urn:Nebulous/Server/SOAP#chmod_object"; 821 soap->encodingStyle = "http://schemas.xmlsoap.org/soap/encoding/"; 822 soap_tmp_ns1__chmod_USCOREobject.key = key; 823 soap_tmp_ns1__chmod_USCOREobject.mode = mode; 824 soap_begin(soap); 825 soap_serializeheader(soap); 826 soap_serialize_ns1__chmod_USCOREobject(soap, &soap_tmp_ns1__chmod_USCOREobject); 827 if (soap_begin_count(soap)) 828 return soap->error; 829 if (soap->mode & SOAP_IO_LENGTH) 830 { if (soap_envelope_begin_out(soap) 831 || soap_putheader(soap) 832 || soap_body_begin_out(soap) 833 || soap_put_ns1__chmod_USCOREobject(soap, &soap_tmp_ns1__chmod_USCOREobject, "ns1:chmod_object", "") 834 || soap_body_end_out(soap) 835 || soap_envelope_end_out(soap)) 836 return soap->error; 837 } 838 if (soap_end_count(soap)) 839 return soap->error; 840 if (soap_connect(soap, soap_endpoint, soap_action) 841 || soap_envelope_begin_out(soap) 842 || soap_putheader(soap) 843 || soap_body_begin_out(soap) 844 || soap_put_ns1__chmod_USCOREobject(soap, &soap_tmp_ns1__chmod_USCOREobject, "ns1:chmod_object", "") 845 || soap_body_end_out(soap) 846 || soap_envelope_end_out(soap) 847 || soap_end_send(soap)) 848 return soap_closesock(soap); 849 if (!result) 850 return soap_closesock(soap); 851 soap_default_int(soap, result); 852 if (soap_begin_recv(soap) 853 || soap_envelope_begin_in(soap) 854 || soap_recv_header(soap) 855 || soap_body_begin_in(soap)) 856 return soap_closesock(soap); 857 soap_tmp_ns1__chmod_USCOREobjectResponse = soap_get_ns1__chmod_USCOREobjectResponse(soap, NULL, "ns1:chmod_objectResponse", ""); 858 if (soap->error) 859 { if (soap->error == SOAP_TAG_MISMATCH && soap->level == 2) 860 return soap_recv_fault(soap); 861 return soap_closesock(soap); 862 } 863 if (soap_body_end_in(soap) 864 || soap_envelope_end_in(soap) 865 || soap_end_recv(soap)) 866 return soap_closesock(soap); 867 if (result && soap_tmp_ns1__chmod_USCOREobjectResponse->result) 868 *result = *soap_tmp_ns1__chmod_USCOREobjectResponse->result; 869 return soap_closesock(soap); 870 } 871 872 SOAP_FMAC5 int SOAP_FMAC6 soap_call_ns1__prune_USCOREobject(struct soap *soap, const char *soap_endpoint, const char *soap_action, char *key, int *result) 873 { struct ns1__prune_USCOREobject soap_tmp_ns1__prune_USCOREobject; 874 struct ns1__prune_USCOREobjectResponse *soap_tmp_ns1__prune_USCOREobjectResponse; 875 if (!soap_endpoint) 876 soap_endpoint = "http://localhost:80/nebulous"; 877 if (!soap_action) 878 soap_action = "urn:Nebulous/Server/SOAP#prune_object"; 879 soap->encodingStyle = "http://schemas.xmlsoap.org/soap/encoding/"; 880 soap_tmp_ns1__prune_USCOREobject.key = key; 881 soap_begin(soap); 882 soap_serializeheader(soap); 883 soap_serialize_ns1__prune_USCOREobject(soap, &soap_tmp_ns1__prune_USCOREobject); 884 if (soap_begin_count(soap)) 885 return soap->error; 886 if (soap->mode & SOAP_IO_LENGTH) 887 { if (soap_envelope_begin_out(soap) 888 || soap_putheader(soap) 889 || soap_body_begin_out(soap) 890 || soap_put_ns1__prune_USCOREobject(soap, &soap_tmp_ns1__prune_USCOREobject, "ns1:prune_object", "") 891 || soap_body_end_out(soap) 892 || soap_envelope_end_out(soap)) 893 return soap->error; 894 } 895 if (soap_end_count(soap)) 896 return soap->error; 897 if (soap_connect(soap, soap_endpoint, soap_action) 898 || soap_envelope_begin_out(soap) 899 || soap_putheader(soap) 900 || soap_body_begin_out(soap) 901 || soap_put_ns1__prune_USCOREobject(soap, &soap_tmp_ns1__prune_USCOREobject, "ns1:prune_object", "") 902 || soap_body_end_out(soap) 903 || soap_envelope_end_out(soap) 904 || soap_end_send(soap)) 905 return soap_closesock(soap); 906 if (!result) 907 return soap_closesock(soap); 908 soap_default_int(soap, result); 909 if (soap_begin_recv(soap) 910 || soap_envelope_begin_in(soap) 911 || soap_recv_header(soap) 912 || soap_body_begin_in(soap)) 913 return soap_closesock(soap); 914 soap_tmp_ns1__prune_USCOREobjectResponse = soap_get_ns1__prune_USCOREobjectResponse(soap, NULL, "ns1:prune_objectResponse", ""); 915 if (soap->error) 916 { if (soap->error == SOAP_TAG_MISMATCH && soap->level == 2) 917 return soap_recv_fault(soap); 918 return soap_closesock(soap); 919 } 920 if (soap_body_end_in(soap) 921 || soap_envelope_end_in(soap) 922 || soap_end_recv(soap)) 923 return soap_closesock(soap); 924 if (result && soap_tmp_ns1__prune_USCOREobjectResponse->result) 925 *result = *soap_tmp_ns1__prune_USCOREobjectResponse->result; 926 return soap_closesock(soap); 927 } 928 814 929 #ifdef __cplusplus 815 930 } -
branches/pap/Nebulous/nebclient/src/soapH.h
r23198 r25027 42 42 43 43 #ifndef SOAP_TYPE_SOAP_ENV__Fault 44 #define SOAP_TYPE_SOAP_ENV__Fault ( 64)44 #define SOAP_TYPE_SOAP_ENV__Fault (70) 45 45 #endif 46 46 SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Fault(struct soap*, struct SOAP_ENV__Fault *); … … 56 56 57 57 #ifndef SOAP_TYPE_SOAP_ENV__Reason 58 #define SOAP_TYPE_SOAP_ENV__Reason (6 3)58 #define SOAP_TYPE_SOAP_ENV__Reason (69) 59 59 #endif 60 60 SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Reason(struct soap*, struct SOAP_ENV__Reason *); … … 70 70 71 71 #ifndef SOAP_TYPE_SOAP_ENV__Detail 72 #define SOAP_TYPE_SOAP_ENV__Detail (6 0)72 #define SOAP_TYPE_SOAP_ENV__Detail (66) 73 73 #endif 74 74 SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Detail(struct soap*, struct SOAP_ENV__Detail *); … … 84 84 85 85 #ifndef SOAP_TYPE_SOAP_ENV__Code 86 #define SOAP_TYPE_SOAP_ENV__Code ( 58)86 #define SOAP_TYPE_SOAP_ENV__Code (64) 87 87 #endif 88 88 SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Code(struct soap*, struct SOAP_ENV__Code *); … … 98 98 99 99 #ifndef SOAP_TYPE_SOAP_ENV__Header 100 #define SOAP_TYPE_SOAP_ENV__Header ( 57)100 #define SOAP_TYPE_SOAP_ENV__Header (63) 101 101 #endif 102 102 SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Header(struct soap*, struct SOAP_ENV__Header *); … … 109 109 #endif 110 110 111 #ifndef SOAP_TYPE_ns1__prune_USCOREobject 112 #define SOAP_TYPE_ns1__prune_USCOREobject (62) 113 #endif 114 SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns1__prune_USCOREobject(struct soap*, struct ns1__prune_USCOREobject *); 115 SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_ns1__prune_USCOREobject(struct soap*, const struct ns1__prune_USCOREobject *); 116 SOAP_FMAC3 int SOAP_FMAC4 soap_put_ns1__prune_USCOREobject(struct soap*, const struct ns1__prune_USCOREobject *, const char*, const char*); 117 SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__prune_USCOREobject(struct soap*, const char*, int, const struct ns1__prune_USCOREobject *, const char*); 118 SOAP_FMAC3 struct ns1__prune_USCOREobject * SOAP_FMAC4 soap_get_ns1__prune_USCOREobject(struct soap*, struct ns1__prune_USCOREobject *, const char*, const char*); 119 SOAP_FMAC3 struct ns1__prune_USCOREobject * SOAP_FMAC4 soap_in_ns1__prune_USCOREobject(struct soap*, const char*, struct ns1__prune_USCOREobject *, const char*); 120 121 #ifndef SOAP_TYPE_ns1__prune_USCOREobjectResponse 122 #define SOAP_TYPE_ns1__prune_USCOREobjectResponse (61) 123 #endif 124 SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns1__prune_USCOREobjectResponse(struct soap*, struct ns1__prune_USCOREobjectResponse *); 125 SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_ns1__prune_USCOREobjectResponse(struct soap*, const struct ns1__prune_USCOREobjectResponse *); 126 SOAP_FMAC3 int SOAP_FMAC4 soap_put_ns1__prune_USCOREobjectResponse(struct soap*, const struct ns1__prune_USCOREobjectResponse *, const char*, const char*); 127 SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__prune_USCOREobjectResponse(struct soap*, const char*, int, const struct ns1__prune_USCOREobjectResponse *, const char*); 128 SOAP_FMAC3 struct ns1__prune_USCOREobjectResponse * SOAP_FMAC4 soap_get_ns1__prune_USCOREobjectResponse(struct soap*, struct ns1__prune_USCOREobjectResponse *, const char*, const char*); 129 SOAP_FMAC3 struct ns1__prune_USCOREobjectResponse * SOAP_FMAC4 soap_in_ns1__prune_USCOREobjectResponse(struct soap*, const char*, struct ns1__prune_USCOREobjectResponse *, const char*); 130 131 #ifndef SOAP_TYPE_ns1__chmod_USCOREobject 132 #define SOAP_TYPE_ns1__chmod_USCOREobject (59) 133 #endif 134 SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns1__chmod_USCOREobject(struct soap*, struct ns1__chmod_USCOREobject *); 135 SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_ns1__chmod_USCOREobject(struct soap*, const struct ns1__chmod_USCOREobject *); 136 SOAP_FMAC3 int SOAP_FMAC4 soap_put_ns1__chmod_USCOREobject(struct soap*, const struct ns1__chmod_USCOREobject *, const char*, const char*); 137 SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__chmod_USCOREobject(struct soap*, const char*, int, const struct ns1__chmod_USCOREobject *, const char*); 138 SOAP_FMAC3 struct ns1__chmod_USCOREobject * SOAP_FMAC4 soap_get_ns1__chmod_USCOREobject(struct soap*, struct ns1__chmod_USCOREobject *, const char*, const char*); 139 SOAP_FMAC3 struct ns1__chmod_USCOREobject * SOAP_FMAC4 soap_in_ns1__chmod_USCOREobject(struct soap*, const char*, struct ns1__chmod_USCOREobject *, const char*); 140 141 #ifndef SOAP_TYPE_ns1__chmod_USCOREobjectResponse 142 #define SOAP_TYPE_ns1__chmod_USCOREobjectResponse (58) 143 #endif 144 SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns1__chmod_USCOREobjectResponse(struct soap*, struct ns1__chmod_USCOREobjectResponse *); 145 SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_ns1__chmod_USCOREobjectResponse(struct soap*, const struct ns1__chmod_USCOREobjectResponse *); 146 SOAP_FMAC3 int SOAP_FMAC4 soap_put_ns1__chmod_USCOREobjectResponse(struct soap*, const struct ns1__chmod_USCOREobjectResponse *, const char*, const char*); 147 SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__chmod_USCOREobjectResponse(struct soap*, const char*, int, const struct ns1__chmod_USCOREobjectResponse *, const char*); 148 SOAP_FMAC3 struct ns1__chmod_USCOREobjectResponse * SOAP_FMAC4 soap_get_ns1__chmod_USCOREobjectResponse(struct soap*, struct ns1__chmod_USCOREobjectResponse *, const char*, const char*); 149 SOAP_FMAC3 struct ns1__chmod_USCOREobjectResponse * SOAP_FMAC4 soap_in_ns1__chmod_USCOREobjectResponse(struct soap*, const char*, struct ns1__chmod_USCOREobjectResponse *, const char*); 150 111 151 #ifndef SOAP_TYPE_ns1__stat_USCOREobject 112 152 #define SOAP_TYPE_ns1__stat_USCOREobject (56) … … 402 442 403 443 #ifndef SOAP_TYPE_PointerToSOAP_ENV__Reason 404 #define SOAP_TYPE_PointerToSOAP_ENV__Reason ( 66)444 #define SOAP_TYPE_PointerToSOAP_ENV__Reason (72) 405 445 #endif 406 446 SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Reason(struct soap*, struct SOAP_ENV__Reason *const*); … … 415 455 416 456 #ifndef SOAP_TYPE_PointerToSOAP_ENV__Detail 417 #define SOAP_TYPE_PointerToSOAP_ENV__Detail ( 65)457 #define SOAP_TYPE_PointerToSOAP_ENV__Detail (71) 418 458 #endif 419 459 SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Detail(struct soap*, struct SOAP_ENV__Detail *const*); … … 428 468 429 469 #ifndef SOAP_TYPE_PointerToSOAP_ENV__Code 430 #define SOAP_TYPE_PointerToSOAP_ENV__Code ( 59)470 #define SOAP_TYPE_PointerToSOAP_ENV__Code (65) 431 471 #endif 432 472 SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Code(struct soap*, struct SOAP_ENV__Code *const*); -
branches/pap/Nebulous/nebclient/src/soapServer.c
r23935 r25027 10 10 #endif 11 11 12 SOAP_SOURCE_STAMP("@(#) soapServer.c ver 2.7.12 2009-0 4-20 22:15:21GMT")12 SOAP_SOURCE_STAMP("@(#) soapServer.c ver 2.7.12 2009-07-25 01:30:29 GMT") 13 13 14 14 … … 105 105 if (!soap_match_tag(soap, soap->tag, "ns1:stat_object")) 106 106 return soap_serve_ns1__stat_USCOREobject(soap); 107 if (!soap_match_tag(soap, soap->tag, "ns1:chmod_object")) 108 return soap_serve_ns1__chmod_USCOREobject(soap); 109 if (!soap_match_tag(soap, soap->tag, "ns1:prune_object")) 110 return soap_serve_ns1__prune_USCOREobject(soap); 107 111 return soap->error = SOAP_NO_METHOD; 108 112 } … … 713 717 } 714 718 719 SOAP_FMAC5 int SOAP_FMAC6 soap_serve_ns1__chmod_USCOREobject(struct soap *soap) 720 { struct ns1__chmod_USCOREobject soap_tmp_ns1__chmod_USCOREobject; 721 struct ns1__chmod_USCOREobjectResponse soap_tmp_ns1__chmod_USCOREobjectResponse; 722 int soap_tmp_int; 723 soap_default_ns1__chmod_USCOREobjectResponse(soap, &soap_tmp_ns1__chmod_USCOREobjectResponse); 724 soap_default_int(soap, &soap_tmp_int); 725 soap_tmp_ns1__chmod_USCOREobjectResponse.result = &soap_tmp_int; 726 soap_default_ns1__chmod_USCOREobject(soap, &soap_tmp_ns1__chmod_USCOREobject); 727 soap->encodingStyle = "http://schemas.xmlsoap.org/soap/encoding/"; 728 if (!soap_get_ns1__chmod_USCOREobject(soap, &soap_tmp_ns1__chmod_USCOREobject, "ns1:chmod_object", NULL)) 729 return soap->error; 730 if (soap_body_end_in(soap) 731 || soap_envelope_end_in(soap) 732 || soap_end_recv(soap)) 733 return soap->error; 734 soap->error = ns1__chmod_USCOREobject(soap, soap_tmp_ns1__chmod_USCOREobject.key, soap_tmp_ns1__chmod_USCOREobject.mode, &soap_tmp_int); 735 if (soap->error) 736 return soap->error; 737 soap_serializeheader(soap); 738 soap_serialize_ns1__chmod_USCOREobjectResponse(soap, &soap_tmp_ns1__chmod_USCOREobjectResponse); 739 if (soap_begin_count(soap)) 740 return soap->error; 741 if (soap->mode & SOAP_IO_LENGTH) 742 { if (soap_envelope_begin_out(soap) 743 || soap_putheader(soap) 744 || soap_body_begin_out(soap) 745 || soap_put_ns1__chmod_USCOREobjectResponse(soap, &soap_tmp_ns1__chmod_USCOREobjectResponse, "ns1:chmod_objectResponse", "") 746 || soap_body_end_out(soap) 747 || soap_envelope_end_out(soap)) 748 return soap->error; 749 }; 750 if (soap_end_count(soap) 751 || soap_response(soap, SOAP_OK) 752 || soap_envelope_begin_out(soap) 753 || soap_putheader(soap) 754 || soap_body_begin_out(soap) 755 || soap_put_ns1__chmod_USCOREobjectResponse(soap, &soap_tmp_ns1__chmod_USCOREobjectResponse, "ns1:chmod_objectResponse", "") 756 || soap_body_end_out(soap) 757 || soap_envelope_end_out(soap) 758 || soap_end_send(soap)) 759 return soap->error; 760 return soap_closesock(soap); 761 } 762 763 SOAP_FMAC5 int SOAP_FMAC6 soap_serve_ns1__prune_USCOREobject(struct soap *soap) 764 { struct ns1__prune_USCOREobject soap_tmp_ns1__prune_USCOREobject; 765 struct ns1__prune_USCOREobjectResponse soap_tmp_ns1__prune_USCOREobjectResponse; 766 int soap_tmp_int; 767 soap_default_ns1__prune_USCOREobjectResponse(soap, &soap_tmp_ns1__prune_USCOREobjectResponse); 768 soap_default_int(soap, &soap_tmp_int); 769 soap_tmp_ns1__prune_USCOREobjectResponse.result = &soap_tmp_int; 770 soap_default_ns1__prune_USCOREobject(soap, &soap_tmp_ns1__prune_USCOREobject); 771 soap->encodingStyle = "http://schemas.xmlsoap.org/soap/encoding/"; 772 if (!soap_get_ns1__prune_USCOREobject(soap, &soap_tmp_ns1__prune_USCOREobject, "ns1:prune_object", NULL)) 773 return soap->error; 774 if (soap_body_end_in(soap) 775 || soap_envelope_end_in(soap) 776 || soap_end_recv(soap)) 777 return soap->error; 778 soap->error = ns1__prune_USCOREobject(soap, soap_tmp_ns1__prune_USCOREobject.key, &soap_tmp_int); 779 if (soap->error) 780 return soap->error; 781 soap_serializeheader(soap); 782 soap_serialize_ns1__prune_USCOREobjectResponse(soap, &soap_tmp_ns1__prune_USCOREobjectResponse); 783 if (soap_begin_count(soap)) 784 return soap->error; 785 if (soap->mode & SOAP_IO_LENGTH) 786 { if (soap_envelope_begin_out(soap) 787 || soap_putheader(soap) 788 || soap_body_begin_out(soap) 789 || soap_put_ns1__prune_USCOREobjectResponse(soap, &soap_tmp_ns1__prune_USCOREobjectResponse, "ns1:prune_objectResponse", "") 790 || soap_body_end_out(soap) 791 || soap_envelope_end_out(soap)) 792 return soap->error; 793 }; 794 if (soap_end_count(soap) 795 || soap_response(soap, SOAP_OK) 796 || soap_envelope_begin_out(soap) 797 || soap_putheader(soap) 798 || soap_body_begin_out(soap) 799 || soap_put_ns1__prune_USCOREobjectResponse(soap, &soap_tmp_ns1__prune_USCOREobjectResponse, "ns1:prune_objectResponse", "") 800 || soap_body_end_out(soap) 801 || soap_envelope_end_out(soap) 802 || soap_end_send(soap)) 803 return soap->error; 804 return soap_closesock(soap); 805 } 806 715 807 #ifdef __cplusplus 716 808 } -
branches/pap/Nebulous/nebclient/src/soapStub.h
r23935 r25027 306 306 #endif 307 307 308 #ifndef SOAP_TYPE_ns1__chmod_USCOREobjectResponse 309 #define SOAP_TYPE_ns1__chmod_USCOREobjectResponse (58) 310 /* ns1:chmod_objectResponse */ 311 struct ns1__chmod_USCOREobjectResponse 312 { 313 int *result; /* SOAP 1.2 RPC return element (when namespace qualified) */ /* optional element of type xsd:int */ 314 }; 315 #endif 316 317 #ifndef SOAP_TYPE_ns1__chmod_USCOREobject 318 #define SOAP_TYPE_ns1__chmod_USCOREobject (59) 319 /* ns1:chmod_object */ 320 struct ns1__chmod_USCOREobject 321 { 322 char *key; /* optional element of type xsd:string */ 323 int mode; /* required element of type xsd:int */ 324 }; 325 #endif 326 327 #ifndef SOAP_TYPE_ns1__prune_USCOREobjectResponse 328 #define SOAP_TYPE_ns1__prune_USCOREobjectResponse (61) 329 /* ns1:prune_objectResponse */ 330 struct ns1__prune_USCOREobjectResponse 331 { 332 int *result; /* SOAP 1.2 RPC return element (when namespace qualified) */ /* optional element of type xsd:int */ 333 }; 334 #endif 335 336 #ifndef SOAP_TYPE_ns1__prune_USCOREobject 337 #define SOAP_TYPE_ns1__prune_USCOREobject (62) 338 /* ns1:prune_object */ 339 struct ns1__prune_USCOREobject 340 { 341 char *key; /* optional element of type xsd:string */ 342 }; 343 #endif 344 308 345 #ifndef SOAP_TYPE_SOAP_ENV__Header 309 #define SOAP_TYPE_SOAP_ENV__Header ( 57)346 #define SOAP_TYPE_SOAP_ENV__Header (63) 310 347 /* SOAP Header: */ 311 348 struct SOAP_ENV__Header … … 318 355 319 356 #ifndef SOAP_TYPE_SOAP_ENV__Code 320 #define SOAP_TYPE_SOAP_ENV__Code ( 58)357 #define SOAP_TYPE_SOAP_ENV__Code (64) 321 358 /* SOAP Fault Code: */ 322 359 struct SOAP_ENV__Code … … 328 365 329 366 #ifndef SOAP_TYPE_SOAP_ENV__Detail 330 #define SOAP_TYPE_SOAP_ENV__Detail (6 0)367 #define SOAP_TYPE_SOAP_ENV__Detail (66) 331 368 /* SOAP-ENV:Detail */ 332 369 struct SOAP_ENV__Detail … … 339 376 340 377 #ifndef SOAP_TYPE_SOAP_ENV__Reason 341 #define SOAP_TYPE_SOAP_ENV__Reason (6 3)378 #define SOAP_TYPE_SOAP_ENV__Reason (69) 342 379 /* SOAP-ENV:Reason */ 343 380 struct SOAP_ENV__Reason … … 348 385 349 386 #ifndef SOAP_TYPE_SOAP_ENV__Fault 350 #define SOAP_TYPE_SOAP_ENV__Fault ( 64)387 #define SOAP_TYPE_SOAP_ENV__Fault (70) 351 388 /* SOAP Fault: */ 352 389 struct SOAP_ENV__Fault … … 437 474 SOAP_FMAC5 int SOAP_FMAC6 ns1__stat_USCOREobject(struct soap*, char *key, struct ns1__stat_USCOREobjectResponse *_param_4); 438 475 476 SOAP_FMAC5 int SOAP_FMAC6 ns1__chmod_USCOREobject(struct soap*, char *key, int mode, int *result); 477 478 SOAP_FMAC5 int SOAP_FMAC6 ns1__prune_USCOREobject(struct soap*, char *key, int *result); 479 439 480 /******************************************************************************\ 440 481 * * … … 472 513 SOAP_FMAC5 int SOAP_FMAC6 soap_call_ns1__stat_USCOREobject(struct soap *soap, const char *soap_endpoint, const char *soap_action, char *key, struct ns1__stat_USCOREobjectResponse *_param_4); 473 514 515 SOAP_FMAC5 int SOAP_FMAC6 soap_call_ns1__chmod_USCOREobject(struct soap *soap, const char *soap_endpoint, const char *soap_action, char *key, int mode, int *result); 516 517 SOAP_FMAC5 int SOAP_FMAC6 soap_call_ns1__prune_USCOREobject(struct soap *soap, const char *soap_endpoint, const char *soap_action, char *key, int *result); 518 474 519 /******************************************************************************\ 475 520 * * … … 509 554 510 555 SOAP_FMAC5 int SOAP_FMAC6 soap_serve_ns1__stat_USCOREobject(struct soap*); 556 557 SOAP_FMAC5 int SOAP_FMAC6 soap_serve_ns1__chmod_USCOREobject(struct soap*); 558 559 SOAP_FMAC5 int SOAP_FMAC6 soap_serve_ns1__prune_USCOREobject(struct soap*); 511 560 512 561 #ifdef __cplusplus -
branches/pap/Nebulous/nebclient/tests/tap
- Property svn:mergeinfo deleted
-
branches/pap/Nebulous/nebclient/tests/tests.c
r21461 r25027 20 20 char *key = "foobarbaz"; 21 21 22 plan_tests( 28);22 plan_tests(31); 23 23 24 24 if (getenv("NEB_SERVER")) { … … 98 98 99 99 char *copies = nebGetXattr(server, key, "user.copies"); 100 neb_ok(server, strcmp(copies, "2") == 0, "get user.copies xattr");100 neb_ok(server, copies != NULL && strcmp(copies, "2") == 0, "get user.copies xattr"); 101 101 char **xattrs = NULL; 102 102 int n_xattrs = nebListXattr(server, key, &xattrs); 103 printf("# %s\n\n", xattrs[0]); 104 neb_ok(server, n_xattrs == 1, "count of xattrs"); 105 neb_ok(server, strcmp(xattrs[0], "user.copies") == 0, "user.copies xattr exists"); 103 neb_ok(server, xattrs != NULL && n_xattrs == 1, "count of xattrs"); 104 neb_ok(server, xattrs != NULL && strcmp(xattrs[0], "user.copies") == 0, "user.copies xattr exists"); 106 105 neb_ok(server, nebRemoveXattr(server, key, "user.copies"), "remove user.copies xattr"); 107 106 … … 136 135 neb_ok(server, nebMove(server, "copyiedfile", "movedfile"), "move object"); 137 136 137 neb_ok(server, nebChmod(server, "movedfile", 0440) == 0, "chmod object"); 138 139 // no dead instances to remove 140 neb_ok(server, nebPrune(server, "movedfile") == 0, "prune object"); 141 142 nebReplicate(server, key, NULL, NULL); 143 neb_ok(server, nebThereCanBeOnlyOne(server, "movedfile", NULL) == 0, "reduce instances to only 1"); 144 138 145 if (!nebDelete(server, "movedfile")) { 139 146 diag( "cleanup failed %s\n", nebErr(server)); -
branches/pap/Nebulous/t
- Property svn:mergeinfo deleted
-
branches/pap/Nebulous/t/59_client_delete.t
r18858 r25027 10 10 use Apache::Test qw( -withtestmore ); 11 11 12 plan tests => 9;12 plan tests => 13; 13 13 14 14 use lib qw( ./t ./lib ); … … 26 26 proxy => "http://$hostport/nebulous", 27 27 ); 28 $neb->create( "foo" );28 my $uri = $neb->create( "foo" ); 29 29 30 30 ok( $neb->delete( "foo" ), "delete object" ); 31 32 ok( ! -e _get_file_path($uri), "deleted file" ); 31 33 32 34 my $locations = $neb->find_instances( "foo" ); … … 76 78 } 77 79 80 # force flag 81 Test::Nebulous->setup; 82 83 { 84 my $neb = Nebulous::Client->new( 85 proxy => "http://$hostport/nebulous", 86 ); 87 $neb->create( "foo" ); 88 89 is( $neb->delete("foo", undef), 1, "force flag false" ); 90 } 91 92 Test::Nebulous->setup; 93 94 { 95 my $neb = Nebulous::Client->new( 96 proxy => "http://$hostport/nebulous", 97 ); 98 $neb->create( "foo" ); 99 100 is( $neb->delete("foo", 1), 1, "force flag false" ); 101 } 102 78 103 Test::Nebulous->setup; 79 104 … … 84 109 $neb->delete(); 85 110 }; 86 like( $@, qr/1 wasexpected/, "no params" );111 like( $@, qr/1 - 2 were expected/, "no params" ); 87 112 88 113 Test::Nebulous->setup; … … 92 117 proxy => "http://$hostport/nebulous", 93 118 ); 94 $neb->delete( "foo", 2);119 $neb->delete( "foo", 3); 95 120 }; 96 like( $@, qr/1 was expected/, "too many params" ); 121 like( $@, qr/is boolean/, "force flag not boolean" ); 122 123 Test::Nebulous->setup; 124 125 eval { 126 my $neb = Nebulous::Client->new( 127 proxy => "http://$hostport/nebulous", 128 ); 129 $neb->delete( "foo", 0, 2 ); 130 }; 131 like( $@, qr/1 - 2 were expected/, "too many params" ); 97 132 98 133 Test::Nebulous->cleanup; -
branches/pap/Nebulous/t/62_client_delete_instance.t
r23934 r25027 10 10 use Apache::Test qw( -withtestmore ); 11 11 12 plan tests => 1 1;12 plan tests => 10; 13 13 14 14 use lib qw( ./t ./lib ); … … 35 35 36 36 is( $uri, @$locations[0], "delete instance" ); 37 38 ok( ! -e _get_file_path( @$locations[0] ), "deleted file" );39 37 } 40 38 -
branches/pap/Nebulous/t/63_client_stat.t
r13203 r25027 10 10 use Apache::Test qw( -withtestmore ); 11 11 12 plan tests => 1 2;12 plan tests => 13; 13 13 14 14 use lib qw( ./t ./lib ); … … 30 30 my $info = $neb->stat( "foo" ); 31 31 32 is( scalar @$info, 7, "number of columns" );32 is( scalar @$info, 8, "number of columns" ); 33 33 } 34 34 … … 43 43 my $info = $neb->stat( "foo" ); 44 44 45 is( scalar @$info, 7, "number of columns" );45 is( scalar @$info, 8, "number of columns" ); 46 46 is( @$info[0], 1, "so_id" ); 47 47 is( @$info[1], "foo", "ext_id" ); … … 50 50 like( @$info[4], qr/....-..-.. ..:..:../, "epoch" ); 51 51 like( @$info[5], qr/....-..-.. ..:..:../, "mtime" ); 52 is( @$info[6], 1, "instances" ); 52 is( @$info[6], 1, "available instances" ); 53 is( @$info[7], 1, "total instances" ); 53 54 } 54 55 -
branches/pap/Nebulous/t/66_client_xattr.t
r17750 r25027 1 1 #!/usr/bin/perl 2 2 3 # Copryight (C) 2007-2008 Joshua Hoblitt 4 # 5 # $Id: 66_client_xattr.t,v 1.1 2008-05-20 00:54:30 jhoblitt Exp $ 3 # Copryight (C) 2007-2009 Joshua Hoblitt 6 4 7 5 use strict; … … 9 7 10 8 use Apache::Test qw( -withtestmore ); 11 plan tests => 32; 12 9 plan tests => 44; 13 10 14 11 use lib qw( ./t ./lib ); … … 20 17 my $hostport = Apache::Test->config->{ 'hostport' }; 21 18 19 my $neb = Nebulous::Client->new( 20 proxy => "http://$hostport/nebulous", 21 ); 22 22 23 # 1 key / xattr 23 24 … … 25 26 26 27 { 27 my $neb = Nebulous::Client->new(28 proxy => "http://$hostport/nebulous",29 );30 31 28 my $uri = $neb->create('foo'); 32 29 33 ok($neb->setxattr('foo', ' bar', 'baz', 'create'), 'set object xattr');30 ok($neb->setxattr('foo', 'user.bar', 'baz', 'create'), 'set object xattr'); 34 31 { 35 32 my $xattrs = $neb->listxattr('foo'); 36 33 is(scalar @$xattrs, 1, 'number of xattrs'); 37 is(@$xattrs[0], ' bar', 'xattr name');38 } 39 40 my $value = $neb->getxattr('foo', ' bar');34 is(@$xattrs[0], 'user.bar', 'xattr name'); 35 } 36 37 my $value = $neb->getxattr('foo', 'user.bar'); 41 38 is($value, 'baz', 'xattr value'); 42 39 43 ok($neb->removexattr('foo', ' bar'), "remove object xattr");40 ok($neb->removexattr('foo', 'user.bar'), "remove object xattr"); 44 41 { 45 42 my $xattrs = $neb->listxattr('foo'); … … 53 50 54 51 { 55 my $neb = Nebulous::Client->new(56 proxy => "http://$hostport/nebulous",57 );58 59 52 my $uri = $neb->create('foo'); 60 53 61 ok($neb->setxattr('foo', ' bar', 'baz', 'create'), 'set object xattr');62 ok($neb->setxattr('foo', ' bonk', 'quix', 'create'), 'set object xattr');54 ok($neb->setxattr('foo', 'user.bar', 'baz', 'create'), 'set object xattr'); 55 ok($neb->setxattr('foo', 'user.bonk', 'quix', 'create'), 'set object xattr'); 63 56 64 57 { 65 58 my $xattrs = $neb->listxattr('foo'); 66 59 is(scalar @$xattrs, 2, 'number of xattrs'); 67 is(@$xattrs[0], ' bar', 'xattr name');68 is(@$xattrs[1], ' bonk', 'xattr name');69 } 70 71 my $value = $neb->getxattr('foo', ' bar');60 is(@$xattrs[0], 'user.bar', 'xattr name'); 61 is(@$xattrs[1], 'user.bonk', 'xattr name'); 62 } 63 64 my $value = $neb->getxattr('foo', 'user.bar'); 72 65 is($value, 'baz', 'xattr value'); 73 $value = $neb->getxattr('foo', ' bonk');66 $value = $neb->getxattr('foo', 'user.bonk'); 74 67 is($value, 'quix', 'xattr value'); 75 68 76 ok($neb->removexattr('foo', ' bar'), "remove object xattr");77 ok($neb->removexattr('foo', ' bonk'), "remove object xattr");69 ok($neb->removexattr('foo', 'user.bar'), "remove object xattr"); 70 ok($neb->removexattr('foo', 'user.bonk'), "remove object xattr"); 78 71 { 79 72 my $xattrs = $neb->listxattr('foo'); … … 87 80 88 81 { 89 my $neb = Nebulous::Client->new(90 proxy => "http://$hostport/nebulous",91 );92 93 82 my $uri = $neb->create('foo'); 94 83 95 ok($neb->setxattr('foo', ' bar', 'baz', 'create'), 'set object xattr');96 ok($neb->setxattr('foo', ' bar', 'quix', 'replace'), 're-set object xattr');84 ok($neb->setxattr('foo', 'user.bar', 'baz', 'create'), 'set object xattr'); 85 ok($neb->setxattr('foo', 'user.bar', 'quix', 'replace'), 're-set object xattr'); 97 86 98 87 { 99 88 my $xattrs = $neb->listxattr('foo'); 100 89 is(scalar @$xattrs, 1, 'number of xattrs'); 101 is(@$xattrs[0], ' bar', 'xattr name');102 } 103 104 my $value = $neb->getxattr('foo', ' bar');90 is(@$xattrs[0], 'user.bar', 'xattr name'); 91 } 92 93 my $value = $neb->getxattr('foo', 'user.bar'); 105 94 is($value, 'quix', 'xattr value'); 106 95 107 ok($neb->removexattr('foo', ' bar'), "remove object xattr");96 ok($neb->removexattr('foo', 'user.bar'), "remove object xattr"); 108 97 { 109 98 my $xattrs = $neb->listxattr('foo'); … … 117 106 118 107 eval { 119 my $neb = Nebulous::Client->new( 120 proxy => "http://$hostport/nebulous", 121 ); 122 108 $neb->setxattr('foo', 'user.bar', 'baz', 'create'); 109 }; 110 like($@, qr/is valid object key/, "create xattr on non-existant key"); 111 112 Test::Nebulous->setup; 113 114 eval { 115 $neb->create('foo'); 116 117 $neb->setxattr('foo', 'luser.bar', 'baz', 'create'); 118 }; 119 like($@, qr/xattr is in user. namespace/, "user. namspace"); 120 121 Test::Nebulous->setup; 122 123 eval { 124 $neb->setxattr('foo', 'user.bar', 'baz', 'replace'); 125 }; 126 like($@, qr/is valid object key/, "replace xattr on non-existant key"); 127 128 Test::Nebulous->setup; 129 130 eval { 123 131 $neb->setxattr(); 124 132 }; … … 128 136 129 137 eval { 130 my $neb = Nebulous::Client->new( 131 proxy => "http://$hostport/nebulous", 132 ); 133 134 $neb->create('foo'); 135 136 $neb->setxattr('foo', 'bar'); 138 $neb->create('foo'); 139 140 $neb->setxattr('foo', 'user.bar'); 137 141 }; 138 142 like($@, qr/4 were expected/, "too few params"); … … 141 145 142 146 eval { 143 my $neb = Nebulous::Client->new( 144 proxy => "http://$hostport/nebulous", 145 ); 146 147 $neb->create('foo'); 148 149 $neb->setxattr('foo', 'bar', 'baz'); 147 $neb->create('foo'); 148 149 $neb->setxattr('foo', 'user.bar', 'baz'); 150 150 }; 151 151 like($@, qr/4 were expected/, "too few params"); … … 154 154 155 155 eval { 156 my $neb = Nebulous::Client->new( 157 proxy => "http://$hostport/nebulous", 158 ); 159 160 $neb->create('foo'); 161 162 $neb->setxattr('foo', 'bar', 'baz', 'create', 'quix'); 156 $neb->create('foo'); 157 158 $neb->setxattr('foo', 'user.bar', 'baz', 'create', 'quix'); 163 159 }; 164 160 like($@, qr/4 were expected/, "too many params"); 165 161 162 # getxattr 163 164 Test::Nebulous->setup; 165 166 eval { 167 $neb->getxattr('foo', 'bar'); 168 }; 169 like($@, qr/is valid object key/, "get xattr from non-existant nebulous key"); 170 171 Test::Nebulous->setup; 172 173 eval { 174 $neb->create('foo'); 175 176 $neb->getxattr('foo', 'luser.bar'); 177 }; 178 like($@, qr/xattr is in user. namespace/, "user. namespace"); 179 180 Test::Nebulous->setup; 181 182 eval { 183 $neb->create('foo'); 184 $neb->getxattr('foo', 'user.bar'); 185 }; 186 like($@, qr|xattr neb:///foo:user.bar does not exist|, 187 "get xattr from non-existant xattr key"); 188 189 Test::Nebulous->setup; 190 191 eval { 192 $neb->getxattr(); 193 }; 194 like($@, qr/2 were expected/, "no params"); 195 196 Test::Nebulous->setup; 197 198 eval { 199 $neb->create('foo'); 200 201 $neb->getxattr('foo'); 202 }; 203 like($@, qr/2 were expected/, "too few params"); 204 205 Test::Nebulous->setup; 206 207 eval { 208 $neb->create('foo'); 209 210 $neb->getxattr('foo', 'user.bar', 'baz'); 211 }; 212 like($@, qr/2 were expected/, "too many params"); 213 166 214 # listxattr 167 215 … … 169 217 170 218 eval { 171 my $neb = Nebulous::Client->new(172 proxy => "http://$hostport/nebulous",173 );174 175 219 $neb->create('foo'); 176 220 … … 182 226 183 227 eval { 184 my $neb = Nebulous::Client->new(185 proxy => "http://$hostport/nebulous",186 );187 188 228 $neb->create('foo'); 189 229 … … 192 232 like($@, qr/1 was expected/, "too many params"); 193 233 194 # getxattr 195 196 Test::Nebulous->setup; 197 198 eval { 199 my $neb = Nebulous::Client->new( 200 proxy => "http://$hostport/nebulous", 201 ); 202 203 $neb->getxattr(); 234 # removexattr 235 236 Test::Nebulous->setup; 237 238 eval { 239 $neb->removexattr('foo', 'user.bar'); 240 }; 241 like($@, qr/is valid object key/, "remove xattr from non-existant nebulous key"); 242 243 Test::Nebulous->setup; 244 245 eval { 246 $neb->create('foo'); 247 248 $neb->getxattr('foo', 'luser.bar'); 249 }; 250 like($@, qr/xattr is in user. namespace/, "user. namespace"); 251 252 Test::Nebulous->setup; 253 254 eval { 255 $neb->create('foo'); 256 $neb->removexattr('foo', 'user.bar'); 257 }; 258 like($@, qr|xattr neb:///foo:user.bar does not exist|, 259 "remove xattr from non-existant xattr key"); 260 261 Test::Nebulous->setup; 262 263 eval { 264 $neb->removexattr(); 204 265 }; 205 266 like($@, qr/2 were expected/, "no params"); … … 208 269 209 270 eval { 210 my $neb = Nebulous::Client->new( 211 proxy => "http://$hostport/nebulous", 212 ); 213 214 $neb->create('foo'); 215 216 $neb->getxattr('foo'); 271 $neb->create('foo'); 272 273 $neb->removexattr('foo'); 217 274 }; 218 275 like($@, qr/2 were expected/, "too few params"); … … 221 278 222 279 eval { 223 my $neb = Nebulous::Client->new( 224 proxy => "http://$hostport/nebulous", 225 ); 226 227 $neb->create('foo'); 228 229 $neb->getxattr('foo', 'bar', 'baz'); 280 $neb->create('foo'); 281 282 $neb->removexattr('foo', 'user.bar', 'baz'); 230 283 }; 231 284 like($@, qr/2 were expected/, "too many params"); -
branches/pap/Nebulous/t/70_neb-ls.t
r23934 r25027 38 38 39 39 # NEB_SERVER env var not set 40 undef $ENV{'NEB_SERVER'} if defined $ENV{'NEB_SERVER'}; 40 41 Test::Nebulous->setup; 41 42 … … 82 83 83 84 is($? >> 8, 0, "exit code"); 84 like($test->stdout, qr/^ foo bar$/, "stdout");85 like($test->stdout, qr/^bar\nfoo$/, "stdout"); 85 86 like($test->stderr, qr/^$/, "stderr"); 86 87 } … … 98 99 99 100 is($? >> 8, 0, "exit code"); 100 like($test->stdout, qr/^ foo\nbar\n$/, "stdout");101 like($test->stdout, qr/^bar\nfoo\n$/, "stdout"); 101 102 like($test->stderr, qr/^$/, "stderr"); 102 103 } … … 114 115 115 116 is($? >> 8, 0, "exit code"); 116 like($test->stdout, qr/^ foo\nbar\n$/, "stdout");117 like($test->stdout, qr/^bar\nfoo\n$/, "stdout"); 117 118 like($test->stderr, qr/^$/, "stderr"); 118 119 } … … 160 161 161 162 is($? >> 8, 0, "exit code"); 162 like($test->stdout, qr|^a/ foo a/bar$|, "stdout");163 like($test->stdout, qr|^a/bar\na/foo$|, "stdout"); 163 164 like($test->stderr, qr/^$/, "stderr"); 164 165 } … … 192 193 193 194 is($? >> 8, 0, "exit code"); 194 like($test->stdout, qr|^a/ foo$|, "stdout");195 like($test->stdout, qr|^a/b/\na/foo$|, "stdout"); 195 196 like($test->stderr, qr/^$/, "stderr"); 196 197 } -
branches/pap/Nebulous/t/conf/startup.pl.in
r23934 r25027 18 18 my $config = Nebulous::Server::Config->new( 19 19 trace => 'all', 20 memcached_servers => ['127.0.0.1:11211'], 20 21 ); 21 22 $config->add_db(
Note:
See TracChangeset
for help on using the changeset viewer.
