Changeset 2700


Ignore:
Timestamp:
5/25/2012 4:21:04 AM (2 years ago)
Author:
lowjoel
Message:

Forgot to include the additional post data provided to QueryServer?. Also, parse the result of an upload to obtain the ID of the report.

Location:
trunk/eraser
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser/Eraser.BlackBox/BlackBoxReportUploader.cs

    r2699 r2700  
    209209                    progress, 0.5f, "Uploading")); 
    210210 
    211                 QueryServer("upload", delegate(long uploaded, long total) 
     211                XmlDocument result = QueryServer("upload", delegate(long uploaded, long total) 
    212212                    { 
    213213                        progress.Total = total; 
     
    216216                    }, fields.ToArray()); 
    217217 
    218  
    219                 Report.Submitted = true; 
     218                //Parse the result document 
     219                XmlNode node = result.SelectSingleNode("/crashReport"); 
     220                string reportStatus = node.Attributes.GetNamedItem("status").Value; 
     221                if (reportStatus == "exists") 
     222                { 
     223                    string reportId = node.Attributes.GetNamedItem("id").Value; 
     224                    Report.Submitted = true; 
     225                    Report.ID = Convert.ToInt32(reportId); 
     226                } 
    220227            } 
    221228        } 
     
    259266            PostDataBuilder builder = new PostDataBuilder(); 
    260267            builder.AddPart(new PostDataField("action", action)); 
     268            builder.AddParts(fields); 
    261269 
    262270            WebRequest reportRequest = HttpWebRequest.Create(BlackBoxServer); 
  • trunk/eraser/Eraser.Util/PostDataBuilder.cs

    r2516 r2700  
    8787        } 
    8888 
     89        public void AddParts(ICollection<PostDataField> fields) 
     90        { 
     91            foreach (PostDataField field in fields) 
     92                AddPart(field); 
     93        } 
     94 
    8995        /// <summary> 
    9096        /// Gets a stream with which to read the data from. 
Note: See TracChangeset for help on using the changeset viewer.