IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 7, 2009, 4:08:25 PM (17 years ago)
Author:
Paul Price
Message:

Merging trunk (r25026) to get up-to-date on old branch.

Location:
branches/pap
Files:
2 deleted
35 edited
6 copied

Legend:

Unmodified
Added
Removed
  • branches/pap

  • branches/pap/Nebulous

    • Property svn:mergeinfo deleted
  • branches/pap/Nebulous/Changes

    r23934 r25027  
    11Revision history for Nebulous
     2
     30.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
    211
    3120.10
     
    918    - add neb-swap
    1019    - add nebclient:nebSetXattr()
     20    - add neb-rm --move flag
    1121
    12220.09 Wed Jul  9 16:36:27 HST 2008
  • branches/pap/Nebulous/MANIFEST

    r23934 r25027  
    7979t/00_distribution.t
    8080t/01_load.t
    81 t/50_client_new.t
    82 t/51_client_create.t
     81t/49_client_new.t
     82t/50_client_create.t
    8383t/51_client_open_create.t
    8484t/52_client_replicate.t
     
    9898t/66_client_xattr.t
    9999t/67_client_swap.t
     100t/68_client_chmod.t
     101t/69_client_prune.t
    100102t/70_neb-ls.t
     103t/71_client_there_can_be_only_one.t
     104t/72_neb-cull.t
    101105t/90_nebclient.t
    102106t/TEST.PL
  • branches/pap/Nebulous/bin

  • branches/pap/Nebulous/bin/neb-cull

    r16183 r25027  
    1616use Pod::Usage qw( pod2usage );
    1717
    18 my ($server, $volume);
     18my ($server, $volume, $one_only);
    1919
    2020$server = $ENV{'NEB_SERVER'} unless $server;
     
    2323    'server|s=s'    => \$server,
    2424    'volume|v=s'    => \$volume,
     25    'one_only|o'    => \$one_only,
    2526) || pod2usage( 2 );
    2627
     
    4041    unless defined $neb;
    4142
     43my @cull_args;   
     44push @cull_args, $key;
    4245if (defined $volume) {
    43     $neb->cull($key, $volume)
    44         or die "failed to replicate Nebulous key: $key";
     46    push @cull_args, $volume;
     47}
     48
     49if ($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    }
    4559} 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    }
    4863}
    4964
     
    5873=head1 SYNOPSIS
    5974
    60     neb-cull [--server <URL>] [--volume <volume name>] <key>
     75    neb-cull [--server <URL>] [--volume <volume name>] [--one_only] <key>
    6176
    6277=head1 DESCRIPTION
     
    7792
    7893Symbolic name of the volume to create the new instance on.
     94
     95Optional.
     96
     97=item * --one_only|-o
     98
     99Removes all but one instances of an object.  Any inaccessible instances are
     100removed.  If C<--volume> is specified, and an instance exists on that volume,
     101all instances but the one on that volume are removed.
    79102
    80103Optional.
     
    110133=head1 COPYRIGHT
    111134
    112 Copyright (C) 2007-2008  Joshua Hoblitt.  All rights reserved.
     135Copyright (C) 2007-2009  Joshua Hoblitt.  All rights reserved.
    113136
    114137This program is free software; you can redistribute it and/or modify it under
  • branches/pap/Nebulous/bin/neb-locate

    r16179 r25027  
    4141    unless defined $neb;
    4242
     43$volume = 'any' if defined $all;
     44
    4345my $uris;
    4446if (defined $volume) {
     
    7072}
    7173
    72 print join(" ", @files), "\n";
     74print join("\n", @files), "\n";
    7375
    7476__END__
  • branches/pap/Nebulous/bin/neb-ls

    r23934 r25027  
    2121
    2222$server = $ENV{'NEB_SERVER'} unless $server;
     23
     24# make --long the default
     25$long = 1;
    2326
    2427GetOptions(
  • branches/pap/Nebulous/bin/neb-replicate

    r23696 r25027  
    1616use Pod::Usage qw( pod2usage );
    1717
    18 my ($server, $volume, $copies);
     18my ($server, $volume, $copies, $set_copies);
    1919$copies = 1;  # default to making just one copy
    2020
  • branches/pap/Nebulous/bin/neb-rm

    r13074 r25027  
    1616use Pod::Usage qw( pod2usage );
    1717
    18 my ($server);
     18my (
     19    $force,
     20    $move,
     21    $server,
     22);
    1923
    2024$server = $ENV{'NEB_SERVER'} unless $server;
    2125
    2226GetOptions(
     27    'force|f'       => \$force,
     28    'move|m'        => \$move,
    2329    'server|s=s'    => \$server,
    2430) || pod2usage( 2 );
     
    3541
    3642foreach 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    }
    3848}
    3949
     
    4858=head1 SYNOPSIS
    4959
    50     neb-rm [--server <URL>] <key...>
     60    neb-rm [--server <URL>] [--force] [--move] <key...>
    5161
    5262=head1 DESCRIPTION
     
    5868
    5969=over 4
     70
     71=item * --force|-f
     72
     73When set, C<<key>> will be removed from the nebulous database even if the on
     74disk file(s) are missing.
     75
     76Optional.
     77
     78=item * --move|-m
     79
     80When set, this flag causes C<<key>> to be renamed to C<<key>.rm> instead of
     81being deleted.
     82
     83Optional.
    6084
    6185=item * --server|-s <URL>
  • branches/pap/Nebulous/bin/neb-stat

    r18016 r25027  
    4141my $stat = $neb->stat($key);
    4242die "nebulous key: $key not found" unless $stat;   
    43 my $instances = $neb->find_instances($key, ':any');
     43my $instances = $neb->find_instances($key, 'any');
    4444die "no instances found" unless $instances;   
    4545
    4646no warnings qw(uninitialized);
    4747print
    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",
    5556    "instance location:\n", " " x 4,
    5657    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  
    99no warnings qw( uninitialized );
    1010
    11 our $VERSION = '0.09';
     11our $VERSION = '0.17';
    1212
    1313use Digest::MD5;
     
    1616use Nebulous::Client::Log;
    1717use Nebulous::Util qw( :standard );
    18 use Params::Validate qw( validate validate_pos SCALAR UNDEF );
     18use Params::Validate qw( validate validate_pos SCALAR UNDEF BOOLEAN );
    1919#use SOAP::Lite +trace => [qw( debug )];
    2020use SOAP::Lite;
     
    297297        my $instances = $stats[6];
    298298        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");
    300300            $log->debug("leaving");
    301301
     
    305305        $locations = $self->find_instances($key, $vol_name);
    306306        unless (defined $locations) {
    307             $log->debug( "no instances" );
     307            $self->set_err( "no instances" );
    308308            $log->debug( "leaving" );
    309309
     
    313313        $locations = $self->find_instances($key);
    314314        unless ($locations) {
    315             $log->debug("no instances");
     315            $self->set_err( "no instances" );
    316316            $log->debug("leaving");
    317317
     
    320320
    321321        if (scalar @{ $locations } < 2) {
    322             $log->debug("can not cull - not enough instances");
     322            $self->set_err("can not cull - not enough instances");
    323323            $log->debug("leaving");
    324324
     
    329329    my $uri = $self->delete_instance($key, @$locations[0]);
    330330
     331    eval {
     332        _nuke_file(_get_file_path(@$locations[0]));
     333    };
     334    if ($@) {
     335        $log->logdie($@);
     336    }
     337
    331338    $log->debug("leaving");
    332339
    333340    return $uri;
     341}
     342
     343
     344sub 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;
    334412}
    335413
     
    803881    my $self = shift;
    804882
    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            },
    808896        },
    809897    );
     
    817905    # a lock is implicitly removed when the last storage object is deleted
    818906    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
    819922        $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        }
    820935    }
    821936
     
    9591074    $log->debug( "entered - @_" );
    9601075
    961     # it is being assumed here that it is better to have files on disk and not in
    962     # the database then the inverse.
    963 
    964     my $path;
    965     eval {
    966         $path = _get_file_path( $uri );
    967     };
    968     $log->logdie( $@ ) if $@;
    969 
    9701076    my $response = $self->{ 'server' }->delete_instance($key, $uri);
    9711077    if ( $response->fault ) {
     
    9821088    $log->debug( "server deleted instance" );
    9831089
    984     eval {
    985         _nuke_file( $path );
    986     };
    987     $log->logdie( $@ ) if $@;
    988 
    9891090    $log->debug( "leaving" );
    9901091
     
    10451146
    10461147    return $stats;
     1148}
     1149
     1150
     1151sub 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
     1190sub 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;
    10471220}
    10481221
  • branches/pap/Nebulous/lib/Nebulous/Client.pod

    r20094 r25027  
    1313    );
    1414
    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' );
    2121    $neb->setxattr( $key, $name, $value, $flags );
    2222    $neb->getxattr( $key, $name );
     
    2424    $neb->removexattr( $key, $name );
    2525    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 );
    3333    $neb->delete_instance( $uri );
    34     my $stats = $neb->stat( "key" );
     34    my $stats = $neb->stat( $key );
    3535    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 );
    3639
    3740=head1 DESCRIPTION
     
    404407
    405408Returns an arrayref of scalars.
     409
     410=item * prune($key)
     411
     412Removes all of the inaccessible instances from an object.
     413
     414=over 4
     415
     416=item * key
     417
     418The storage object key (name).
     419
     420=back
     421
     422The number of instances removed.
     423
     424=item * there_can_be_only_one($key, $vol)
     425
     426Removes all but one instance of an object and automatically removes any
     427inaccessible instances.
     428
     429=over 4
     430
     431=item * key
     432
     433The storage object key (name).
     434
     435=item * vol
     436
     437If specified, the only remaining instance will be left on this volume (if an
     438instance already exists there).
     439
     440=back
     441
     442The number of avaiable instances removed.
    406443
    407444=item * mounts()
     
    425462    ]
    426463
     464=item * chmod( $key, $mode );
     465
     466Accepts 2 parameters, both mandatory.  C<$key> is the nebulous key to operate
     467on and C<$mode> are the POSIX like file permissions to set on all instances of
     468C<$key>.  C<$mode> must be specified in oct.  Returns C<$mode> or sucess or an
     469exception on failure.
     470
    427471=back
    428472
     
    456500=head1 COPYRIGHT
    457501
    458 Copyright (C) 2004-2008  Joshua Hoblitt.  All rights reserved.
     502Copyright (C) 2004-2009  Joshua Hoblitt.  All rights reserved.
    459503
    460504This 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  
    55AC_PREREQ(2.61)
    66
    7 AC_INIT([nebclient], [0.08], [jhoblitt@cpan.org])
     7AC_INIT([nebclient], [0.17], [jhoblitt@cpan.org])
    88AC_CONFIG_SRCDIR([nebulous.wsdl])
    99
  • branches/pap/Nebulous/nebclient/nebulous.wsdl

    r23935 r25027  
    140140    </message>
    141141
     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
    142159
    143160    <portType name="Nebulous/Server/SOAPPort">
     
    240257            -->
    241258        </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>
    242273    </portType>
    243274
     
    390421        <operation name="stat_object">
    391422            <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" />
    392445            <input>
    393446                <soap:body use="encoded" namespace="urn:Nebulous/Server/SOAP"
  • branches/pap/Nebulous/nebclient/src/nebclient.c

    r23935 r25027  
    5151static char *nullstrncpy(char *dest, const char *src, size_t n);
    5252
     53
    5354nebServer *nebServerAlloc(const char *endpoint)
    5455{
    55     nebServer       *server;
    56 
    57     server          = xmalloc(sizeof(nebServer));
     56    nebServer *server = xmalloc(sizeof(nebServer));
    5857
    5958    if (endpoint) {
     
    7776}
    7877
     78
    7979void nebServerFree(nebServer *server)
    8080{
     
    9292}
    9393
     94
    9495char *nebCreate(nebServer *server, const char *key, const char *volume, char **URI)
    9596{
     97    REQUIRE_SERVER;
     98
     99    if (!key) {
     100        nebSetErr(server, "parameter 'key' may not be NULL");
     101
     102        return NULL;
     103    }
     104
    96105    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 
    107106    if (soap_call_ns1__create_USCOREobject(server->soap, server->endpoint, NULL,
    108107            (char *)key, (char *)volume, (char **)&response) != SOAP_OK) {
     
    117116    }
    118117
     118    char *filename;
    119119    if (!nebParseURI(server, (char *)response.result, &filename)) {
    120120        nebSetErr(server, "can not parse URI");
     121        nebFree(filename);
     122
    121123        return NULL;
    122124    }
     
    131133}
    132134
     135
    133136int nebOpenCreate(nebServer *server, const char *key, const char *volume, char **URI)
    134137{
    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);
    149152    if (file == -1) {
    150153        nebSetErr(server, "can not open %s: %s", filename, strerror(errno));
     
    159162}
    160163
     164
    161165bool nebReplicate(nebServer *server, const char *key, const char *volume, char **URI)
    162166{
    163     struct ns1__replicate_USCOREobjectResponse response;
    164     char            *filename;
    165     int             sourceFH, destFH;
    166 
    167167    REQUIRE_SERVER;
    168168
     
    177177    // we don't do this, it's possible that open will find & open the new
    178178    // 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);
    180180    if (sourceFH == -1) {
    181181        nebSetErr(server, "can not open key %s", key);
    182         nebFree(filename);
    183182
    184183        return false;
     
    186185
    187186    // ask the server for a new instance attached to our key
     187    struct ns1__replicate_USCOREobjectResponse response;
    188188    if (soap_call_ns1__replicate_USCOREobject(server->soap, server->endpoint,
    189189            NULL, (char *)key, (char *)volume, (char **)&response) != SOAP_OK) {
     
    193193    }
    194194
     195    char *filename = NULL;
    195196    if (!nebParseURI(server, (char *)response.result, &filename)) {
    196197        nebSetErr(server, "can not parse URI");
     
    199200    }
    200201
    201     destFH = open(filename, O_RDWR|O_TRUNC, 0660);
     202    int destFH = open(filename, O_RDWR|O_TRUNC, 0660);
    202203    if (destFH == -1) {
    203204        nebSetErr(server, "can not open %s: %s\n", filename, strerror(errno));
     
    234235}
    235236
     237
    236238bool nebCull(nebServer *server, const char *key)
    237239{
    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);
    249249    if (!locations || locations->n <= 1) {
    250250        nebSetErr(server, "can not cull - not enough instances");
     251        if (locations) {
     252            nebObjectInstancesFree(locations);
     253        }
    251254
    252255        return false;
     
    264267}
    265268
     269
    266270bool nebLock(nebServer *server, const char *key, nebRW flag)
    267271{
    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;
    283283
    284284    while (time(NULL) < endtime) {
     285        int response;
    285286        if (soap_call_ns1__lock_USCOREobject(server->soap, server->endpoint,
    286287            NULL, (char *)key, type, &response) != SOAP_OK) {
     
    302303}
    303304
     305
    304306bool nebUnlock(nebServer *server, const char *key, nebRW flag)
    305307{
    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;
    319319    if (soap_call_ns1__unlock_USCOREobject(server->soap, server->endpoint,
    320320        NULL, (char *)key, type, &response) != SOAP_OK) {
     
    466466nebObjectInstances *nebFindInstances(nebServer *server, const char *key, const char *volume)
    467467{
     468    REQUIRE_SERVER;
     469
     470    if (!key) {
     471        nebSetErr(server, "parameter 'key' may not be NULL");
     472
     473        return NULL;
     474    }
     475
    468476    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 
    481477    // FIXME is this leaking memory when response goes out of scope?  the gsoap
    482478    // manual seems to 'suggest' that this is temporary data that gets cleaed
     
    488484    }
    489485
    490     resultElements = response.result->__size;
    491 
     486    int resultElements = response.result->__size;
     487
     488    nebObjectInstances *locations = NULL;
    492489    if (resultElements) {
    493490        locations = xmalloc(sizeof(nebObjectInstances));
    494491        locations->n = resultElements;
    495492       
    496         resultArray    = response.result->__ptr;
     493        char **resultArray = response.result->__ptr;
    497494
    498495        locations->URI = xmalloc(sizeof(char*) * resultElements);
     
    508505}
    509506
     507
    510508void nebObjectInstancesFree(nebObjectInstances *locations)
    511509{
     
    521519}
    522520
     521
    523522char *nebFind(nebServer *server, const char *key)
    524523{
    525     nebObjectInstances *locations;
    526     char            *filename;
    527 
    528524    REQUIRE_SERVER;
    529525
     
    534530    }
    535531   
    536     locations = nebFindInstances(server, key, NULL);
     532    nebObjectInstances *locations = nebFindInstances(server, key, NULL);
    537533    if (!locations) {
    538534        if (!strstr(nebErr(server), "no instances on storage volume")) {
     
    548544    }
    549545
     546    char *filename;
    550547    if (!nebParseURI(server, locations->URI[0], &filename)) {
    551548        nebSetErr(server, "can not parse URI");
     
    560557}
    561558
     559
    562560int nebOpen(nebServer *server, const char *key, nebRW flag)
    563561{
    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);
    577571    if (!locations) {
    578572        nebSetErr(server, "no instances found");
     
    581575    }
    582576
     577    char *filename;
    583578    if (!nebParseURI(server, locations->URI[0], &filename)) {
    584579        nebSetErr(server, "can not parse URI");
     
    588583    }
    589584
     585    int fh = 0;
    590586    if (flag == NEB_WRITE) {
    591587        if (locations->n > 1) {
     
    613609}
    614610
     611
    615612bool nebDelete(nebServer *server, const char *key)
    616613{
    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");
    628623    if (!locations) {
    629624        nebSetErr(server, "no instances found");
     
    646641}
    647642
     643
    648644bool nebCopy(nebServer *server, const char *key, const char *newKey)
    649645{
    650     int             sourceFH;
    651     int             destFH;
    652 
    653646    REQUIRE_SERVER;
    654647
     
    665658    }
    666659
    667     sourceFH = nebOpen(server, (char *)key, NEB_READ);
     660    int sourceFH = nebOpen(server, (char *)key, NEB_READ);
    668661    if (sourceFH < 0) {
    669662        // propigate nebOpen() error
     
    672665    }
    673666
    674     destFH = nebOpenCreate(server, newKey, NULL, NULL);
     667    int destFH = nebOpenCreate(server, newKey, NULL, NULL);
    675668    if (destFH < 0) {
    676669        // propigate nebCreate() error
     
    696689}
    697690
     691
    698692bool nebMove(nebServer *server, const char *key, const char *newKey)
    699693{
     
    723717}
    724718
     719
    725720bool nebSwap(nebServer *server, const char *key1, const char *key2)
    726721{
    727     struct ns1__create_USCOREobjectResponse response;
    728 
    729722    REQUIRE_SERVER;
    730723
     
    741734    }
    742735
     736    struct ns1__create_USCOREobjectResponse response;
    743737    if (soap_call_ns1__swap_USCOREobjects(server->soap, server->endpoint,
    744738            NULL, (char *)key1, (char *)key2, (char **)&response) != SOAP_OK) {
     
    749743}
    750744
     745
    751746bool nebDeleteInstance(nebServer *server, const char *key, const char *URI)
    752747{
    753     int             response;
    754     char            *filename;
    755     bool            status;
    756 
    757748    REQUIRE_SERVER;
    758749
     
    763754    }
    764755
     756    char *filename;
    765757    if (!nebParseURI(server, URI, &filename)) {
    766758        nebSetErr(server, "can not parse URI");
     
    769761    }
    770762
     763    int response;
    771764    if (soap_call_ns1__delete_USCOREinstance(server->soap, server->endpoint,
    772765        NULL, (char *)key, (char *)URI, &response) != SOAP_OK) {
     
    776769    }
    777770
     771    bool status;
    778772    if (response > 0) {
    779773        status = nebNukeFile(server, filename);
     
    787781}
    788782
     783
    789784nebObjectStat *nebStat(nebServer *server, const char *key)
    790785{
    791     struct ns1__stat_USCOREobjectResponse response;
    792     nebObjectStat   *stat;
    793     int             resultElements = 0;
    794     char            **resultArray = NULL;
    795 
    796786    REQUIRE_SERVER;
    797787
     
    802792    }
    803793
    804     stat = xmalloc(sizeof(nebObjectStat));
     794    nebObjectStat *stat = xmalloc(sizeof(nebObjectStat));
    805795
    806796    // FIXME is this leaking memory when response goes out of scope?  the gsoap
    807797    // manual seems to 'suggest' that this is temporary data that gets cleaed
    808798    // up on the next soap function call
     799    struct ns1__stat_USCOREobjectResponse response;
    809800    if (soap_call_ns1__stat_USCOREobject(server->soap, server->endpoint,
    810801            NULL, (char *)key, &response) != SOAP_OK) {
     
    813804    }
    814805
    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) {
    819810        nebSetErr(server, "server didn't return the proper number of stat elements");
    820811        return NULL;
    821812    }
    822813
    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]);
    826817    nullstrncpy(stat->write_lock, resultArray[3], 256);
    827818    nullstrncpy(stat->epoch, resultArray[4], 256);
    828819    nullstrncpy(stat->mtime, resultArray[5], 256);
    829     stat->instances = atoi(resultArray[6]);
     820    stat->available = atoi(resultArray[6]);
     821    stat->instances = atoi(resultArray[7]);
    830822
    831823    return stat;
    832824}
    833825
     826
     827void nebObjectStatFree(nebObjectStat *stat)
     828{
     829    if (!stat) {
     830        return;
     831    }
     832
     833    nebFree(stat);
     834}
     835
     836
     837int 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
     861int 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
     885int 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
    834949char *nebErr(nebServer *server)
    835950{
     
    837952}
    838953
     954
    839955void nebFree(void *ptr) {
     956    if (!ptr) { return; }
    840957    xfree(ptr);
    841958}
     
    844961static void p_nebSetErr(const char * filename, unsigned long lineno, const char *function, nebServer *server, const char *format, ...)
    845962{
    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() - ",
    852965            filename, lineno, function);
    853966
     
    862975
    863976    while (1) {
     977        va_list args;
    864978        va_start(args, format);
    865979        // append error string after error location info
    866         err_size = vsnprintf(
     980        size_t err_size = vsnprintf(
    867981                server->err_buf + err_location_size,
    868982                server->err_buf_size - err_location_size,
     
    8881002}
    8891003
     1004
    8901005static void nebSetServerErr(nebServer *server)
    8911006{
    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);
    8991011
    9001012    nebSetErr(server, "%s - %s", *code, *string);
    9011013}
     1014
    9021015
    9031016#if NEBCOPYFILE
    9041017static off_t nebCopyFile(nebServer *server, const char *source, const char *dest)
    9051018{
    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);
    9131022    if (sourceFH == -1) {
    9141023        nebSetErr(server, "can not open %s: %s", source, strerror(errno));
     
    9171026    }
    9181027
    919     destFH = open(dest, O_WRONLY|O_CREAT|O_CREAT, 0600);
     1028    int destFH = open(dest, O_WRONLY|O_CREAT|O_CREAT, 0600);
    9201029    if (destFH == -1) {
    9211030        nebSetErr(server, "can not open %s: %s", dest, strerror(errno));
     
    9241033    }
    9251034
    926     bytesCopied = nebCopyFilehandle(server, sourceFH, destFH);
     1035    off_t bytesCopied = nebCopyFilehandle(server, sourceFH, destFH);
    9271036    if (bytesCopied < 0) {
    9281037        return -1;
     
    9451054#endif
    9461055
     1056
    9471057static off_t nebCopyFilehandle(nebServer *server, int sourceFH, int destFH)
    9481058{
    949     off_t           bytesTotal;
    950     off_t           bytesRemaining;
    951     off_t           writeSize;
    952     char            writeBuf[64 * 1024];
     1059    REQUIRE_SERVER;
     1060
    9531061    struct stat     sourceStat;
    954 
    955     REQUIRE_SERVER;
    956 
    9571062    if(fstat(sourceFH, &sourceStat)) {
    9581063        nebSetErr(server, "can not stat filehandles: %s", strerror(errno));
     
    9621067
    9631068    // the size of the file to copied
    964     bytesTotal = sourceStat.st_size;
     1069    off_t bytesTotal = sourceStat.st_size;
    9651070
    9661071    /*
     
    9701075    */
    9711076
    972     bytesRemaining = bytesTotal;
     1077    off_t bytesRemaining = bytesTotal;
    9731078
    9741079    while (bytesRemaining) {
     1080        off_t writeSize;
     1081        char writeBuf[64 * 1024];
    9751082        if (bytesRemaining <= sizeof(writeBuf)) {
    9761083            writeSize = bytesRemaining;
     
    9971104}
    9981105
     1106
    9991107static size_t nebParseURI(nebServer *server, const char *URI, char **filename)
    10001108{
    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 
    10101109    REQUIRE_SERVER;
    10111110
     
    10221121    }
    10231122
    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);
    10251129    if (status != 0) {
    10261130        regerror(status, &myregex, errbuf, ERRBUF_SIZE);
     
    10401144    regfree(&myregex);
    10411145
    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;
    10451149
    10461150    if (matchStart == -1) {
     
    10481152    }
    10491153
    1050     filename_size = matchLength + 1;
     1154    size_t filename_size = matchLength + 1;
    10511155    *filename = xmalloc(filename_size);
    10521156
     
    10551159    return strlen(*filename);
    10561160}
     1161
    10571162
    10581163static bool nebNukeFile(nebServer *server, const char *filename)
     
    10741179    return true;
    10751180}
     1181
    10761182
    10771183static char *nullstrncpy(char *dest, const char *src, size_t n) {
     
    10811187    }
    10821188
     1189    if (!dest) {
     1190        dest = xmalloc(n + 1);
     1191    }
     1192
    10831193    return strncpy(dest, src, n);
    10841194}
  • branches/pap/Nebulous/nebclient/src/nebclient.h

    r23935 r25027  
    1111#ifndef NEBCLIENT_H
    1212#define NEBCLIENT_H 1
     13
     14// #include <sys/stat.h>
    1315
    1416#ifdef __cplusplus
     
    3638
    3739typedef struct {
    38     char            so_id[256];         ///< storage object ID
    39     char            ext_id[256];        ///< storage object key (name)
    40     char            read_lock[256];     ///< read lock value
     40    long            so_id;              ///< storage object ID
     41    long            ext_id;             ///< storage object key (name)
     42    int             read_lock;          ///< read lock value
    4143    char            write_lock[256];    ///< write lock value
    4244    char            epoch[256];         ///< creation time stamp
    4345    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
    4548} nebObjectStat;
    4649
     
    293296nebObjectStat *nebStat(
    294297    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 */
     304void 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
     316int 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
     327int 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
     337int nebThereCanBeOnlyOne(
     338    nebServer *server,                  ///< nebServer object
     339    const char *key,                    ///< storage object key (name)
     340    const char *volume                  ///< leave remain instance on this volume
    296341);
    297342
  • branches/pap/Nebulous/nebclient/src/nebulous.h

    r23935 r25027  
    11/* src/nebulous.h
    22   Generated by wsdl2h 1.2.12 from nebulous.wsdl and typemap.dat
    3    2009-04-20 22:15:21 GMT
     3   2009-07-25 01:30:29 GMT
    44   Copyright (C) 2001-2008 Robert van Engelen, Genivia Inc. All Rights Reserved.
    55   This part of the software is released under one of the following licenses:
     
    119119  - @ref ns1__delete_USCOREinstance
    120120  - @ref ns1__stat_USCOREobject
     121  - @ref ns1__chmod_USCOREobject
     122  - @ref ns1__prune_USCOREobject
    121123
    122124@section SOAP_ports Endpoints of Binding  "SOAP"
     
    893895);
    894896
     897/******************************************************************************\
     898 *                                                                            *
     899 * ns1__chmod_USCOREobject                                                    *
     900 *                                                                            *
     901\******************************************************************************/
     902
     903
     904/// Operation "ns1__chmod_USCOREobject" of service binding "SOAP"
     905
     906/**
     907
     908Operation details:
     909
     910  - SOAP RPC encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
     911  - SOAP action="urn:Nebulous/Server/SOAP#chmod_object"
     912
     913C 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
     927C 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
     944int 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
     961Operation details:
     962
     963  - SOAP RPC encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
     964  - SOAP action="urn:Nebulous/Server/SOAP#prune_object"
     965
     966C 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
     979C 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
     995int ns1__prune_USCOREobject(
     996    char*                               key,    ///< Request parameter
     997    int                                *result  ///< Response parameter
     998);
     999
    8951000/* End of src/nebulous.h */
  • branches/pap/Nebulous/nebclient/src/soapC.c

    r23935 r25027  
    1212#endif
    1313
    14 SOAP_SOURCE_STAMP("@(#) soapC.c ver 2.7.12 2009-04-20 22:15:22 GMT")
     14SOAP_SOURCE_STAMP("@(#) soapC.c ver 2.7.12 2009-07-25 01:30:29 GMT")
    1515
    1616
     
    161161        case SOAP_TYPE_int:
    162162                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");
    163171        case SOAP_TYPE_ns1__stat_USCOREobject:
    164172                return soap_in_ns1__stat_USCOREobject(soap, NULL, NULL, "ns1:stat_object");
     
    250258                        return soap_in_int(soap, NULL, NULL, NULL);
    251259                }
     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                }
    252276                if (!soap_match_tag(soap, t, "ns1:stat_object"))
    253277                {       *type = SOAP_TYPE_ns1__stat_USCOREobject;
     
    440464        case SOAP_TYPE_int:
    441465                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");
    442474        case SOAP_TYPE_ns1__stat_USCOREobject:
    443475                return soap_out_ns1__stat_USCOREobject(soap, tag, id, (const struct ns1__stat_USCOREobject *)ptr, "ns1:stat_object");
     
    527559        switch (type)
    528560        {
     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;
    529573        case SOAP_TYPE_ns1__stat_USCOREobject:
    530574                soap_serialize_ns1__stat_USCOREobject(soap, (const struct ns1__stat_USCOREobject *)ptr);
     
    11951239#endif
    11961240
     1241SOAP_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
     1247SOAP_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
     1253SOAP_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
     1261SOAP_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
     1270SOAP_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
     1278SOAP_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
     1314SOAP_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
     1320SOAP_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
     1326SOAP_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
     1334SOAP_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
     1343SOAP_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
     1351SOAP_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
     1387SOAP_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
     1394SOAP_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
     1401SOAP_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
     1409SOAP_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
     1420SOAP_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
     1428SOAP_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
     1474SOAP_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
     1480SOAP_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
     1486SOAP_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
     1494SOAP_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
     1503SOAP_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
     1511SOAP_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
    11971547SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns1__stat_USCOREobject(struct soap *soap, struct ns1__stat_USCOREobject *a)
    11981548{
  • branches/pap/Nebulous/nebclient/src/soapClient.c

    r23935 r25027  
    1010#endif
    1111
    12 SOAP_SOURCE_STAMP("@(#) soapClient.c ver 2.7.12 2009-04-20 22:15:21 GMT")
     12SOAP_SOURCE_STAMP("@(#) soapClient.c ver 2.7.12 2009-07-25 01:30:29 GMT")
    1313
    1414
     
    812812}
    813813
     814SOAP_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
     872SOAP_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
    814929#ifdef __cplusplus
    815930}
  • branches/pap/Nebulous/nebclient/src/soapH.h

    r23198 r25027  
    4242
    4343#ifndef SOAP_TYPE_SOAP_ENV__Fault
    44 #define SOAP_TYPE_SOAP_ENV__Fault (64)
     44#define SOAP_TYPE_SOAP_ENV__Fault (70)
    4545#endif
    4646SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Fault(struct soap*, struct SOAP_ENV__Fault *);
     
    5656
    5757#ifndef SOAP_TYPE_SOAP_ENV__Reason
    58 #define SOAP_TYPE_SOAP_ENV__Reason (63)
     58#define SOAP_TYPE_SOAP_ENV__Reason (69)
    5959#endif
    6060SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Reason(struct soap*, struct SOAP_ENV__Reason *);
     
    7070
    7171#ifndef SOAP_TYPE_SOAP_ENV__Detail
    72 #define SOAP_TYPE_SOAP_ENV__Detail (60)
     72#define SOAP_TYPE_SOAP_ENV__Detail (66)
    7373#endif
    7474SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Detail(struct soap*, struct SOAP_ENV__Detail *);
     
    8484
    8585#ifndef SOAP_TYPE_SOAP_ENV__Code
    86 #define SOAP_TYPE_SOAP_ENV__Code (58)
     86#define SOAP_TYPE_SOAP_ENV__Code (64)
    8787#endif
    8888SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Code(struct soap*, struct SOAP_ENV__Code *);
     
    9898
    9999#ifndef SOAP_TYPE_SOAP_ENV__Header
    100 #define SOAP_TYPE_SOAP_ENV__Header (57)
     100#define SOAP_TYPE_SOAP_ENV__Header (63)
    101101#endif
    102102SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Header(struct soap*, struct SOAP_ENV__Header *);
     
    109109#endif
    110110
     111#ifndef SOAP_TYPE_ns1__prune_USCOREobject
     112#define SOAP_TYPE_ns1__prune_USCOREobject (62)
     113#endif
     114SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns1__prune_USCOREobject(struct soap*, struct ns1__prune_USCOREobject *);
     115SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_ns1__prune_USCOREobject(struct soap*, const struct ns1__prune_USCOREobject *);
     116SOAP_FMAC3 int SOAP_FMAC4 soap_put_ns1__prune_USCOREobject(struct soap*, const struct ns1__prune_USCOREobject *, const char*, const char*);
     117SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__prune_USCOREobject(struct soap*, const char*, int, const struct ns1__prune_USCOREobject *, const char*);
     118SOAP_FMAC3 struct ns1__prune_USCOREobject * SOAP_FMAC4 soap_get_ns1__prune_USCOREobject(struct soap*, struct ns1__prune_USCOREobject *, const char*, const char*);
     119SOAP_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
     124SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns1__prune_USCOREobjectResponse(struct soap*, struct ns1__prune_USCOREobjectResponse *);
     125SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_ns1__prune_USCOREobjectResponse(struct soap*, const struct ns1__prune_USCOREobjectResponse *);
     126SOAP_FMAC3 int SOAP_FMAC4 soap_put_ns1__prune_USCOREobjectResponse(struct soap*, const struct ns1__prune_USCOREobjectResponse *, const char*, const char*);
     127SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__prune_USCOREobjectResponse(struct soap*, const char*, int, const struct ns1__prune_USCOREobjectResponse *, const char*);
     128SOAP_FMAC3 struct ns1__prune_USCOREobjectResponse * SOAP_FMAC4 soap_get_ns1__prune_USCOREobjectResponse(struct soap*, struct ns1__prune_USCOREobjectResponse *, const char*, const char*);
     129SOAP_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
     134SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns1__chmod_USCOREobject(struct soap*, struct ns1__chmod_USCOREobject *);
     135SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_ns1__chmod_USCOREobject(struct soap*, const struct ns1__chmod_USCOREobject *);
     136SOAP_FMAC3 int SOAP_FMAC4 soap_put_ns1__chmod_USCOREobject(struct soap*, const struct ns1__chmod_USCOREobject *, const char*, const char*);
     137SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__chmod_USCOREobject(struct soap*, const char*, int, const struct ns1__chmod_USCOREobject *, const char*);
     138SOAP_FMAC3 struct ns1__chmod_USCOREobject * SOAP_FMAC4 soap_get_ns1__chmod_USCOREobject(struct soap*, struct ns1__chmod_USCOREobject *, const char*, const char*);
     139SOAP_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
     144SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns1__chmod_USCOREobjectResponse(struct soap*, struct ns1__chmod_USCOREobjectResponse *);
     145SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_ns1__chmod_USCOREobjectResponse(struct soap*, const struct ns1__chmod_USCOREobjectResponse *);
     146SOAP_FMAC3 int SOAP_FMAC4 soap_put_ns1__chmod_USCOREobjectResponse(struct soap*, const struct ns1__chmod_USCOREobjectResponse *, const char*, const char*);
     147SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__chmod_USCOREobjectResponse(struct soap*, const char*, int, const struct ns1__chmod_USCOREobjectResponse *, const char*);
     148SOAP_FMAC3 struct ns1__chmod_USCOREobjectResponse * SOAP_FMAC4 soap_get_ns1__chmod_USCOREobjectResponse(struct soap*, struct ns1__chmod_USCOREobjectResponse *, const char*, const char*);
     149SOAP_FMAC3 struct ns1__chmod_USCOREobjectResponse * SOAP_FMAC4 soap_in_ns1__chmod_USCOREobjectResponse(struct soap*, const char*, struct ns1__chmod_USCOREobjectResponse *, const char*);
     150
    111151#ifndef SOAP_TYPE_ns1__stat_USCOREobject
    112152#define SOAP_TYPE_ns1__stat_USCOREobject (56)
     
    402442
    403443#ifndef SOAP_TYPE_PointerToSOAP_ENV__Reason
    404 #define SOAP_TYPE_PointerToSOAP_ENV__Reason (66)
     444#define SOAP_TYPE_PointerToSOAP_ENV__Reason (72)
    405445#endif
    406446SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Reason(struct soap*, struct SOAP_ENV__Reason *const*);
     
    415455
    416456#ifndef SOAP_TYPE_PointerToSOAP_ENV__Detail
    417 #define SOAP_TYPE_PointerToSOAP_ENV__Detail (65)
     457#define SOAP_TYPE_PointerToSOAP_ENV__Detail (71)
    418458#endif
    419459SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Detail(struct soap*, struct SOAP_ENV__Detail *const*);
     
    428468
    429469#ifndef SOAP_TYPE_PointerToSOAP_ENV__Code
    430 #define SOAP_TYPE_PointerToSOAP_ENV__Code (59)
     470#define SOAP_TYPE_PointerToSOAP_ENV__Code (65)
    431471#endif
    432472SOAP_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  
    1010#endif
    1111
    12 SOAP_SOURCE_STAMP("@(#) soapServer.c ver 2.7.12 2009-04-20 22:15:21 GMT")
     12SOAP_SOURCE_STAMP("@(#) soapServer.c ver 2.7.12 2009-07-25 01:30:29 GMT")
    1313
    1414
     
    105105        if (!soap_match_tag(soap, soap->tag, "ns1:stat_object"))
    106106                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);
    107111        return soap->error = SOAP_NO_METHOD;
    108112}
     
    713717}
    714718
     719SOAP_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
     763SOAP_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
    715807#ifdef __cplusplus
    716808}
  • branches/pap/Nebulous/nebclient/src/soapStub.h

    r23935 r25027  
    306306#endif
    307307
     308#ifndef SOAP_TYPE_ns1__chmod_USCOREobjectResponse
     309#define SOAP_TYPE_ns1__chmod_USCOREobjectResponse (58)
     310/* ns1:chmod_objectResponse */
     311struct 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 */
     320struct 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 */
     330struct 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 */
     339struct ns1__prune_USCOREobject
     340{
     341        char *key;      /* optional element of type xsd:string */
     342};
     343#endif
     344
    308345#ifndef SOAP_TYPE_SOAP_ENV__Header
    309 #define SOAP_TYPE_SOAP_ENV__Header (57)
     346#define SOAP_TYPE_SOAP_ENV__Header (63)
    310347/* SOAP Header: */
    311348struct SOAP_ENV__Header
     
    318355
    319356#ifndef SOAP_TYPE_SOAP_ENV__Code
    320 #define SOAP_TYPE_SOAP_ENV__Code (58)
     357#define SOAP_TYPE_SOAP_ENV__Code (64)
    321358/* SOAP Fault Code: */
    322359struct SOAP_ENV__Code
     
    328365
    329366#ifndef SOAP_TYPE_SOAP_ENV__Detail
    330 #define SOAP_TYPE_SOAP_ENV__Detail (60)
     367#define SOAP_TYPE_SOAP_ENV__Detail (66)
    331368/* SOAP-ENV:Detail */
    332369struct SOAP_ENV__Detail
     
    339376
    340377#ifndef SOAP_TYPE_SOAP_ENV__Reason
    341 #define SOAP_TYPE_SOAP_ENV__Reason (63)
     378#define SOAP_TYPE_SOAP_ENV__Reason (69)
    342379/* SOAP-ENV:Reason */
    343380struct SOAP_ENV__Reason
     
    348385
    349386#ifndef SOAP_TYPE_SOAP_ENV__Fault
    350 #define SOAP_TYPE_SOAP_ENV__Fault (64)
     387#define SOAP_TYPE_SOAP_ENV__Fault (70)
    351388/* SOAP Fault: */
    352389struct SOAP_ENV__Fault
     
    437474SOAP_FMAC5 int SOAP_FMAC6 ns1__stat_USCOREobject(struct soap*, char *key, struct ns1__stat_USCOREobjectResponse *_param_4);
    438475
     476SOAP_FMAC5 int SOAP_FMAC6 ns1__chmod_USCOREobject(struct soap*, char *key, int mode, int *result);
     477
     478SOAP_FMAC5 int SOAP_FMAC6 ns1__prune_USCOREobject(struct soap*, char *key, int *result);
     479
    439480/******************************************************************************\
    440481 *                                                                            *
     
    472513SOAP_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);
    473514
     515SOAP_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
     517SOAP_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
    474519/******************************************************************************\
    475520 *                                                                            *
     
    509554
    510555SOAP_FMAC5 int SOAP_FMAC6 soap_serve_ns1__stat_USCOREobject(struct soap*);
     556
     557SOAP_FMAC5 int SOAP_FMAC6 soap_serve_ns1__chmod_USCOREobject(struct soap*);
     558
     559SOAP_FMAC5 int SOAP_FMAC6 soap_serve_ns1__prune_USCOREobject(struct soap*);
    511560
    512561#ifdef __cplusplus
  • branches/pap/Nebulous/nebclient/tests/tap

    • Property svn:mergeinfo deleted
  • branches/pap/Nebulous/nebclient/tests/tests.c

    r21461 r25027  
    2020    char            *key = "foobarbaz";
    2121
    22     plan_tests(28);
     22    plan_tests(31);
    2323
    2424    if (getenv("NEB_SERVER")) {
     
    9898
    9999    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");
    101101    char **xattrs = NULL;
    102102    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");
    106105    neb_ok(server, nebRemoveXattr(server, key, "user.copies"), "remove user.copies xattr");
    107106
     
    136135    neb_ok(server, nebMove(server, "copyiedfile", "movedfile"), "move object");
    137136
     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
    138145    if (!nebDelete(server, "movedfile")) {
    139146        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  
    1010use Apache::Test qw( -withtestmore );
    1111
    12 plan tests => 9;
     12plan tests => 13;
    1313
    1414use lib qw( ./t ./lib );
     
    2626        proxy => "http://$hostport/nebulous",
    2727    );
    28     $neb->create( "foo" );
     28    my $uri = $neb->create( "foo" );
    2929
    3030    ok( $neb->delete( "foo" ), "delete object" );
     31
     32    ok( ! -e _get_file_path($uri), "deleted file" );
    3133
    3234    my $locations = $neb->find_instances( "foo" );
     
    7678}
    7779
     80# force flag
     81Test::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
     92Test::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
    78103Test::Nebulous->setup;
    79104
     
    84109    $neb->delete();
    85110};
    86 like( $@, qr/1 was expected/, "no params" );
     111like( $@, qr/1 - 2 were expected/, "no params" );
    87112
    88113Test::Nebulous->setup;
     
    92117        proxy => "http://$hostport/nebulous",
    93118    );
    94     $neb->delete( "foo", 2 );
     119    $neb->delete( "foo", 3);
    95120};
    96 like( $@, qr/1 was expected/, "too many params" );
     121like( $@, qr/is boolean/, "force flag not boolean" );
     122
     123Test::Nebulous->setup;
     124
     125eval {
     126    my $neb = Nebulous::Client->new(
     127        proxy => "http://$hostport/nebulous",
     128    );
     129    $neb->delete( "foo", 0, 2 );
     130};
     131like( $@, qr/1 - 2 were expected/, "too many params" );
    97132
    98133Test::Nebulous->cleanup;
  • branches/pap/Nebulous/t/62_client_delete_instance.t

    r23934 r25027  
    1010use Apache::Test qw( -withtestmore );
    1111
    12 plan tests => 11;
     12plan tests => 10;
    1313
    1414use lib qw( ./t ./lib );
     
    3535
    3636    is( $uri, @$locations[0], "delete instance" );
    37 
    38     ok( ! -e _get_file_path( @$locations[0] ), "deleted file" );
    3937}
    4038
  • branches/pap/Nebulous/t/63_client_stat.t

    r13203 r25027  
    1010use Apache::Test qw( -withtestmore );
    1111
    12 plan tests => 12;
     12plan tests => 13;
    1313
    1414use lib qw( ./t ./lib );
     
    3030    my $info = $neb->stat( "foo" );
    3131
    32     is( scalar @$info, 7, "number of columns" );
     32    is( scalar @$info, 8, "number of columns" );
    3333}
    3434
     
    4343    my $info = $neb->stat( "foo" );
    4444
    45     is( scalar @$info, 7,                       "number of columns" );
     45    is( scalar @$info, 8,                       "number of columns" );
    4646    is( @$info[0], 1,                           "so_id" );
    4747    is( @$info[1], "foo",                       "ext_id" );
     
    5050    like( @$info[4], qr/....-..-.. ..:..:../,   "epoch" );
    5151    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" );
    5354}
    5455
  • branches/pap/Nebulous/t/66_client_xattr.t

    r17750 r25027  
    11#!/usr/bin/perl
    22
    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
    64
    75use strict;
     
    97
    108use Apache::Test qw( -withtestmore );
    11 plan tests => 32;
    12 
     9plan tests => 44;
    1310
    1411use lib qw( ./t ./lib );
     
    2017my $hostport = Apache::Test->config->{ 'hostport' };
    2118
     19my $neb = Nebulous::Client->new(
     20    proxy => "http://$hostport/nebulous",
     21);
     22
    2223# 1 key / xattr
    2324
     
    2526
    2627{
    27     my $neb = Nebulous::Client->new(
    28         proxy => "http://$hostport/nebulous",
    29     );
    30 
    3128    my $uri = $neb->create('foo');
    3229
    33     ok($neb->setxattr('foo', 'bar', 'baz', 'create'), 'set object xattr');
     30    ok($neb->setxattr('foo', 'user.bar', 'baz', 'create'), 'set object xattr');
    3431    {
    3532        my $xattrs = $neb->listxattr('foo');
    3633        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');
    4138    is($value, 'baz', 'xattr value');
    4239
    43     ok($neb->removexattr('foo', 'bar'), "remove object xattr");
     40    ok($neb->removexattr('foo', 'user.bar'), "remove object xattr");
    4441    {
    4542        my $xattrs = $neb->listxattr('foo');
     
    5350
    5451{
    55     my $neb = Nebulous::Client->new(
    56         proxy => "http://$hostport/nebulous",
    57     );
    58 
    5952    my $uri = $neb->create('foo');
    6053
    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');
    6356   
    6457    {
    6558        my $xattrs = $neb->listxattr('foo');
    6659        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');
    7265    is($value, 'baz', 'xattr value');
    73     $value = $neb->getxattr('foo', 'bonk');
     66    $value = $neb->getxattr('foo', 'user.bonk');
    7467    is($value, 'quix', 'xattr value');
    7568
    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");
    7871    {
    7972        my $xattrs = $neb->listxattr('foo');
     
    8780
    8881{
    89     my $neb = Nebulous::Client->new(
    90         proxy => "http://$hostport/nebulous",
    91     );
    92 
    9382    my $uri = $neb->create('foo');
    9483
    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');
    9786   
    9887    {
    9988        my $xattrs = $neb->listxattr('foo');
    10089        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');
    10594    is($value, 'quix', 'xattr value');
    10695
    107     ok($neb->removexattr('foo', 'bar'), "remove object xattr");
     96    ok($neb->removexattr('foo', 'user.bar'), "remove object xattr");
    10897    {
    10998        my $xattrs = $neb->listxattr('foo');
     
    117106
    118107eval {
    119     my $neb = Nebulous::Client->new(
    120         proxy => "http://$hostport/nebulous",
    121     );
    122 
     108    $neb->setxattr('foo', 'user.bar', 'baz', 'create');
     109};
     110like($@, qr/is valid object key/, "create xattr on non-existant key");
     111
     112Test::Nebulous->setup;
     113
     114eval {
     115    $neb->create('foo');
     116
     117    $neb->setxattr('foo', 'luser.bar', 'baz', 'create');
     118};
     119like($@, qr/xattr is in user. namespace/, "user. namspace");
     120
     121Test::Nebulous->setup;
     122
     123eval {
     124    $neb->setxattr('foo', 'user.bar', 'baz', 'replace');
     125};
     126like($@, qr/is valid object key/, "replace xattr on non-existant key");
     127
     128Test::Nebulous->setup;
     129
     130eval {
    123131    $neb->setxattr();
    124132};
     
    128136
    129137eval {
    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');
    137141};
    138142like($@, qr/4 were expected/, "too few params");
     
    141145
    142146eval {
    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');
    150150};
    151151like($@, qr/4 were expected/, "too few params");
     
    154154
    155155eval {
    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');
    163159};
    164160like($@, qr/4 were expected/, "too many params");
    165161
     162# getxattr
     163
     164Test::Nebulous->setup;
     165
     166eval {
     167    $neb->getxattr('foo', 'bar');
     168};
     169like($@, qr/is valid object key/, "get xattr from non-existant nebulous key");
     170
     171Test::Nebulous->setup;
     172
     173eval {
     174    $neb->create('foo');
     175
     176    $neb->getxattr('foo', 'luser.bar');
     177};
     178like($@, qr/xattr is in user. namespace/, "user. namespace");
     179
     180Test::Nebulous->setup;
     181
     182eval {
     183    $neb->create('foo');
     184    $neb->getxattr('foo', 'user.bar');
     185};
     186like($@, qr|xattr neb:///foo:user.bar does not exist|,
     187    "get xattr from non-existant xattr key");
     188
     189Test::Nebulous->setup;
     190
     191eval {
     192    $neb->getxattr();
     193};
     194like($@, qr/2 were expected/, "no params");
     195
     196Test::Nebulous->setup;
     197
     198eval {
     199    $neb->create('foo');
     200
     201    $neb->getxattr('foo');
     202};
     203like($@, qr/2 were expected/, "too few params");
     204
     205Test::Nebulous->setup;
     206
     207eval {
     208    $neb->create('foo');
     209
     210    $neb->getxattr('foo', 'user.bar', 'baz');
     211};
     212like($@, qr/2 were expected/, "too many params");
     213
    166214# listxattr
    167215
     
    169217
    170218eval {
    171     my $neb = Nebulous::Client->new(
    172         proxy => "http://$hostport/nebulous",
    173     );
    174 
    175219    $neb->create('foo');
    176220
     
    182226
    183227eval {
    184     my $neb = Nebulous::Client->new(
    185         proxy => "http://$hostport/nebulous",
    186     );
    187 
    188228    $neb->create('foo');
    189229
     
    192232like($@, qr/1 was expected/, "too many params");
    193233
    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
     236Test::Nebulous->setup;
     237
     238eval {
     239    $neb->removexattr('foo', 'user.bar');
     240};
     241like($@, qr/is valid object key/, "remove xattr from non-existant nebulous key");
     242
     243Test::Nebulous->setup;
     244
     245eval {
     246    $neb->create('foo');
     247
     248    $neb->getxattr('foo', 'luser.bar');
     249};
     250like($@, qr/xattr is in user. namespace/, "user. namespace");
     251
     252Test::Nebulous->setup;
     253
     254eval {
     255    $neb->create('foo');
     256    $neb->removexattr('foo', 'user.bar');
     257};
     258like($@, qr|xattr neb:///foo:user.bar does not exist|,
     259    "remove xattr from non-existant xattr key");
     260
     261Test::Nebulous->setup;
     262
     263eval {
     264    $neb->removexattr();
    204265};
    205266like($@, qr/2 were expected/, "no params");
     
    208269
    209270eval {
    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');
    217274};
    218275like($@, qr/2 were expected/, "too few params");
     
    221278
    222279eval {
    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');
    230283};
    231284like($@, qr/2 were expected/, "too many params");
  • branches/pap/Nebulous/t/70_neb-ls.t

    r23934 r25027  
    3838
    3939# NEB_SERVER env var not set
     40undef $ENV{'NEB_SERVER'} if defined $ENV{'NEB_SERVER'};
    4041Test::Nebulous->setup;
    4142
     
    8283
    8384    is($? >> 8, 0, "exit code");
    84     like($test->stdout, qr/^foo bar$/,  "stdout");
     85    like($test->stdout, qr/^bar\nfoo$/,  "stdout");
    8586    like($test->stderr, qr/^$/,         "stderr");
    8687}
     
    9899
    99100    is($? >> 8, 0, "exit code");
    100     like($test->stdout, qr/^foo\nbar\n$/,   "stdout");
     101    like($test->stdout, qr/^bar\nfoo\n$/,   "stdout");
    101102    like($test->stderr, qr/^$/,             "stderr");
    102103}
     
    114115
    115116    is($? >> 8, 0, "exit code");
    116     like($test->stdout, qr/^foo\nbar\n$/,   "stdout");
     117    like($test->stdout, qr/^bar\nfoo\n$/,   "stdout");
    117118    like($test->stderr, qr/^$/,             "stderr");
    118119}
     
    160161
    161162    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");
    163164    like($test->stderr, qr/^$/,             "stderr");
    164165}
     
    192193
    193194    is($? >> 8, 0, "exit code");
    194     like($test->stdout, qr|^a/foo$|,        "stdout");
     195    like($test->stdout, qr|^a/b/\na/foo$|,        "stdout");
    195196    like($test->stderr, qr/^$/,             "stderr");
    196197}
  • branches/pap/Nebulous/t/conf/startup.pl.in

    r23934 r25027  
    1818my $config = Nebulous::Server::Config->new(
    1919    trace       => 'all',
     20    memcached_servers => ['127.0.0.1:11211'],
    2021);
    2122$config->add_db(
Note: See TracChangeset for help on using the changeset viewer.