Produced by Araxis Merge on 4/12/2018 10:18:29 AM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | MSSRe Build 4.zip\Applications\OncoTrax-E40 | OncologyCGI.cpp | Tue Apr 10 19:43:39 2018 UTC |
| 2 | MSSRe Build 4.zip\Applications\OncoTrax-E40 | OncologyCGI.cpp | Wed Apr 11 17:42:04 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 314 |
| Changed | 1 | 2 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | /********* ********** ********** ********** ********** ********** ********** ********** / | |
| 2 | /* Packag e: ON C – Oncolo gy * / | |
| 3 | /* Date C reated: Ju l 26,2004 * / | |
| 4 | /* Site N ame: Hi nes OIFO * / | |
| 5 | /* Developers : Sergey Gav rilov PII ) */ | |
| 6 | /* Descri ption: Th is unit co ntains mai n entry po int of the Oncology web- * / | |
| 7 | /* se rvice (CGI applicati on). * / | |
| 8 | /********* ********** ********** ********** ********** ********** ********** ********** / | |
| 9 | #include " stdafx.h" | |
| 10 | #include " OncologyCG I.h" | |
| 11 | ||
| 12 | int Global InputDataH asError; | |
| 13 | char* Glob alOutputFi leName; | |
| 14 | //***** CH ECKS CGI E NVIRONMENT VARIABLES | |
| 15 | ||
| 16 | void check Environmen t( | |
| 17 | in t *clength ) // Con tent Lengt h in bytes is return ed via thi s paramete r (-1 if n ot sent by client) | |
| 18 | { | |
| 19 | *c length = - 1; | |
| 20 | ||
| 21 | ||
| 22 | #i fndef _DEB UG | |
| 23 | //-- - Request Type | |
| 24 | char *request_ method = g etenv("REQ UEST_METHO D"); | |
| 25 | if( request_me thod == NU LL ) | |
| 26 | throw TONCFault( EC_UNKNOWN _METHOD); | |
| 27 | if( _strcmpi(r equest_met hod, "POST ") ) | |
| 28 | throw TONCFault( EC_UNSUP_M ETHOD, req uest_metho d); | |
| 29 | ||
| 30 | //-- - Content Type | |
| 31 | char *content_ type = get env("CONTE NT_TYPE"); | |
| 32 | if( content_ty pe == NULL ) | |
| 33 | throw TONCFault( EC_UNKNOWN _CONTENT); | |
| 34 | if( _strcmpi(c ontent_typ e, "text/x ml") ) | |
| 35 | throw TONCFault( EC_UNSUP_C ONTENT, co ntent_type ); | |
| 36 | ||
| 37 | //-- - Content Length | |
| 38 | char *content_ length = g etenv("CON TENT_LENGT H"); | |
| 39 | if( content_le ngth != NU LL ) | |
| 40 | *cleng th = atoi( content_le ngth); | |
| 41 | #e ndif | |
| 42 | } | |
| 43 | ||
| 44 | ||
| 45 | ||
| 46 | ||
| 47 | //***** MA IN ENTRY P OINT | |
| 48 | ||
| 49 | int __cdec l main() | |
| 50 | { | |
| 51 | FI LE *stream = NULL; | |
| 52 | bo ol hasErro r = false; | |
| 53 | Gl obalInputD ataHasErro r = 0; | |
| 54 | TO NCParser P arser; | |
| 55 | ch ar* debugF ile; | |
| 56 | ||
| 57 | #i fdef _DEBU G | |
| 58 | //-- - Uncommen t the foll owing line to perfor m unit tes ts. | |
| 59 | //re turn UnitT ests(); | |
| 60 | //-- - Debug ve rsion read s the requ est from a file. | |
| 61 | freo pen_s(&str eam, "c:\\ temp\\req. txt", "r", stdin); | |
| 62 | //Sl eep(30); | |
| 63 | #e ndif | |
| 64 | ||
| 65 | ||
| 66 | // --- HTTP H eaders | |
| 67 | pu ts("Cache- Control: n o-store"); | |
| 68 | pu ts("Conten t-Type: te xt/xml\n") ; | |
| 69 | ||
| 70 | // --- SOAP H eader | |
| 71 | pu ts("<?xml version=\" 1.0\" enco ding=\"utf -8\"?>"); | |
| 72 | pr intf("<soa p:Envelope xmlns:soa p=\"http:/ /www.w3.or g/2001/12/ soap-envel ope\""); | |
| 73 | pu ts(" soap: encodingSt yle=\"http ://www.w3. org/2001/1 2/soap-enc oding\">") ; | |
| 74 | pu ts("<soap: Body>"); | |
| 75 | ||
| 76 | tr y | |
| 77 | { | |
| 78 | ||
| 79 | int content_le ngth; | |
| 80 | ||
| 81 | //-- - Check CG I environm ent variab les | |
| 82 | chec kEnvironme nt(&conten t_length); | |
| 83 | ||
| 84 | //-- - Disable <CR><LF> t ranslation for stand ard input | |
| 85 | _set mode(_file no(stdin), _O_BINARY ); | |
| 86 | ||
| 87 | debu gFile = Pa rser.GetDu bugFileNam e(); | |
| 88 | ||
| 89 | //-- - Parse re quest para meters and create re quest desc riptor | |
| 90 | TONC Request *R equest = P arser.pars eParameter s(content_ length, de bugFile); | |
| 91 | ||
| 92 | //-- - Process the reques t | |
| 93 | if( Request != NULL ) | |
| 94 | { | |
| 95 | try | |
| 96 | { | |
| 97 | Request- >executeRe quest(); | |
| 98 | Request- >processEr rors(); | |
| 99 | } | |
| 100 | catch( ...) | |
| 101 | { | |
| 102 | delete R equest; | |
| 103 | throw; | |
| 104 | hasError = true; | |
| 105 | } | |
| 106 | delete Request; | |
| 107 | } | |
| 108 | else | |
| 109 | { | |
| 110 | throw TONCFault( EC_INVALID _REQUEST); | |
| 111 | hasErr or = true; | |
| 112 | } | |
| 113 | } | |
| 114 | // --- Proces s exceptio ns explici tly genera ted by the Oncology code | |
| 115 | ca tch(TONCFa ult Fault) | |
| 116 | { | |
| 117 | Faul t.output() ; | |
| 118 | hasE rror = tru e; | |
| 119 | } | |
| 120 | // --- Proces s all othe r (unexpec ted) excep tions | |
| 121 | ca tch(...) | |
| 122 | { | |
| 123 | TONC Fault Faul t(EC_SERVE R_EXCEPTIO N); | |
| 124 | Faul t.output() ; | |
| 125 | hasE rror = tru e; | |
| 126 | } | |
| 127 | ||
| 128 | // --- SOAP T railer | |
| 129 | pu ts("</soap :Body>"); | |
| 130 | pu ts("</soap :Envelope> "); | |
| 131 | ||
| 132 | #i fdef _DEBU G | |
| 133 | //-- - Debug ve rsion chec ks for mem ory leaks | |
| 134 | _Crt DumpMemory Leaks(); | |
| 135 | #e ndif | |
| 136 | ||
| 137 | // Delete th e output f ile if the re is erro r | |
| 138 | if ((hasErro r || Globa lInputData HasError > 0) && Glo balOutputF ileName != NULL) | |
| 139 | { | |
| 140 | remo ve (Global OutputFile Name); | |
| 141 | } | |
| 142 | ||
| 143 | // Delete th e debug fi le if the DEBUG flag is not se t to 1 in the enviro nment vari able "ONCS RV_DEBUG" | |
| 144 | ch ar* debug = Parser.G etConfigVa lue(INI_FI LE_NAME, D EBUG_CONFI G_VALUE_ST ART_TAG, D EBUG_CONFI G_VALUE_EN D_TAG); | |
| 145 | if (debug) | |
| 146 | { | |
| 147 | if ( debug[0] ! = '1') | |
| 148 | { | |
| 149 | remove (debugFil e); | |
| 150 | } | |
| 151 | } | |
| 152 | el se | |
| 153 | { | |
| 154 | remo ve (debugF ile); | |
| 155 | } | |
| 156 | ||
| 157 | re turn EXIT_ SUCCESS; | |
| 158 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.